Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,20 +48,17 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
48 |
# 2. Fetch Questions
|
49 |
print(f"Fetching questions from: {questions_url}")
|
50 |
try:
|
51 |
-
response = requests.get(questions_url, timeout=
|
52 |
response.raise_for_status()
|
53 |
questions_data = response.json()
|
54 |
if not questions_data:
|
55 |
print("Fetched questions list is empty.")
|
56 |
return "Fetched questions list is empty or invalid format.", None
|
57 |
print(f"Fetched {len(questions_data)} questions.")
|
58 |
-
# Añadir un pequeño retraso para evitar el error 429
|
59 |
-
time.sleep(2) # Pausa de 2 segundos antes de la siguiente solicitud
|
60 |
except requests.exceptions.RequestException as e:
|
61 |
print(f"Error fetching questions: {e}")
|
62 |
return f"Error fetching questions: {e}", None
|
63 |
|
64 |
-
|
65 |
# 3. Run Agent
|
66 |
results_log = []
|
67 |
answers_payload = []
|
@@ -149,4 +146,4 @@ if __name__ == "__main__":
|
|
149 |
print("-"*(60 + len(" App Starting ")) + "\n")
|
150 |
|
151 |
print("Launching Gradio Interface for DuckDuckGo Agent Evaluation...")
|
152 |
-
demo.launch(debug=True, share=False)
|
|
|
48 |
# 2. Fetch Questions
|
49 |
print(f"Fetching questions from: {questions_url}")
|
50 |
try:
|
51 |
+
response = requests.get(questions_url, timeout=15)
|
52 |
response.raise_for_status()
|
53 |
questions_data = response.json()
|
54 |
if not questions_data:
|
55 |
print("Fetched questions list is empty.")
|
56 |
return "Fetched questions list is empty or invalid format.", None
|
57 |
print(f"Fetched {len(questions_data)} questions.")
|
|
|
|
|
58 |
except requests.exceptions.RequestException as e:
|
59 |
print(f"Error fetching questions: {e}")
|
60 |
return f"Error fetching questions: {e}", None
|
61 |
|
|
|
62 |
# 3. Run Agent
|
63 |
results_log = []
|
64 |
answers_payload = []
|
|
|
146 |
print("-"*(60 + len(" App Starting ")) + "\n")
|
147 |
|
148 |
print("Launching Gradio Interface for DuckDuckGo Agent Evaluation...")
|
149 |
+
demo.launch(debug=True, share=False)
|