Spaces:
Runtime error
Runtime error
Omachoko
commited on
Commit
·
ec318da
1
Parent(s):
670d3b3
Update app.py to match original template with enhanced GAIA agent integration
Browse files
app.py
CHANGED
@@ -29,6 +29,9 @@ import torch
|
|
29 |
from bs4 import BeautifulSoup
|
30 |
import openai
|
31 |
import magic # for robust file type detection
|
|
|
|
|
|
|
32 |
|
33 |
logging.basicConfig(filename='gaia_agent.log', level=logging.INFO, format='%(asctime)s %(levelname)s:%(message)s')
|
34 |
logger = logging.getLogger(__name__)
|
@@ -784,7 +787,7 @@ with gr.Blocks() as demo:
|
|
784 |
status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
|
785 |
results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
|
786 |
|
787 |
-
run_button.click(fn=
|
788 |
|
789 |
if __name__ == "__main__":
|
790 |
print("Launching Gradio Interface for Smart Agent Evaluation...")
|
@@ -829,7 +832,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
829 |
|
830 |
submitted_answer, trace = agent.answer_question(item)
|
831 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
832 |
-
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer
|
833 |
|
834 |
if not answers_payload:
|
835 |
return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
|
|
|
29 |
from bs4 import BeautifulSoup
|
30 |
import openai
|
31 |
import magic # for robust file type detection
|
32 |
+
from duckduckgo_search import DDGS
|
33 |
+
from datasets import load_dataset
|
34 |
+
import wikipediaapi
|
35 |
|
36 |
logging.basicConfig(filename='gaia_agent.log', level=logging.INFO, format='%(asctime)s %(levelname)s:%(message)s')
|
37 |
logger = logging.getLogger(__name__)
|
|
|
787 |
status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
|
788 |
results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
|
789 |
|
790 |
+
run_button.click(fn=run_and_submit_all, outputs=[status_output, results_table])
|
791 |
|
792 |
if __name__ == "__main__":
|
793 |
print("Launching Gradio Interface for Smart Agent Evaluation...")
|
|
|
832 |
|
833 |
submitted_answer, trace = agent.answer_question(item)
|
834 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
835 |
+
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
836 |
|
837 |
if not answers_payload:
|
838 |
return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
|