Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import os
|
|
2 |
import gradio as gr
|
3 |
import requests
|
4 |
import inspect
|
|
|
5 |
import json
|
6 |
import pandas as pd
|
7 |
from langgraph.prebuilt import ToolNode, tools_condition
|
@@ -138,13 +139,16 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
138 |
submitted_answer = agent(question_text)
|
139 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
140 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
|
|
141 |
except Exception as e:
|
142 |
print(f"Error running agent on task {task_id}: {e}")
|
143 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
|
|
|
144 |
|
145 |
if not answers_payload:
|
146 |
print("Agent did not produce any answers to submit.")
|
147 |
return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
|
|
|
148 |
|
149 |
# 4. Prepare Submission
|
150 |
submission_data = {"username": username.strip(), "agent_code": agent_code, "answers": answers_payload}
|
|
|
2 |
import gradio as gr
|
3 |
import requests
|
4 |
import inspect
|
5 |
+
import time
|
6 |
import json
|
7 |
import pandas as pd
|
8 |
from langgraph.prebuilt import ToolNode, tools_condition
|
|
|
139 |
submitted_answer = agent(question_text)
|
140 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
141 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
142 |
+
time.sleep(10)
|
143 |
except Exception as e:
|
144 |
print(f"Error running agent on task {task_id}: {e}")
|
145 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
|
146 |
+
time.sleep(10)
|
147 |
|
148 |
if not answers_payload:
|
149 |
print("Agent did not produce any answers to submit.")
|
150 |
return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
|
151 |
+
time.sleep(10)
|
152 |
|
153 |
# 4. Prepare Submission
|
154 |
submission_data = {"username": username.strip(), "agent_code": agent_code, "answers": answers_payload}
|