Skip to content

Commit

Permalink
FIX: Add accelerate as a hard requirement (huggingface#31090)
Browse files Browse the repository at this point in the history
add accelerate
  • Loading branch information
younesbelkada committed May 28, 2024
1 parent 22dab24 commit 94d416f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3048,6 +3048,9 @@ def from_pretrained(
" ignored."
)

if gguf_file is not None and not is_accelerate_available():
raise ValueError("accelerate is required when loading a GGUF file `pip install accelerate`.")

if commit_hash is None:
if not isinstance(config, PretrainedConfig):
# We make a call to the config file first (which may be absent) to get the commit hash as soon as possible
Expand Down

0 comments on commit 94d416f

Please sign in to comment.