Make sharded checkpoints work in offline mode

This commit is contained in:
Sylvain Gugger 2022-07-13 10:51:56 -04:00
parent 56e6487c40
commit 3564c65786
1 changed files with 3 additions and 2 deletions

View File

@ -552,8 +552,9 @@ def get_from_cache(
# the models might've been found if local_files_only=False
# Notify the user about that
if local_files_only:
raise FileNotFoundError(
"Cannot find the requested files in the cached path and outgoing traffic has been"
fname = url.split("/")[-1]
raise EntryNotFoundError(
f"Cannot find the requested file ({fname}) in the cached path and outgoing traffic has been"
" disabled. To enable model look-ups and downloads online, set 'local_files_only'"
" to False."
)