Update app.py
Browse files
app.py
CHANGED
|
@@ -81,7 +81,13 @@ 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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:
|
|
|
|
| 81 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 82 |
continue
|
| 83 |
try:
|
| 84 |
+
agent_response = agent(question_text)
|
| 85 |
+
# Extract everything after "FINAL ANSWER:" as the submitted answer
|
| 86 |
+
if "FINAL ANSWER:" in agent_response:
|
| 87 |
+
submitted_answer = agent_response.split("FINAL ANSWER:", 1)[1].strip()
|
| 88 |
+
else:
|
| 89 |
+
submitted_answer = agent_response # Fallback if no "FINAL ANSWER:" found
|
| 90 |
+
|
| 91 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 92 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
| 93 |
except Exception as e:
|