From 0a21a48564b1996832f8f3ed09c9b9d7bd71325b Mon Sep 17 00:00:00 2001 From: Sylvain Gugger Date: Wed, 13 Jul 2022 10:53:25 -0400 Subject: [PATCH] Revert "Make sharded checkpoints work in offline mode" This reverts commit 3564c6578630a3bef29d2c7c36c7d29b68acd874. --- src/transformers/utils/hub.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/transformers/utils/hub.py b/src/transformers/utils/hub.py index cb400329d3..6de0b3a246 100644 --- a/src/transformers/utils/hub.py +++ b/src/transformers/utils/hub.py @@ -552,9 +552,8 @@ def get_from_cache( # the models might've been found if local_files_only=False # Notify the user about that if local_files_only: - fname = url.split("/")[-1] - raise EntryNotFoundError( - f"Cannot find the requested file ({fname}) in the cached path and outgoing traffic has been" + raise FileNotFoundError( + "Cannot find the requested files in the cached path and outgoing traffic has been" " disabled. To enable model look-ups and downloads online, set 'local_files_only'" " to False." )