rabie54654 commited on
Commit
ece086a
·
1 Parent(s): a2c2e91

Remove uvicorn run to let HF launcher handle it

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -36,6 +36,4 @@ with gr.Blocks() as demo:
36
  # We serve Gradio at /gradio, and the rest is our FastAPI app (which serves React)
37
  app = gr.mount_gradio_app(fastapi_app, demo, path="/gradio")
38
 
39
- if __name__ == "__main__":
40
- port = int(os.getenv("PORT", "7860"))
41
- uvicorn.run(app, host="0.0.0.0", port=port)
 
36
  # We serve Gradio at /gradio, and the rest is our FastAPI app (which serves React)
37
  app = gr.mount_gradio_app(fastapi_app, demo, path="/gradio")
38
 
39
+ # Hugging Face will automatically run Uvicorn on `app`