Spaces:
Sleeping
Sleeping
Update main.py
Browse files
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=
|
79 |
|
80 |
# Run server
|
81 |
if __name__ == "__main__":
|
82 |
# Set SSR mode for Spaces
|
83 |
-
|
|
|
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)
|