adollahamini1998 commited on
Commit
fed0f1e
·
verified ·
1 Parent(s): ecf0942

Update downloader_voxblink.py

Browse files
Files changed (1) hide show
  1. downloader_voxblink.py +10 -0
downloader_voxblink.py CHANGED
@@ -18,6 +18,7 @@ logging.basicConfig(level=logging.INFO)
18
 
19
  try:
20
  from huggingface_hub import HfApi, create_repo, hf_hub_download
 
21
  HF_AVAILABLE = True
22
  except ImportError:
23
  HF_AVAILABLE = False
@@ -526,6 +527,15 @@ def remote_progress_exists(api, repo_id, path_in_repo):
526
  """
527
  try:
528
  files = api.list_repo_files(repo_id=repo_id, repo_type='dataset')
 
 
 
 
 
 
 
 
 
529
  except Exception as exc:
530
  logging.error(
531
  f'Could not list files in {repo_id} to check for an existing '
 
18
 
19
  try:
20
  from huggingface_hub import HfApi, create_repo, hf_hub_download
21
+ from huggingface_hub.utils import RepositoryNotFoundError
22
  HF_AVAILABLE = True
23
  except ImportError:
24
  HF_AVAILABLE = False
 
527
  """
528
  try:
529
  files = api.list_repo_files(repo_id=repo_id, repo_type='dataset')
530
+ except RepositoryNotFoundError:
531
+ # The dataset repo itself hasn't been created yet. That's expected
532
+ # on the very first push for this repo_id -- create_repo(exist_ok=True)
533
+ # in push_progress_file()/push_audio_dataset() creates it lazily on
534
+ # the first checkpoint. This is "no progress file yet" (False), not
535
+ # an unknown/transient failure (None), so it should go through the
536
+ # existing --allow_fresh_start gate instead of hard-aborting.
537
+ logging.info(f'{repo_id} does not exist yet on the Hub -- treating as no progress file.')
538
+ return False
539
  except Exception as exc:
540
  logging.error(
541
  f'Could not list files in {repo_id} to check for an existing '