Spaces:
Running
Running
Commit
·
3d29ae0
1
Parent(s):
e68c056
debug for backend.py
Browse files- src/backend.py +22 -13
src/backend.py
CHANGED
@@ -183,19 +183,28 @@ def pull_search_results(
|
|
183 |
file_name = os.path.basename(metadata_file_path).split('.')[0]
|
184 |
zip_file_name = f"{file_name}.zip"
|
185 |
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
|
200 |
unzip_target_path = os.path.join(unzip_target_dir, benchmark_version, file_name)
|
201 |
os.makedirs(unzip_target_path, exist_ok=True)
|
|
|
183 |
file_name = os.path.basename(metadata_file_path).split('.')[0]
|
184 |
zip_file_name = f"{file_name}.zip"
|
185 |
|
186 |
+
API.snapshot_download(
|
187 |
+
repo_id=SEARCH_RESULTS_REPO,
|
188 |
+
repo_type="dataset",
|
189 |
+
local_dir=ZIP_CACHE_DIR,
|
190 |
+
etag_timeout=30,
|
191 |
+
allow_patterns=[zip_file_name]
|
192 |
+
)
|
193 |
+
zip_file_path = get_zip_file_path(zip_file_name)
|
194 |
+
|
195 |
+
# try:
|
196 |
+
# API.snapshot_download(
|
197 |
+
# repo_id=SEARCH_RESULTS_REPO,
|
198 |
+
# repo_type="dataset",
|
199 |
+
# local_dir=ZIP_CACHE_DIR,
|
200 |
+
# etag_timeout=30,
|
201 |
+
# allow_patterns=[zip_file_name]
|
202 |
+
# )
|
203 |
+
# zip_file_path = get_zip_file_path(zip_file_name)
|
204 |
+
# assert zip_file_path is not None
|
205 |
+
# except Exception as e:
|
206 |
+
# logger.error(f"Failed to download the zip file `{zip_file_name}`: {e}")
|
207 |
+
# continue
|
208 |
|
209 |
unzip_target_path = os.path.join(unzip_target_dir, benchmark_version, file_name)
|
210 |
os.makedirs(unzip_target_path, exist_ok=True)
|