Passed Q1.
Browse files
app.py
CHANGED
@@ -124,7 +124,12 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
124 |
results_log = []
|
125 |
answers_payload = []
|
126 |
print(f"Running agent on {len(questions_data)} questions...")
|
|
|
|
|
127 |
for item in questions_data:
|
|
|
|
|
|
|
128 |
task_id = item.get("task_id")
|
129 |
question_text = item.get("question")
|
130 |
if not task_id or question_text is None:
|
@@ -138,8 +143,6 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
138 |
print(f"Error running agent on task {task_id}: {e}")
|
139 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
|
140 |
|
141 |
-
break # Test one question only first
|
142 |
-
|
143 |
if not answers_payload:
|
144 |
print("Agent did not produce any answers to submit.")
|
145 |
return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
|
@@ -195,7 +198,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
195 |
|
196 |
# --- Build Gradio Interface using Blocks ---
|
197 |
with gr.Blocks() as demo:
|
198 |
-
gr.Markdown("# Basic Agent Evaluation Runner #
|
199 |
gr.Markdown(
|
200 |
"""
|
201 |
**Instructions:**
|
|
|
124 |
results_log = []
|
125 |
answers_payload = []
|
126 |
print(f"Running agent on {len(questions_data)} questions...")
|
127 |
+
count = 0
|
128 |
+
question_array = [2, 3, 4] # Example question array for testing
|
129 |
for item in questions_data:
|
130 |
+
count += 1
|
131 |
+
if count not in question_array:
|
132 |
+
continue
|
133 |
task_id = item.get("task_id")
|
134 |
question_text = item.get("question")
|
135 |
if not task_id or question_text is None:
|
|
|
143 |
print(f"Error running agent on task {task_id}: {e}")
|
144 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
|
145 |
|
|
|
|
|
146 |
if not answers_payload:
|
147 |
print("Agent did not produce any answers to submit.")
|
148 |
return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
|
|
|
198 |
|
199 |
# --- Build Gradio Interface using Blocks ---
|
200 |
with gr.Blocks() as demo:
|
201 |
+
gr.Markdown("# Basic Agent Evaluation Runner #18")
|
202 |
gr.Markdown(
|
203 |
"""
|
204 |
**Instructions:**
|