Spaces:
Sleeping
Sleeping
Fix ImportError for RemoteEntryNotFoundError
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|