qqwjq1981 commited on
Commit
d90543f
·
verified ·
1 Parent(s): 3208ef8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1139,7 +1139,7 @@ logging.debug(f"Gradio version: {gr.__version__}")
1139
  logging.debug(f"FastAPI version: {fastapi.__version__}")
1140
 
1141
  # Mount the Gradio ASGI app at "/gradio"
1142
- app.mount("/gradio", gradio_asgi_app)
1143
 
1144
  # Dynamically check for the Gradio asset directory
1145
  gradio_assets_path = os.path.join(os.path.dirname(gr.__file__), "static")
@@ -1150,10 +1150,10 @@ if os.path.exists(gradio_assets_path):
1150
  else:
1151
  logging.error(f"Gradio assets directory not found at: {gradio_assets_path}")
1152
 
1153
- # Redirect from the root endpoint to the Gradio app
1154
- @app.get("/", response_class=RedirectResponse)
1155
- async def index():
1156
- return {"message": "FastAPI is running. Visit /gradio for the Gradio interface."}
1157
 
1158
  # return RedirectResponse(url="/gradio", status_code=307)
1159
 
 
1139
  logging.debug(f"FastAPI version: {fastapi.__version__}")
1140
 
1141
  # Mount the Gradio ASGI app at "/gradio"
1142
+ app.mount("/", gradio_asgi_app)
1143
 
1144
  # Dynamically check for the Gradio asset directory
1145
  gradio_assets_path = os.path.join(os.path.dirname(gr.__file__), "static")
 
1150
  else:
1151
  logging.error(f"Gradio assets directory not found at: {gradio_assets_path}")
1152
 
1153
+ # # Redirect from the root endpoint to the Gradio app
1154
+ # @app.get("/", response_class=RedirectResponse)
1155
+ # async def index():
1156
+ # return {"message": "FastAPI is running. Visit /gradio for the Gradio interface."}
1157
 
1158
  # return RedirectResponse(url="/gradio", status_code=307)
1159