Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
#
|
| 1138 |
-
app
|
|
|
|
| 1139 |
|
| 1140 |
-
#
|
| 1141 |
-
|
| 1142 |
-
|
| 1143 |
-
|
|
|
|
|
|
|
|
|
|
| 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__":
|