qqwjq1981 commited on
Commit
7285888
·
verified ·
1 Parent(s): 10d0c14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -1136,6 +1136,10 @@ gradio_asgi_app = gr.routes.App.create_app(demo)
1136
  # Mount the Gradio ASGI app at "/gradio"
1137
  app.mount("/gradio", gradio_asgi_app)
1138
 
 
 
 
 
1139
  # Redirect from the root endpoint to the Gradio app
1140
  @app.get("/", response_class=RedirectResponse)
1141
  async def index():
 
1136
  # Mount the Gradio ASGI app at "/gradio"
1137
  app.mount("/gradio", gradio_asgi_app)
1138
 
1139
+ # Mount static files for Gradio assets
1140
+ gradio_assets_path = os.path.join(os.path.dirname(gr.__file__), "static")
1141
+ app.mount("/assets", StaticFiles(directory=gradio_assets_path), name="assets")
1142
+
1143
  # Redirect from the root endpoint to the Gradio app
1144
  @app.get("/", response_class=RedirectResponse)
1145
  async def index():