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

MAINT: Default to loading weights only for torch.load #1993

Conversation

BenjaminBossan
Copy link
Member

The torch.load function allows to pass weights_only=True, which is more secure but may break some code that is more than just weights. For PEFT, this should not be the case, so the switch should just work.

By making the switch now, we can find out early if there are any problems, as torch.load will default to True in the future.

The torch.load function allows to pass weights_only=True, which is more
secure but may break some code that is more than just weights. For PEFT,
this should not be the case, so the switch should just work.

By making the switch now, we can find out early if there are any
problems, as torch.load will default to True in the future.
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link

@mikaylagawarecki mikaylagawarecki left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor

@muellerzr muellerzr left a comment

Choose a reason for hiding this comment

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

Nice, very clean :)

@muellerzr
Copy link
Contributor

We should do this exact thing over in accelerate I think for ease of use

@BenjaminBossan BenjaminBossan merged commit fcac30b into huggingface:main Aug 7, 2024
14 checks passed
@BenjaminBossan BenjaminBossan deleted the maint-torch-load-default-to-weights_only branch August 7, 2024 17:16
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