akrstova commited on
Commit
a411529
·
1 Parent(s): 1e7fa10

Correct place of time.sleep

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -103,7 +103,6 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
103
  print("Fetched questions list is empty.")
104
  return "Fetched questions list is empty or invalid format.", None
105
  print(f"Fetched {len(questions_data)} questions.")
106
- time.sleep(20) # To avoid running into rate limits
107
  except requests.exceptions.RequestException as e:
108
  print(f"Error fetching questions: {e}")
109
  return f"Error fetching questions: {e}", None
@@ -125,6 +124,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
125
  if not task_id or question_text is None:
126
  print(f"Skipping item with missing task_id or question: {item}")
127
  continue
 
 
128
  try:
129
  submitted_answer = agent(question_text)
130
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
 
103
  print("Fetched questions list is empty.")
104
  return "Fetched questions list is empty or invalid format.", None
105
  print(f"Fetched {len(questions_data)} questions.")
 
106
  except requests.exceptions.RequestException as e:
107
  print(f"Error fetching questions: {e}")
108
  return f"Error fetching questions: {e}", None
 
124
  if not task_id or question_text is None:
125
  print(f"Skipping item with missing task_id or question: {item}")
126
  continue
127
+ time.sleep(20) # To avoid running into rate limits
128
+
129
  try:
130
  submitted_answer = agent(question_text)
131
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})