Spaces:
Runtime error
Runtime error
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -360,10 +360,13 @@ def create_ui():
|
|
| 360 |
|
| 361 |
|
| 362 |
if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
| 363 |
demo = create_ui()
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
)
|
|
|
|
| 360 |
|
| 361 |
|
| 362 |
if __name__ == "__main__":
|
| 363 |
+
from api import app as fastapi_app
|
| 364 |
+
import gradio as gr
|
| 365 |
+
|
| 366 |
demo = create_ui()
|
| 367 |
+
|
| 368 |
+
# 将 FastAPI 挂载到 Gradio
|
| 369 |
+
app = gr.mount_gradio_app(fastapi_app, demo, path="/")
|
| 370 |
+
|
| 371 |
+
import uvicorn
|
| 372 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|