Spaces:
Sleeping
Sleeping
update
Browse files
app.py
CHANGED
|
@@ -59,12 +59,12 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 59 |
# 2. Fetch Questions
|
| 60 |
print(f"Fetching questions from: {questions_url}")
|
| 61 |
try:
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
with open('data.json', 'r') as json_file:
|
| 66 |
-
data = json.load(json_file)
|
| 67 |
-
questions_data = data
|
| 68 |
|
| 69 |
if not questions_data:
|
| 70 |
print("Fetched questions list is empty.")
|
|
@@ -86,6 +86,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 86 |
answers_payload = []
|
| 87 |
print(f"Running agent on {len(questions_data)} questions...")
|
| 88 |
for item in questions_data:
|
|
|
|
|
|
|
| 89 |
task_id = item.get("task_id")
|
| 90 |
question_text = item.get("question")
|
| 91 |
if not task_id or question_text is None:
|
|
|
|
| 59 |
# 2. Fetch Questions
|
| 60 |
print(f"Fetching questions from: {questions_url}")
|
| 61 |
try:
|
| 62 |
+
response = requests.get(questions_url, timeout=15)
|
| 63 |
+
response.raise_for_status()
|
| 64 |
+
questions_data = response.json()
|
| 65 |
+
#with open('data.json', 'r') as json_file:
|
| 66 |
+
#data = json.load(json_file)
|
| 67 |
+
#questions_data = data
|
| 68 |
|
| 69 |
if not questions_data:
|
| 70 |
print("Fetched questions list is empty.")
|
|
|
|
| 86 |
answers_payload = []
|
| 87 |
print(f"Running agent on {len(questions_data)} questions...")
|
| 88 |
for item in questions_data:
|
| 89 |
+
print("Waiting for 10 seconds...")
|
| 90 |
+
time.sleep(10)
|
| 91 |
task_id = item.get("task_id")
|
| 92 |
question_text = item.get("question")
|
| 93 |
if not task_id or question_text is None:
|