Spaces:
Running on Zero
Running on Zero
Expose mounted FastAPI app for Spaces
Browse files
app.py
CHANGED
|
@@ -232,8 +232,9 @@ with gr.Blocks(title="Respite API") as demo:
|
|
| 232 |
|
| 233 |
# Mount the Gradio UI under the FastAPI application so API routes remain
|
| 234 |
# available at /api/* instead of being handled by Gradio's catch-all route.
|
|
|
|
| 235 |
app = gr.mount_gradio_app(api, demo, path="/")
|
| 236 |
|
| 237 |
# Spaces starts the app itself; this block is only for direct local execution.
|
| 238 |
if __name__ == "__main__":
|
| 239 |
-
demo.
|
|
|
|
| 232 |
|
| 233 |
# Mount the Gradio UI under the FastAPI application so API routes remain
|
| 234 |
# available at /api/* instead of being handled by Gradio's catch-all route.
|
| 235 |
+
demo.queue(max_size=4, default_concurrency_limit=1)
|
| 236 |
app = gr.mount_gradio_app(api, demo, path="/")
|
| 237 |
|
| 238 |
# Spaces starts the app itself; this block is only for direct local execution.
|
| 239 |
if __name__ == "__main__":
|
| 240 |
+
demo.launch()
|