mployd-engineering commited on
Commit
88fcd12
·
verified ·
1 Parent(s): 7fc92d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -290,5 +290,6 @@ app = gr.mount_gradio_app(app, demo, path="/")
290
  # --- Launch ---
291
  if __name__ == "__main__":
292
  load_model()
293
- # Use uvicorn to run the FastAPI app, which hosts the Gradio interface
294
- uvicorn.run(app, host="0.0.0.0", port=7860)
 
 
290
  # --- Launch ---
291
  if __name__ == "__main__":
292
  load_model()
293
+ # Use environment variable PORT if available, otherwise default to 7860
294
+ port = int(os.environ.get("PORT", 7860))
295
+ uvicorn.run(app, host="0.0.0.0", port=port)