Skip to content

Adding some safetensors docs. #2122

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

Merged
merged 5 commits into from
Jan 27, 2023
Merged

Adding some safetensors docs. #2122

merged 5 commits into from
Jan 27, 2023

Conversation

Narsil
Copy link
Contributor

@Narsil Narsil commented Jan 26, 2023

Written with #2123 in mind.

This is optional but makes the actual inner working more explicit for users.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jan 26, 2023

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

@@ -0,0 +1,19 @@
# What is safetensors ?
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can delete this file no? :-)

```
from diffusers import StableDiffusionPipeline

pipe = StableDiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1", use_safetensors=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't have this argument yet and I think it might take 1,2 weeks to align with transfomers. Maybe just do the hacky way via:

pip install safetensors
pip uninstall safetensors

? for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can revisit what I've written to conform what is actually here now.

Copy link
Contributor

@patrickvonplaten patrickvonplaten left a comment

Choose a reason for hiding this comment

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

Super nice doc :-) I'll try to focus on getting a solution for #2123 asap

@Narsil Narsil merged commit 20396e2 into huggingface:main Jan 27, 2023
@Narsil Narsil deleted the safetensors_doc branch January 27, 2023 17:20
@Narsil
Copy link
Contributor Author

Narsil commented Jan 27, 2023

Super nice doc :-) I'll try to focus on getting a solution for #2123 asap

I removed the problematic part of the doc, so we can merge this now, and readd whatever is missing from this document when we have a solution to force load specific weights

@zetyquickly
Copy link
Contributor

zetyquickly commented Feb 22, 2023

Hello, actually it's not clear from the doc how to load *.safetensors using from_pretrained, do we need to pass additional params? And what to do in case of "Not a Valid JSON file" error?

AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* Tmp.

* Adding more docs.

* Doc style.

* Remove the argument `use_safetensors=True`.

* doc-builder
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