Spaces:
No application file
No application file
Update app.py
Browse files
app.py
CHANGED
|
@@ -498,10 +498,10 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
| 498 |
print(f"\nProcessing question: {question_text}")
|
| 499 |
answer = asyncio.run(agent.process_question(question_text))
|
| 500 |
|
| 501 |
-
# Format answer in required
|
| 502 |
answer_entry = {
|
| 503 |
"task_id": task_id,
|
| 504 |
-
"
|
| 505 |
}
|
| 506 |
answers_payload.append(answer_entry)
|
| 507 |
print(f"Formatted answer: {json.dumps(answer_entry, indent=2)}")
|
|
@@ -520,6 +520,11 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
| 520 |
|
| 521 |
except Exception as e:
|
| 522 |
print(f"Error processing question: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 523 |
continue
|
| 524 |
|
| 525 |
if not answers_payload:
|
|
|
|
| 498 |
print(f"\nProcessing question: {question_text}")
|
| 499 |
answer = asyncio.run(agent.process_question(question_text))
|
| 500 |
|
| 501 |
+
# Format answer in required format - using submitted_answer instead of model_answer
|
| 502 |
answer_entry = {
|
| 503 |
"task_id": task_id,
|
| 504 |
+
"submitted_answer": answer.text # Changed from model_answer to submitted_answer
|
| 505 |
}
|
| 506 |
answers_payload.append(answer_entry)
|
| 507 |
print(f"Formatted answer: {json.dumps(answer_entry, indent=2)}")
|
|
|
|
| 520 |
|
| 521 |
except Exception as e:
|
| 522 |
print(f"Error processing question: {e}")
|
| 523 |
+
# Add error answer in correct format
|
| 524 |
+
answers_payload.append({
|
| 525 |
+
"task_id": task_id,
|
| 526 |
+
"submitted_answer": f"Error processing question: {str(e)}"
|
| 527 |
+
})
|
| 528 |
continue
|
| 529 |
|
| 530 |
if not answers_payload:
|