Yago Bolivar
commited on
Commit
·
b9cda5d
1
Parent(s):
073b7fb
fix: update file paths for downloaded files and saved questions to ensure proper directory structure
Browse files
utilities/fetch_all_questions.py
CHANGED
@@ -17,7 +17,7 @@ def download_file(task_id, file_name):
|
|
17 |
file_endpoint = f"{BASE_URL}/files/{task_id}"
|
18 |
file_response = requests.get(file_endpoint)
|
19 |
if file_response.status_code == 200:
|
20 |
-
os.makedirs("downloaded_files", exist_ok=True)
|
21 |
file_path = os.path.join("downloaded_files", file_name)
|
22 |
with open(file_path, "wb") as f:
|
23 |
f.write(file_response.content)
|
@@ -45,7 +45,7 @@ questions = get_all_questions()
|
|
45 |
|
46 |
print(f"Total questions retrieved: {len(questions)}")
|
47 |
|
48 |
-
with open("new_gaia_questions.json", "w") as file:
|
49 |
json.dump(questions, file, indent=4)
|
50 |
|
51 |
print("Questions successfully saved to new_gaia_questions.json")
|
|
|
17 |
file_endpoint = f"{BASE_URL}/files/{task_id}"
|
18 |
file_response = requests.get(file_endpoint)
|
19 |
if file_response.status_code == 200:
|
20 |
+
os.makedirs("data/downloaded_files", exist_ok=True)
|
21 |
file_path = os.path.join("downloaded_files", file_name)
|
22 |
with open(file_path, "wb") as f:
|
23 |
f.write(file_response.content)
|
|
|
45 |
|
46 |
print(f"Total questions retrieved: {len(questions)}")
|
47 |
|
48 |
+
with open("data/question_set/new_gaia_questions.json", "w") as file:
|
49 |
json.dump(questions, file, indent=4)
|
50 |
|
51 |
print("Questions successfully saved to new_gaia_questions.json")
|