Spaces:
Sleeping
Sleeping
Daniel Amendoeira
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -74,9 +74,9 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
74 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
75 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
76 |
|
77 |
-
# wait
|
78 |
-
print('\n\n-> Sleeping for
|
79 |
-
sleep(
|
80 |
|
81 |
except Exception as e:
|
82 |
print(f"Error running agent on task {task_id}: {e}")
|
|
|
74 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
75 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
76 |
|
77 |
+
# wait 10 seconds between calls to avoid reaching limit of token per minute (TPM) and request per minute (RPM)
|
78 |
+
print('\n\n-> Sleeping for 10 seconds to avoid reaching limit of requests')
|
79 |
+
sleep(10)
|
80 |
|
81 |
except Exception as e:
|
82 |
print(f"Error running agent on task {task_id}: {e}")
|