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

Does sentence-transformers prefer safetensors when available? #2293

Closed
steve-marmalade opened this issue Aug 31, 2023 · 2 comments
Closed

Does sentence-transformers prefer safetensors when available? #2293

steve-marmalade opened this issue Aug 31, 2023 · 2 comments

Comments

@steve-marmalade
Copy link

I have recently started seeing pretrained models on the huggingface hub in model.safetensors files in addition to the (less secure) pickled pytorch_model.bin. The transformers PreTrainedModel.from_pretrained has a use_safetensors argument that controls whether these files should be used.

Does sentence-transformers have something equivalent and/or default to using them where available?

@tomaarsen
Copy link
Collaborator

Hello!

Yes, model.safetensors files are automatically prioritized over pytorch_model.bin. However, currently the full HF Hub repository is downloaded, often resulting in a download for both model.safetensors and pytorch_model.bin, but #2345 will resolve this inefficiency.

  • Tom Aarsen

@steve-marmalade
Copy link
Author

Thanks, @tomaarsen !

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

No branches or pull requests

2 participants