mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
make tensors contiguous before passing to safetensors (#10761)
fix contiguous bug
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user