cazyundee commited on
Commit
1fc2a60
·
verified ·
1 Parent(s): 8be6d5e

Mount Respite API with Gradio UI

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -227,6 +227,10 @@ with gr.Blocks(title="Stable Audio 3 Small") as demo:
227
  )
228
 
229
 
230
- demo.queue(max_size=4, default_concurrency_limit=1).launch(
231
- app_kwargs={"app": api}
232
- )
 
 
 
 
 
227
  )
228
 
229
 
230
+ # Mount the Gradio UI under the FastAPI application so API routes remain
231
+ # available at /api/* instead of being handled by Gradio's catch-all route.
232
+ app = gr.mount_gradio_app(api, demo, path="/")
233
+
234
+ if __name__ == "__main__":
235
+ import uvicorn
236
+ uvicorn.run(app, host="0.0.0.0", port=int(os.environ.get("PORT", "7860")))