Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -136,27 +136,24 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
136 |
for item in questions_data:
|
137 |
task_id = item.get("task_id")
|
138 |
question_text = item.get("question")
|
139 |
-
gold_answer = item.get("answer") or item.get("ground_truth")
|
140 |
|
141 |
if not task_id or question_text is None:
|
142 |
continue
|
143 |
try:
|
144 |
submitted_answer = agent(question_text)
|
145 |
print(f"Q: {question_text}")
|
146 |
-
print(f"Predicted: {submitted_answer}
|
147 |
|
148 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
149 |
results_log.append({
|
150 |
"Task ID": task_id,
|
151 |
"Question": question_text,
|
152 |
-
"Gold Answer": gold_answer,
|
153 |
"Submitted Answer": submitted_answer
|
154 |
})
|
155 |
except Exception as e:
|
156 |
results_log.append({
|
157 |
"Task ID": task_id,
|
158 |
"Question": question_text,
|
159 |
-
"Gold Answer": gold_answer,
|
160 |
"Submitted Answer": f"AGENT ERROR: {e}"
|
161 |
})
|
162 |
|
|
|
136 |
for item in questions_data:
|
137 |
task_id = item.get("task_id")
|
138 |
question_text = item.get("question")
|
|
|
139 |
|
140 |
if not task_id or question_text is None:
|
141 |
continue
|
142 |
try:
|
143 |
submitted_answer = agent(question_text)
|
144 |
print(f"Q: {question_text}")
|
145 |
+
print(f"Predicted: {submitted_answer}")
|
146 |
|
147 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
148 |
results_log.append({
|
149 |
"Task ID": task_id,
|
150 |
"Question": question_text,
|
|
|
151 |
"Submitted Answer": submitted_answer
|
152 |
})
|
153 |
except Exception as e:
|
154 |
results_log.append({
|
155 |
"Task ID": task_id,
|
156 |
"Question": question_text,
|
|
|
157 |
"Submitted Answer": f"AGENT ERROR: {e}"
|
158 |
})
|
159 |
|