CodeSoft commited on
Commit
f44cc6a
·
verified ·
1 Parent(s): 0b5f313

Fix Space crash: disable gradio SSR mode

Browse files
Files changed (1) hide show
  1. app.py +9 -2
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
- fastapi_app = gr.mount_gradio_app(fastapi_app, demo, path="/gradio", root_path="/gradio")
 
 
 
 
 
 
 
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")