Fix Space crash: disable gradio SSR mode
Browse files
app.py
CHANGED
|
@@ -532,8 +532,15 @@ fastapi_app.get("/logout")(_forward_to_gradio("/logout"))
|
|
| 532 |
|
| 533 |
|
| 534 |
# root_path makes gradio generate internal links (OAuth login, etc.)
|
| 535 |
-
# under /gradio instead of the app root.
|
| 536 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 537 |
|
| 538 |
|
| 539 |
@fastapi_app.get("/healthz")
|
|
|
|
| 532 |
|
| 533 |
|
| 534 |
# root_path makes gradio generate internal links (OAuth login, etc.)
|
| 535 |
+
# under /gradio instead of the app root. ssr_mode=False is required on
|
| 536 |
+
# Spaces: SSR's node server would grab port 7860 and starve uvicorn.
|
| 537 |
+
fastapi_app = gr.mount_gradio_app(
|
| 538 |
+
fastapi_app,
|
| 539 |
+
demo,
|
| 540 |
+
path="/gradio",
|
| 541 |
+
root_path="/gradio",
|
| 542 |
+
ssr_mode=False,
|
| 543 |
+
)
|
| 544 |
|
| 545 |
|
| 546 |
@fastapi_app.get("/healthz")
|