hanhainebula commited on
Commit
31daf22
·
1 Parent(s): 35f05ef

debug for backend.py

Browse files
Files changed (1) hide show
  1. 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
- API.snapshot_download(
188
- repo_id=SEARCH_RESULTS_REPO,
189
- repo_type="dataset",
190
- local_dir=ZIP_CACHE_DIR,
191
- etag_timeout=30,
192
- allow_patterns=[zip_file_name]
193
- )
194
- zip_file_path = get_zip_file_path(zip_file_name)
195
- assert zip_file_path is not None, f"Failed to find the zip file `{zip_file_name}`"
196
-
197
- # try:
198
- # API.snapshot_download(
199
- # repo_id=SEARCH_RESULTS_REPO,
200
- # repo_type="dataset",
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: