Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,23 +4,23 @@ from agent import run
|
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
def predict(task_id, question, submitted_answer):
|
| 7 |
-
"""
|
| 8 |
-
HF evaluator calls this automatically.
|
| 9 |
-
We ignore submitted_answer and compute using run().
|
| 10 |
-
"""
|
| 11 |
return run(question)
|
| 12 |
|
| 13 |
with gr.Blocks() as demo:
|
| 14 |
gr.Markdown("# 🧠 HF Agent Evaluation Runner")
|
| 15 |
|
| 16 |
-
gr.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
fn=predict,
|
| 18 |
-
inputs=[
|
| 19 |
-
|
| 20 |
-
gr.Textbox(label="Question"),
|
| 21 |
-
gr.Textbox(label="Submitted Answer")
|
| 22 |
-
],
|
| 23 |
-
outputs=gr.Textbox(label="Final Answer")
|
| 24 |
)
|
| 25 |
|
| 26 |
demo.launch()
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
def predict(task_id, question, submitted_answer):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
return run(question)
|
| 8 |
|
| 9 |
with gr.Blocks() as demo:
|
| 10 |
gr.Markdown("# 🧠 HF Agent Evaluation Runner")
|
| 11 |
|
| 12 |
+
task_id = gr.Textbox(label="Task ID")
|
| 13 |
+
question = gr.Textbox(label="Question")
|
| 14 |
+
submitted = gr.Textbox(label="Submitted Answer")
|
| 15 |
+
|
| 16 |
+
output = gr.Textbox(label="Final Answer")
|
| 17 |
+
|
| 18 |
+
btn = gr.Button("Run")
|
| 19 |
+
|
| 20 |
+
btn.click(
|
| 21 |
fn=predict,
|
| 22 |
+
inputs=[task_id, question, submitted],
|
| 23 |
+
outputs=output
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
)
|
| 25 |
|
| 26 |
demo.launch()
|