Spaces:
Sleeping
Sleeping
subste first two questions for testing
Browse files
app.py
CHANGED
|
@@ -75,7 +75,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 75 |
results_log = []
|
| 76 |
answers_payload = []
|
| 77 |
print(f"Running agent on {len(questions_data)} questions...")
|
| 78 |
-
for item in questions_data:
|
| 79 |
task_id = item.get("task_id")
|
| 80 |
question_text = item.get("question")
|
| 81 |
if not task_id or question_text is None:
|
|
@@ -86,10 +86,9 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 86 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 87 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
| 88 |
except Exception as e:
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
sleep(30)
|
| 92 |
-
|
| 93 |
if not answers_payload:
|
| 94 |
print("Agent did not produce any answers to submit.")
|
| 95 |
return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
|
|
|
|
| 75 |
results_log = []
|
| 76 |
answers_payload = []
|
| 77 |
print(f"Running agent on {len(questions_data)} questions...")
|
| 78 |
+
for item in questions_data[:2]: # First two questions for testing
|
| 79 |
task_id = item.get("task_id")
|
| 80 |
question_text = item.get("question")
|
| 81 |
if not task_id or question_text is None:
|
|
|
|
| 86 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 87 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
| 88 |
except Exception as e:
|
| 89 |
+
print(f"Error running agent on task {task_id}: {e}")
|
| 90 |
+
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
|
| 91 |
+
sleep(30) # 30 seconds delay between questions for Gemini
|
|
|
|
| 92 |
if not answers_payload:
|
| 93 |
print("Agent did not produce any answers to submit.")
|
| 94 |
return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
|