Nancy1906 commited on
Commit
41efa04
·
verified ·
1 Parent(s): 688604c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -41,6 +41,8 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
41
  # --- Run Agent ---
42
  results_log = []
43
  answers_payload = []
 
 
44
  for item in questions_data:
45
  task_id = item.get("task_id")
46
  question_text = item.get("question")
@@ -55,6 +57,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
55
 
56
  # ----- LÍNEA DE TIME.SLEEP VA AQUÍ -----
57
  # Esperar después de procesar cada pregunta, excepto la última
 
58
  if item_index < total_questions - 1:
59
  wait_duration = 20 # Segundos de espera
60
  print(f"--- Question {item_index + 1} processed. Waiting {wait_duration} seconds before next question to manage API rate limits... ---")
 
41
  # --- Run Agent ---
42
  results_log = []
43
  answers_payload = []
44
+
45
+ total_questions = len(questions_data)
46
  for item in questions_data:
47
  task_id = item.get("task_id")
48
  question_text = item.get("question")
 
57
 
58
  # ----- LÍNEA DE TIME.SLEEP VA AQUÍ -----
59
  # Esperar después de procesar cada pregunta, excepto la última
60
+ # item_index y total_questions AHORA ESTÁN DEFINIDOS CORRECTAMENTE en este alcance
61
  if item_index < total_questions - 1:
62
  wait_duration = 20 # Segundos de espera
63
  print(f"--- Question {item_index + 1} processed. Waiting {wait_duration} seconds before next question to manage API rate limits... ---")