Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -71,6 +71,12 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
71 |
if not task_id or question_text is None:
|
72 |
print(f"Skipping item with missing task_id or question: {item}")
|
73 |
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
try:
|
75 |
submitted_answer = agent(question_text)
|
76 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
|
|
71 |
if not task_id or question_text is None:
|
72 |
print(f"Skipping item with missing task_id or question: {item}")
|
73 |
continue
|
74 |
+
|
75 |
+
# Manage questions with files
|
76 |
+
if item.get("file_name"):
|
77 |
+
file = requests.get(files_url+task_id, timeout=15).text
|
78 |
+
question_text = f'{question_text}\nThis is the accompanying file:\n{file}'
|
79 |
+
|
80 |
try:
|
81 |
submitted_answer = agent(question_text)
|
82 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|