Skip to content

Commit 198e5f5

Browse files
author
sd109
committed
Only run web app on localhost in dev mode
1 parent 4088a57 commit 198e5f5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Tiltfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ if run_ui_locally:
5353
serve_cmd=" && ".join([
5454
"source {}/bin/activate".format(venv_name),
5555
"cd chart/web-app",
56-
"python3 app.py {}".format(hf_model),
56+
"python3 app.py {} localhost".format(hf_model),
5757
])
5858
)

chart/web-app/app.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,9 @@ def inference_wrapper(*args):
174174
css=css_overrides,
175175
) as app:
176176
logger.debug("Gradio chat interface config: %s", app.config)
177-
# app.launch(server_name="0.0.0.0") # Do we need this for k8s service?
178-
app.launch()
177+
# For running locally in tilt dev setup
178+
if len(sys.argv) > 2 and sys.argv[2] == "localhost":
179+
app.launch()
180+
# For running on cluster
181+
else:
182+
app.launch(server_name="0.0.0.0")

0 commit comments

Comments
 (0)