romain-fayoux commited on
Commit
4f492fe
·
verified ·
1 Parent(s): e876b69

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -20,7 +20,7 @@ class BasicAgent:
20
  print(f"Agent returning fixed answer: {fixed_answer}")
21
  return fixed_answer
22
 
23
- def run_and_submit_all( profile: gr.OAuthProfile | None):
24
  """
25
  Fetches all questions, runs the BasicAgent on them, submits all answers,
26
  and displays the results.
@@ -73,6 +73,9 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
73
  # 3. Run your Agent
74
  results_log = []
75
  answers_payload = []
 
 
 
76
  print(f"Running agent on {len(questions_data)} questions...")
77
  for item in questions_data:
78
  task_id = item.get("task_id")
@@ -168,7 +171,7 @@ with gr.Blocks() as demo:
168
  results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
169
 
170
  run_button.click(
171
- fn=run_and_submit_all,
172
  outputs=[status_output, results_table]
173
  )
174
 
 
20
  print(f"Agent returning fixed answer: {fixed_answer}")
21
  return fixed_answer
22
 
23
+ def run_and_submit_all( profile: gr.OAuthProfile | None, limit: int | None):
24
  """
25
  Fetches all questions, runs the BasicAgent on them, submits all answers,
26
  and displays the results.
 
73
  # 3. Run your Agent
74
  results_log = []
75
  answers_payload = []
76
+ # Limit for test purposes
77
+ if limit is not None:
78
+ question_data = question_data[:limit]
79
  print(f"Running agent on {len(questions_data)} questions...")
80
  for item in questions_data:
81
  task_id = item.get("task_id")
 
171
  results_table = gr.DataFrame(label="Questions and Agent Answers", wrap=True)
172
 
173
  run_button.click(
174
+ fn=run_and_submit_all(limit=3),
175
  outputs=[status_output, results_table]
176
  )
177