Benny-Tang commited on
Commit
93e31b9
·
verified ·
1 Parent(s): d6dcf1f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -1,7 +1,12 @@
 
 
 
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
 
 
 
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