Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -152,12 +152,22 @@ async def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
152 |
print(f"Running agent on {len(questions_data)} questions...")
|
153 |
|
154 |
for item in questions_data:
|
|
|
155 |
if item.get("task_id") and item.get("question"):
|
156 |
-
|
|
|
157 |
result = await process_question(agent, item["question"], item["task_id"], results_log)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
if result:
|
159 |
answers_payload.append(result)
|
160 |
-
|
161 |
|
162 |
if not answers_payload:
|
163 |
print("Agent did not produce any answers to submit.")
|
|
|
152 |
print(f"Running agent on {len(questions_data)} questions...")
|
153 |
|
154 |
for item in questions_data:
|
155 |
+
result = None # Initialize result
|
156 |
if item.get("task_id") and item.get("question"):
|
157 |
+
# Only process chess-related questions
|
158 |
+
if "chess" in item["question"].lower():
|
159 |
result = await process_question(agent, item["question"], item["task_id"], results_log)
|
160 |
+
else:
|
161 |
+
print(f"Skipping non-chess question: {item['task_id']}")
|
162 |
+
results_log.append({
|
163 |
+
"Task ID": item["task_id"],
|
164 |
+
"Question": item["question"],
|
165 |
+
"Submitted Answer": "Question skipped - not chess-related"
|
166 |
+
})
|
167 |
+
# Only add if we got a result
|
168 |
if result:
|
169 |
answers_payload.append(result)
|
170 |
+
# await asyncio.sleep(30)
|
171 |
|
172 |
if not answers_payload:
|
173 |
print("Agent did not produce any answers to submit.")
|