mlbench123 commited on
Commit
3f473a4
·
verified ·
1 Parent(s): 85c4555

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -2140,6 +2140,18 @@ with gr.Blocks(
2140
  - `GET /api/health` - Health check
2141
  """)
2142
 
 
 
 
 
 
 
 
 
 
 
 
 
2143
  # ============= Mount and Launch =============
2144
  # if __name__ == "__main__":
2145
  # # Mount Gradio to FastAPI
 
2140
  - `GET /api/health` - Health check
2141
  """)
2142
 
2143
+ app = gr.mount_gradio_app(app, demo, path="/")
2144
+
2145
+ # For Hugging Face Spaces, we need to expose the app
2146
+ if __name__ == "__main__":
2147
+ import uvicorn
2148
+ uvicorn.run(
2149
+ app,
2150
+ host="0.0.0.0",
2151
+ port=7860,
2152
+ log_level="info"
2153
+ )
2154
+
2155
  # ============= Mount and Launch =============
2156
  # if __name__ == "__main__":
2157
  # # Mount Gradio to FastAPI