smcs commited on
Commit
b2c0344
·
1 Parent(s): 63cd310

Fix ImportError for RemoteEntryNotFoundError

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -14,7 +14,11 @@ print("Patching transformers to avoid additional_chat_templates 404 error...")
14
 
15
  import transformers.tokenization_utils_base
16
  import transformers.utils.hub
17
- from huggingface_hub.errors import RemoteEntryNotFoundError
 
 
 
 
18
 
19
  # Capture the original function carefully to avoid recursion
20
  # We use a unique attribute to track if we've already patched it
 
14
 
15
  import transformers.tokenization_utils_base
16
  import transformers.utils.hub
17
+ try:
18
+ from huggingface_hub.errors import RemoteEntryNotFoundError
19
+ except ImportError:
20
+ # Fallback for older versions of huggingface_hub
21
+ from huggingface_hub.utils import EntryNotFoundError as RemoteEntryNotFoundError
22
 
23
  # Capture the original function carefully to avoid recursion
24
  # We use a unique attribute to track if we've already patched it