Skip to content

Commit

Permalink
Hotfix: Fixes path for wheel distribution, sets environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Hatt committed Oct 23, 2024
1 parent 7d78678 commit 23cfe28
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 6 additions & 1 deletion backend/ttnn_visualizer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from werkzeug.debug import DebuggedApplication
from werkzeug.middleware.proxy_fix import ProxyFix

from backend.ttnn_visualizer.exceptions import DatabaseFileNotFoundException
from ttnn_visualizer.exceptions import DatabaseFileNotFoundException
from ttnn_visualizer.settings import Config, DefaultConfig

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -133,6 +133,11 @@ def handle_database_not_found_error(error):


def main():

run_command = sys.argv[0].split("/")
if run_command[-1] == "ttnn-visualizer":
os.environ.setdefault("FLASK_ENV", "production")

config = Config()

# Check if DEBUG environment variable is set
Expand Down
5 changes: 2 additions & 3 deletions backend/ttnn_visualizer/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from ttnn_visualizer.exceptions import DatabaseFileNotFoundException
import paramiko

from backend.ttnn_visualizer.exceptions import DatabaseFileNotFoundException
from backend.ttnn_visualizer.ssh_client import get_client
from ttnn_visualizer.exceptions import DatabaseFileNotFoundException
from ttnn_visualizer.ssh_client import get_client
from ttnn_visualizer.models import (
Operation,
DeviceOperation,
Expand Down Expand Up @@ -261,7 +261,6 @@ def query_buffer_pages(
for row in rows:
yield BufferPage(*row)


def query_tensors(self) -> Generator[Tensor, None, None]:
query = "SELECT * FROM tensors"
rows = self.execute_query(query)
Expand Down
3 changes: 1 addition & 2 deletions backend/ttnn_visualizer/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

from flask import request, jsonify, current_app

from backend.ttnn_visualizer.utils import get_report_path
from ttnn_visualizer.utils import get_report_path
from ttnn_visualizer.models import (
RemoteConnection,
RemoteFolder,
TabSession,
TabSessionTable,
)
from ttnn_visualizer.extensions import db
Expand Down

0 comments on commit 23cfe28

Please sign in to comment.