Update app.py
Browse files
app.py
CHANGED
|
@@ -208,11 +208,13 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
| 208 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 209 |
continue
|
| 210 |
try:
|
|
|
|
| 211 |
if files is None or files == '':
|
| 212 |
-
print(files)
|
| 213 |
submitted_answer = agent(question_text)
|
| 214 |
else:
|
| 215 |
-
|
|
|
|
| 216 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 217 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
| 218 |
except Exception as e:
|
|
@@ -348,4 +350,4 @@ if __name__ == "__main__":
|
|
| 348 |
|
| 349 |
print("-"*(60 + len(" App Starting ")) + "\n")
|
| 350 |
print("Launching Gradio Interface for Basic Agent Evaluation...")
|
| 351 |
-
demo.launch(debug=True, share=False)
|
|
|
|
| 208 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 209 |
continue
|
| 210 |
try:
|
| 211 |
+
# FIXED: Pass files (not task_id) to the agent
|
| 212 |
if files is None or files == '':
|
| 213 |
+
print(f"No files for task {task_id}")
|
| 214 |
submitted_answer = agent(question_text)
|
| 215 |
else:
|
| 216 |
+
print(f"Processing task {task_id} with file: {files}")
|
| 217 |
+
submitted_answer = agent(question_text, files)
|
| 218 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 219 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
| 220 |
except Exception as e:
|
|
|
|
| 350 |
|
| 351 |
print("-"*(60 + len(" App Starting ")) + "\n")
|
| 352 |
print("Launching Gradio Interface for Basic Agent Evaluation...")
|
| 353 |
+
demo.launch(debug=True, share=False)
|