Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 7 |
-
demo.launch()
|
|
|
|
| 1 |
+
# app.py
|
| 2 |
+
from api import api as fastapi_app, run_agent, run_all_agents
|
| 3 |
+
from main import build_ui
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
+
# Build Gradio UI and mount it onto the FastAPI app at "/"
|
| 7 |
+
blocks = build_ui(run_agent, run_all_agents)
|
| 8 |
+
app = gr.mount_gradio_app(fastapi_app, blocks, path="/")
|
| 9 |
+
|
| 10 |
+
# Hugging Face Spaces will look for a variable named `app`.
|
| 11 |
+
# No need to call .launch() or start Uvicorn manually.
|
| 12 |
|
|
|
|
|
|