Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -133,17 +133,17 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 133 |
continue
|
| 134 |
try:
|
| 135 |
if file_content:
|
| 136 |
-
|
| 137 |
else:
|
| 138 |
-
|
| 139 |
|
| 140 |
-
if not
|
| 141 |
-
|
| 142 |
-
answers_payload.append({"task_id": task_id, "
|
| 143 |
-
results_log.append({"Task ID": task_id, "Question": question_text, "
|
| 144 |
except Exception as e:
|
| 145 |
print(f"Error running agent on task {task_id}: {e}")
|
| 146 |
-
results_log.append({"Task ID": task_id, "Question": question_text, "
|
| 147 |
|
| 148 |
if not answers_payload:
|
| 149 |
print("Agent did not produce any answers to submit.")
|
|
|
|
| 133 |
continue
|
| 134 |
try:
|
| 135 |
if file_content:
|
| 136 |
+
answer = agent(question_text, file_content=file_content, file_path=file_path)
|
| 137 |
else:
|
| 138 |
+
answer = agent(question_text)
|
| 139 |
|
| 140 |
+
if not answer:
|
| 141 |
+
answer = "I am unable to answer"
|
| 142 |
+
answers_payload.append({"task_id": task_id, "answer": answer})
|
| 143 |
+
results_log.append({"Task ID": task_id, "Question": question_text, "Answer": answer})
|
| 144 |
except Exception as e:
|
| 145 |
print(f"Error running agent on task {task_id}: {e}")
|
| 146 |
+
results_log.append({"Task ID": task_id, "Question": question_text, "Answer": f"AGENT ERROR: {e}"})
|
| 147 |
|
| 148 |
if not answers_payload:
|
| 149 |
print("Agent did not produce any answers to submit.")
|