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