Update app.py
Browse filesadd catch for "504 Server Error: Gateway Time-out"
app.py
CHANGED
|
@@ -173,9 +173,13 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 173 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 174 |
continue
|
| 175 |
try:
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
except Exception as e:
|
| 180 |
print(f"Error running agent on task {task_id}: {e}")
|
| 181 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
|
|
|
|
| 173 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 174 |
continue
|
| 175 |
try:
|
| 176 |
+
answer = agent(question_text, file_name)
|
| 177 |
+
if answer.startswith("Error in generating final LLM output: 504 Server Error: Gateway Time-out for"):
|
| 178 |
+
print(f"Error running agent on task {task_id}: {submitted_answer}")
|
| 179 |
+
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {answer}"})
|
| 180 |
+
else:
|
| 181 |
+
answers_payload.append({"task_id": task_id, "submitted_answer": answer})
|
| 182 |
+
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": answer})
|
| 183 |
except Exception as e:
|
| 184 |
print(f"Error running agent on task {task_id}: {e}")
|
| 185 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
|