Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -85,7 +85,7 @@ def run_and_submit_all(profile):
|
|
| 85 |
agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
|
| 86 |
print(agent_code)
|
| 87 |
|
| 88 |
-
|
| 89 |
print(f"Fetching questions from: {questions_url}")
|
| 90 |
try:
|
| 91 |
import time
|
|
@@ -106,6 +106,18 @@ def run_and_submit_all(profile):
|
|
| 106 |
|
| 107 |
print(f"Fetched {len(questions_data)} questions.")
|
| 108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
# 3. Run your Agent
|
| 110 |
results_log = []
|
| 111 |
answers_payload = []
|
|
|
|
| 85 |
agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
|
| 86 |
print(agent_code)
|
| 87 |
|
| 88 |
+
# 2. Fetch Questions
|
| 89 |
print(f"Fetching questions from: {questions_url}")
|
| 90 |
try:
|
| 91 |
import time
|
|
|
|
| 106 |
|
| 107 |
print(f"Fetched {len(questions_data)} questions.")
|
| 108 |
|
| 109 |
+
except requests.exceptions.RequestException as e:
|
| 110 |
+
print(f"Error fetching questions: {e}")
|
| 111 |
+
return f"Error fetching questions: {e}", None
|
| 112 |
+
|
| 113 |
+
except requests.exceptions.JSONDecodeError as e:
|
| 114 |
+
print(f"Error decoding JSON response: {e}")
|
| 115 |
+
return f"Error decoding server response: {e}", None
|
| 116 |
+
|
| 117 |
+
except Exception as e:
|
| 118 |
+
print(f"Unexpected error: {e}")
|
| 119 |
+
return f"Unexpected error: {e}", None
|
| 120 |
+
|
| 121 |
# 3. Run your Agent
|
| 122 |
results_log = []
|
| 123 |
answers_payload = []
|