Skip to content

Conversation

@patrickvonplaten
Copy link
Contributor

@patrickvonplaten patrickvonplaten commented Jan 19, 2023

When converting from pytorch_model.bin to safetensors format, currently pytorch_model.bin files can be deleted because diffusers confuses the "sharded" folder structure with the always present folder saving format.

Since we don't have sharded checkpointing (yet) in diffusers, we will delete the code for now.


weights_name = SAFETENSORS_WEIGHTS_NAME if safe_serialization else WEIGHTS_NAME

# Clean the folder from a previous save
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the code is unnecessary since we don't have sharded checkpoints yet

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jan 19, 2023

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

@patrickvonplaten patrickvonplaten changed the title correct safetensors [Save Pretrained] Remove dead code lines that can accidentally remove pytorch files Jan 19, 2023
Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't fully understand the logic when I saw this fragment in the previous PR, but didn't check how it worked. Should have asked!

@patrickvonplaten patrickvonplaten merged commit f354dd9 into main Jan 19, 2023
@patrickvonplaten patrickvonplaten deleted the correct_safetensors branch January 19, 2023 09:11
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
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.

4 participants