sqfoo commited on
Commit
d1fc653
·
verified ·
1 Parent(s): ff52e69

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -11
app.py CHANGED
@@ -8,16 +8,6 @@ import pandas as pd
8
  # --- Constants ---
9
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
10
 
11
- # --- Basic Agent Definition ---
12
- # ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
13
- # class BasicAgent:
14
- # def __init__(self):
15
- # print("BasicAgent initialized.")
16
- # def __call__(self, question: str) -> str:
17
- # print(f"Agent received question (first 50 chars): {question[:50]}...")
18
- # fixed_answer = "This is a default answer."
19
- # print(f"Agent returning fixed answer: {fixed_answer}")
20
- # return fixed_answer
21
  from agent import BasicAgent
22
 
23
  def run_and_submit_all( profile: gr.OAuthProfile | None):
@@ -81,7 +71,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
81
  print(f"Skipping item with missing task_id or question: {item}")
82
  continue
83
  try:
84
- submitted_answer = agent(question_text)
 
85
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
86
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
87
  except Exception as e:
 
8
  # --- Constants ---
9
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
10
 
 
 
 
 
 
 
 
 
 
 
11
  from agent import BasicAgent
12
 
13
  def run_and_submit_all( profile: gr.OAuthProfile | None):
 
71
  print(f"Skipping item with missing task_id or question: {item}")
72
  continue
73
  try:
74
+ # submitted_answer = agent(question_text)
75
+ submitted_answer = agent(item) # dictionary that consists: task_id, question, Level, file_name
76
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
77
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
78
  except Exception as e: