Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
|
@@ -1,23 +1,26 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import
|
|
|
|
| 3 |
from smolagents import GradioUI
|
| 4 |
-
from gaia_agent import answer_questions # only this from GAIA logic
|
| 5 |
-
from agent_core import alfred # agent logic is imported from new shared file
|
| 6 |
|
| 7 |
def run_gaia_agent():
|
| 8 |
import json
|
| 9 |
answers = answer_questions()
|
| 10 |
return json.dumps({"answers": answers}, indent=2)
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
with gr.Blocks() as demo:
|
| 13 |
-
gr.Markdown("##
|
| 14 |
|
| 15 |
-
btn = gr.Button("Run GAIA Agent on All Questions")
|
| 16 |
output = gr.Textbox(label="Answers in Submission Format", lines=30)
|
| 17 |
|
| 18 |
btn.click(run_gaia_agent, outputs=output)
|
| 19 |
|
| 20 |
-
gr.Markdown("
|
| 21 |
-
|
| 22 |
|
| 23 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from agent_core import alfred # Your agent logic
|
| 3 |
+
from gaia_agent import answer_questions
|
| 4 |
from smolagents import GradioUI
|
|
|
|
|
|
|
| 5 |
|
| 6 |
def run_gaia_agent():
|
| 7 |
import json
|
| 8 |
answers = answer_questions()
|
| 9 |
return json.dumps({"answers": answers}, indent=2)
|
| 10 |
|
| 11 |
+
# Create your smolagent UI once here (DON'T launch it yet)
|
| 12 |
+
chat_ui = GradioUI(alfred)
|
| 13 |
+
|
| 14 |
+
# Now build a shared layout using Gradio Blocks
|
| 15 |
with gr.Blocks() as demo:
|
| 16 |
+
gr.Markdown("## GAIA Agent Evaluation Tool")
|
| 17 |
|
| 18 |
+
btn = gr.Button(" Run GAIA Agent on All Questions")
|
| 19 |
output = gr.Textbox(label="Answers in Submission Format", lines=30)
|
| 20 |
|
| 21 |
btn.click(run_gaia_agent, outputs=output)
|
| 22 |
|
| 23 |
+
gr.Markdown("## Original Agent Interface")
|
| 24 |
+
chat_ui.render() # Renders the smolagents UI inside the Blocks layout
|
| 25 |
|
| 26 |
demo.launch()
|