Skip to content

Commit

Permalink
FIX: Import location of HF hub errors (#2178)
Browse files Browse the repository at this point in the history
Resolves #2097

Import errors from huggingface_hub.errors

Also set min version to 0.25.0
  • Loading branch information
BenjaminBossan authored Oct 28, 2024
1 parent 28a5ba1 commit b3176ef
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"tqdm",
"accelerate>=0.21.0",
"safetensors",
"huggingface_hub>=0.17.0",
"huggingface_hub>=0.25.0",
],
extras_require=extras,
classifiers=[
Expand Down
3 changes: 1 addition & 2 deletions src/peft/utils/loftq_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@

import torch
from huggingface_hub import snapshot_download
from huggingface_hub.errors import HFValidationError
from huggingface_hub.utils import LocalEntryNotFoundError
from huggingface_hub.errors import HFValidationError, LocalEntryNotFoundError
from safetensors import SafetensorError, safe_open
from transformers.utils import cached_file
from transformers.utils.hub import get_checkpoint_shard_files
Expand Down
2 changes: 1 addition & 1 deletion src/peft/utils/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from accelerate.hooks import add_hook_to_module, remove_hook_from_module
from accelerate.utils import is_npu_available, is_xpu_available
from huggingface_hub import file_exists
from huggingface_hub.utils import EntryNotFoundError, HFValidationError
from huggingface_hub.errors import EntryNotFoundError, HFValidationError
from packaging import version
from safetensors.torch import storage_ptr, storage_size

Expand Down
2 changes: 1 addition & 1 deletion src/peft/utils/save_and_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import huggingface_hub
import torch
from huggingface_hub import file_exists, hf_hub_download
from huggingface_hub.utils import EntryNotFoundError, LocalEntryNotFoundError
from huggingface_hub.errors import EntryNotFoundError, LocalEntryNotFoundError
from packaging import version
from safetensors.torch import load_file as safe_load_file

Expand Down

0 comments on commit b3176ef

Please sign in to comment.