dawid-lorek commited on
Commit
608b200
·
verified ·
1 Parent(s): 233f7aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -3,15 +3,14 @@ import requests
3
  import pandas as pd
4
  import gradio as gr
5
 
6
- from agent import GaiaAgent
7
 
8
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
9
 
10
- class GAIALlamaAgent:
11
  def __init__(self):
12
- self.agent = GaiaAgent()
13
  def __call__(self, question: str, task_id: str) -> str:
14
- # Pass both question and task_id to the agent
15
  return self.agent(question, task_id)
16
 
17
  def run_and_submit_all(profile: gr.OAuthProfile | None):
@@ -31,7 +30,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
31
  except Exception as e:
32
  return f"Error fetching questions: {e}", None
33
 
34
- agent = GAIALlamaAgent()
35
  results_log = []
36
  answers_payload = []
37
 
@@ -64,7 +63,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
64
  except Exception as e:
65
  return f"Submission Failed: {e}", pd.DataFrame(results_log)
66
 
67
- # --- Gradio Interface matching original benchmark ---
68
  with gr.Blocks() as demo:
69
  gr.Markdown("# Basic Agent Evaluation Runner")
70
  gr.Markdown("""
 
3
  import pandas as pd
4
  import gradio as gr
5
 
6
+ from agent import BasicAgent # <-- Change to match your agent.py
7
 
8
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
9
 
10
+ class GAIAAgent:
11
  def __init__(self):
12
+ self.agent = BasicAgent()
13
  def __call__(self, question: str, task_id: str) -> str:
 
14
  return self.agent(question, task_id)
15
 
16
  def run_and_submit_all(profile: gr.OAuthProfile | None):
 
30
  except Exception as e:
31
  return f"Error fetching questions: {e}", None
32
 
33
+ agent = GAIAAgent()
34
  results_log = []
35
  answers_payload = []
36
 
 
63
  except Exception as e:
64
  return f"Submission Failed: {e}", pd.DataFrame(results_log)
65
 
66
+ # --- Gradio Interface ---
67
  with gr.Blocks() as demo:
68
  gr.Markdown("# Basic Agent Evaluation Runner")
69
  gr.Markdown("""