Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
94d416f0
Unverified
Commit
94d416f0
authored
May 28, 2024
by
Younes Belkada
Committed by
GitHub
May 28, 2024
Browse files
FIX: Add `accelerate` as a hard requirement (#31090)
add accelerate
parent
22dab246
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
src/transformers/modeling_utils.py
src/transformers/modeling_utils.py
+3
-0
No files found.
src/transformers/modeling_utils.py
View file @
94d416f0
...
@@ -3048,6 +3048,9 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
...
@@ -3048,6 +3048,9 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
" ignored."
" 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
commit_hash
is
None
:
if
not
isinstance
(
config
,
PretrainedConfig
):
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
# We make a call to the config file first (which may be absent) to get the commit hash as soon as possible
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment