From 9c8b825b4a4fd15734de799da8d3b70408bde959 Mon Sep 17 00:00:00 2001 From: vfbd Date: Wed, 27 Jul 2022 11:45:07 -0400 Subject: [PATCH] aria2 hook now also catches EntryNotFoundError --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.py b/utils.py index e6d7d12b..710f61d2 100644 --- a/utils.py +++ b/utils.py @@ -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