m7n commited on
Commit
a3eebe6
·
verified ·
1 Parent(s): 2daa956

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -0
main.py CHANGED
@@ -78,6 +78,7 @@ with gr.Blocks() as demo:
78
 
79
  #os.environ["GRADIO_ROOT_PATH"] = "https://m7n-zero-gpu-uvicorn-ssr-example.hf.space/_app/immutable/"
80
 
 
81
 
82
  # Mount Gradio app to FastAPI with SSR mode for Spaces
83
  app = gr.mount_gradio_app(app, demo, path="/", ssr_mode=True)
@@ -91,6 +92,8 @@ if not assets_dir.exists():
91
  assets_dir.mkdir(parents=True, exist_ok=True) # Create the folder if it doesn't exist
92
 
93
  app.mount("/_app/immutable/assets", StaticFiles(directory=str(assets_dir)), name="immutable_assets")
 
 
94
  # Run server
95
  if __name__ == "__main__":
96
  # Set SSR mode for Spaces
 
78
 
79
  #os.environ["GRADIO_ROOT_PATH"] = "https://m7n-zero-gpu-uvicorn-ssr-example.hf.space/_app/immutable/"
80
 
81
+ os.environ["GRADIO_ROOT_PATH"] = "/_app/immutable"
82
 
83
  # Mount Gradio app to FastAPI with SSR mode for Spaces
84
  app = gr.mount_gradio_app(app, demo, path="/", ssr_mode=True)
 
92
  assets_dir.mkdir(parents=True, exist_ok=True) # Create the folder if it doesn't exist
93
 
94
  app.mount("/_app/immutable/assets", StaticFiles(directory=str(assets_dir)), name="immutable_assets")
95
+
96
+
97
  # Run server
98
  if __name__ == "__main__":
99
  # Set SSR mode for Spaces