qqwjq1981 commited on
Commit
7144c88
·
verified ·
1 Parent(s): 52668f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1131,10 +1131,11 @@ def create_gradio_interface(state=None):
1131
  # In[21]:
1132
 
1133
  demo = create_gradio_interface()
1134
- gradio_app = demo.asgi
 
1135
 
1136
  # Mount the Gradio ASGI app at "/gradio"
1137
- app.mount("/gradio", gradio_app)
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)