Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -110,12 +110,21 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 110 |
print(f"Running agent on {len(questions_data)} questions...")
|
| 111 |
for item in questions_data:
|
| 112 |
task_id = item.get("task_id")
|
|
|
|
| 113 |
question_text = item.get("question")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
if not task_id or question_text is None:
|
| 115 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 116 |
continue
|
| 117 |
try:
|
| 118 |
-
submitted_answer = agent(question_text)
|
| 119 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 120 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
| 121 |
except Exception as e:
|
|
|
|
| 110 |
print(f"Running agent on {len(questions_data)} questions...")
|
| 111 |
for item in questions_data:
|
| 112 |
task_id = item.get("task_id")
|
| 113 |
+
file_name=item.get("file_name")
|
| 114 |
question_text = item.get("question")
|
| 115 |
+
# question_text += "\n"
|
| 116 |
+
# question_text += """
|
| 117 |
+
# YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated
|
| 118 |
+
# list of numbers and/or strings. If you are asked for a number, DO NOT use comma to write your number neither use units such as $ or
|
| 119 |
+
# percent sign unless specified otherwise.
|
| 120 |
+
# If you are asked for a string, DO NOT use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise.
|
| 121 |
+
# If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string.
|
| 122 |
+
# """
|
| 123 |
if not task_id or question_text is None:
|
| 124 |
print(f"Skipping item with missing task_id or question: {item}")
|
| 125 |
continue
|
| 126 |
try:
|
| 127 |
+
submitted_answer = agent(question_text, file_name)
|
| 128 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 129 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
| 130 |
except Exception as e:
|