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] Relax missing metadata constraint #1151

Merged
merged 3 commits into from
Mar 6, 2023

Conversation

patrickvonplaten
Copy link
Contributor

@patrickvonplaten patrickvonplaten commented Mar 6, 2023

Many diffusers checkpoint are sadly saved without metadata["format"] = "pt" which then creates the following issues: huggingface/diffusers#2445

@sgugger could we maybe relax the constraint here a bit that if the metadata is missing we assume it's PT (also since accelerate is only made for PT)

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 6, 2023

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

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!


if metadata is None:
logger.warn(
f"The safetensors archive passed at {checkpoint_file} does not contain metadata. Make sure to save your model with the `save_pretrained` method. Defaulting to 'pt' metadata."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you just split this to respect the 119 char limit? Thanks!

@patrickvonplaten patrickvonplaten merged commit 9dc5b34 into main Mar 6, 2023
@patrickvonplaten patrickvonplaten deleted the relax_metadata_constraint branch March 6, 2023 15:01
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.

None yet

3 participants