aria2 hook now also catches EntryNotFoundError

This commit is contained in:
vfbd 2022-07-27 11:45:07 -04:00
parent 2cf6b60c6f
commit 9c8b825b4a
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ def aria2_hook(pretrained_model_name_or_path: str, force_download=False, cache_d
def is_cached(url):
try:
transformers.file_utils.get_from_cache(url, cache_dir=cache_dir, local_files_only=True)
except FileNotFoundError:
except (FileNotFoundError, transformers.file_utils.EntryNotFoundError):
return False
return True
while True: # Try to get the huggingface.co URL of the model's pytorch_model.bin or pytorch_model.bin.index.json file