Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,12 +19,8 @@ demo = gr.Interface(
|
|
| 19 |
)
|
| 20 |
|
| 21 |
# Mount FastAPI onto Gradio's app
|
| 22 |
-
#
|
| 23 |
demo.app.mount("/api", fastapi_app)
|
| 24 |
|
| 25 |
-
# This line is the key: it exposes the /api/docs route on the main server
|
| 26 |
-
# by re-mounting the FastAPI app's docs endpoint.
|
| 27 |
-
demo.app.add_route("/api/docs", fastapi_app.docs_ui_router)
|
| 28 |
-
|
| 29 |
if __name__ == "__main__":
|
| 30 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
| 19 |
)
|
| 20 |
|
| 21 |
# Mount FastAPI onto Gradio's app
|
| 22 |
+
# This exposes your API at /api/moderate
|
| 23 |
demo.app.mount("/api", fastapi_app)
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
if __name__ == "__main__":
|
| 26 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|