Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
588d8f1f
"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "39c37fe45c12bc2f936313330fe5c82319adb6e3"
Unverified
Commit
588d8f1f
authored
Jun 02, 2022
by
Sylvain Gugger
Committed by
GitHub
Jun 02, 2022
Browse files
Fix when Accelerate is not installed (#17518)
parent
f128ccb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/transformers/modeling_utils.py
src/transformers/modeling_utils.py
+2
-1
No files found.
src/transformers/modeling_utils.py
View file @
588d8f1f
...
...
@@ -2394,7 +2394,8 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
del
state_dict
gc
.
collect
()
save_offload_index
(
offload_index
,
offload_folder
)
if
offload_index
is
not
None
and
len
(
offload_index
)
>
0
:
save_offload_index
(
offload_index
,
offload_folder
)
if
offload_state_dict
:
# Load back temporarily offloaded state dict
...
...
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