Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Safetensors] Make sure metadata is saved #2506

Merged
merged 2 commits into from
Feb 27, 2023

Conversation

patrickvonplaten
Copy link
Contributor

@patrickvonplaten patrickvonplaten commented Feb 27, 2023

When loading devices with device_map="auto" and safetensors, accelerate expects that the safetensors weights have a "pytorch" format, see: /~https://github.com/huggingface/accelerate/blob/907a86d145cc62521ea0281eb24465f537480e2d/src/accelerate/utils/modeling.py#L670

Let's make sure we save this format when saving with safe_serialization.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Feb 27, 2023

The documentation is not available anymore as the PR was closed or merged.

@patrickvonplaten
Copy link
Contributor Author

Also related: huggingface/accelerate#1121

@patrickvonplaten patrickvonplaten merged commit 0e975e5 into main Feb 27, 2023
@patrickvonplaten patrickvonplaten deleted the make_sure_metadata_is_saved_accelerate branch February 27, 2023 16:38
mengfei25 pushed a commit to mengfei25/diffusers that referenced this pull request Mar 27, 2023
* [Safetensors] Make sure metadata is saved

* make style
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* [Safetensors] Make sure metadata is saved

* make style
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* [Safetensors] Make sure metadata is saved

* make style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants