hanhainebula commited on
Commit
46a36a9
·
1 Parent(s): 3d29ae0

debug for backend.py

Browse files
Files changed (1) hide show
  1. src/backend.py +14 -7
src/backend.py CHANGED
@@ -183,13 +183,20 @@ 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
- 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:
 
183
  file_name = os.path.basename(metadata_file_path).split('.')[0]
184
  zip_file_name = f"{file_name}.zip"
185
 
186
+ try:
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
+ except Exception as e:
195
+ print("----")
196
+ print(e)
197
+ print("----")
198
+ logger.error(f"Failed to download the zip file `{zip_file_name}`: {e}")
199
+ continue
200
  zip_file_path = get_zip_file_path(zip_file_name)
201
 
202
  # try: