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
renzhc
diffusers_dcu
Commits
97abdd22
Unverified
Commit
97abdd22
authored
Feb 13, 2025
by
Fanli Lin
Committed by
GitHub
Feb 13, 2025
Browse files
make tensors contiguous before passing to safetensors (#10761)
fix contiguous bug
parent
051ebc3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/diffusers/models/modeling_utils.py
src/diffusers/models/modeling_utils.py
+1
-1
No files found.
src/diffusers/models/modeling_utils.py
View file @
97abdd22
...
...
@@ -549,7 +549,7 @@ class ModelMixin(torch.nn.Module, PushToHubMixin):
os
.
remove
(
full_filename
)
for
filename
,
tensors
in
state_dict_split
.
filename_to_tensors
.
items
():
shard
=
{
tensor
:
state_dict
[
tensor
]
for
tensor
in
tensors
}
shard
=
{
tensor
:
state_dict
[
tensor
]
.
contiguous
()
for
tensor
in
tensors
}
filepath
=
os
.
path
.
join
(
save_directory
,
filename
)
if
safe_serialization
:
# At some point we will need to deal better with save_function (used for TPU and other distributed
...
...
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