Skip to content

Commit

Permalink
Added arguments to tt-explorer program (#1557)
Browse files Browse the repository at this point in the history
  • Loading branch information
vprajapati-tt authored Dec 12, 2024
1 parent be179fc commit f97c45b
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion tools/explorer/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,34 @@
# SPDX-License-Identifier: Apache-2.0

import model_explorer
import argparse

parser = argparse.ArgumentParser(prog="tt-explorer")
parser.add_argument(
"-p",
"--port",
help="Port that model-explorer server will be exposed to",
type=int,
default=8080,
)
parser.add_argument(
"-u", "--url", help="Host URL Address for server", default="localhost"
)
parser.add_argument(
"-q",
"--no-browser",
help="Create server without opening browser tab",
action="store_true",
)

args = parser.parse_args()

# TODO(odjuricic): Hack to make our extension default for .mlir files.
# This can be handled better when we switch to our model-explorer fork.
model_explorer.extension_manager.ExtensionManager.BUILTIN_ADAPTER_MODULES = []
model_explorer.visualize(extensions=["tt_adapter"])
model_explorer.visualize_from_config(
extensions=["tt_adapter"],
no_open_in_browser=args.no_browser,
port=args.port,
host=args.url,
)

0 comments on commit f97c45b

Please sign in to comment.