qqwjq1981 commited on
Commit
5a2bd7c
·
verified ·
1 Parent(s): 7144c88

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -9
app.py CHANGED
@@ -1129,18 +1129,22 @@ def create_gradio_interface(state=None):
1129
 
1130
 
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)
1142
- async def index():
1143
- return RedirectResponse(url="/gradio", status_code=307)
 
 
 
1144
 
1145
  # Run the FastAPI server using uvicorn
1146
  if __name__ == "__main__":
 
1129
 
1130
 
1131
  # In[21]:
1132
+ @app.get("/", response_class=JSONResponse)
1133
+ async def index():
1134
+ return {"status": "FastAPI is running!"}
1135
 
 
 
 
1136
 
1137
+ # demo = create_gradio_interface()
1138
+ # # Use Gradio's `server_app` to get an ASGI app for Blocks
1139
+ # gradio_asgi_app = gr.routes.App.create_app(demo)
1140
 
1141
+ # # Mount the Gradio ASGI app at "/gradio"
1142
+ # app.mount("/gradio", gradio_asgi_app)
1143
+
1144
+ # # Redirect from the root endpoint to the Gradio app
1145
+ # @app.get("/", response_class=RedirectResponse)
1146
+ # async def index():
1147
+ # return RedirectResponse(url="/gradio", status_code=307)
1148
 
1149
  # Run the FastAPI server using uvicorn
1150
  if __name__ == "__main__":