Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1131,10 +1131,11 @@ def create_gradio_interface(state=None):
|
|
1131 |
# In[21]:
|
1132 |
|
1133 |
demo = create_gradio_interface()
|
1134 |
-
|
|
|
1135 |
|
1136 |
# Mount the Gradio ASGI app at "/gradio"
|
1137 |
-
app.mount("/gradio",
|
1138 |
|
1139 |
# Redirect from the root endpoint to the Gradio app
|
1140 |
@app.get("/", response_class=RedirectResponse)
|
|
|
1131 |
# In[21]:
|
1132 |
|
1133 |
demo = create_gradio_interface()
|
1134 |
+
# Use Gradio's `server_app` to get an ASGI app for Blocks
|
1135 |
+
gradio_asgi_app = gr.routes.App.create_app(demo)
|
1136 |
|
1137 |
# Mount the Gradio ASGI app at "/gradio"
|
1138 |
+
app.mount("/gradio", gradio_asgi_app)
|
1139 |
|
1140 |
# Redirect from the root endpoint to the Gradio app
|
1141 |
@app.get("/", response_class=RedirectResponse)
|