Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,14 +44,14 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 44 |
print(f"Fetching questions from: {questions_url}")
|
| 45 |
try:
|
| 46 |
# Temporarily using questions.json to get around HTTP GET issue on questions endpoint
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
# BEGIN WORKAROUND
|
| 51 |
-
import json
|
| 52 |
-
questions_file_path = os.path.join(os.path.dirname(__file__), "questions.json")
|
| 53 |
-
with open(questions_file_path, 'r') as f:
|
| 54 |
-
|
| 55 |
# END WORKAROUND
|
| 56 |
if not questions_data:
|
| 57 |
print("Fetched questions list is empty.")
|
|
|
|
| 44 |
print(f"Fetching questions from: {questions_url}")
|
| 45 |
try:
|
| 46 |
# Temporarily using questions.json to get around HTTP GET issue on questions endpoint
|
| 47 |
+
response = requests.get(questions_url, timeout=15)
|
| 48 |
+
response.raise_for_status()
|
| 49 |
+
questions_data = response.json()
|
| 50 |
# BEGIN WORKAROUND
|
| 51 |
+
# import json
|
| 52 |
+
# questions_file_path = os.path.join(os.path.dirname(__file__), "questions.json")
|
| 53 |
+
# with open(questions_file_path, 'r') as f:
|
| 54 |
+
# questions_data = json.load(f)
|
| 55 |
# END WORKAROUND
|
| 56 |
if not questions_data:
|
| 57 |
print("Fetched questions list is empty.")
|