m7n commited on
Commit
bfc464c
·
verified ·
1 Parent(s): 5e58be1

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -2
main.py CHANGED
@@ -74,11 +74,16 @@ with gr.Blocks() as demo:
74
  outputs=output
75
  )
76
 
 
 
 
 
77
  # Mount Gradio app to FastAPI with SSR mode for Spaces
78
- app = gr.mount_gradio_app(app, demo, path="/", ssr_mode=False)
79
 
80
  # Run server
81
  if __name__ == "__main__":
82
  # Set SSR mode for Spaces
83
- os.environ["GRADIO_SSR_MODE"] = "False"
 
84
  uvicorn.run(app, host="0.0.0.0", port=7860)
 
74
  outputs=output
75
  )
76
 
77
+
78
+ os.environ["GRADIO_ROOT_PATH"] = "https://m7n-zero-gpu-uvicorn-ssr-example.hf.space/assets"
79
+
80
+
81
  # Mount Gradio app to FastAPI with SSR mode for Spaces
82
+ app = gr.mount_gradio_app(app, demo, path="/", ssr_mode=True)
83
 
84
  # Run server
85
  if __name__ == "__main__":
86
  # Set SSR mode for Spaces
87
+
88
+
89
  uvicorn.run(app, host="0.0.0.0", port=7860)