-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[Single File Loading] Handle unexpected keys in CLIP models when accelerate
isn't installed.
#8462
Conversation
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. |
ok but is this not used |
No. Since transformers Since |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
…elerate` isn't installed. (#8462) * update * update * update * update * update --------- Co-authored-by: YiYi Xu <yixu310@gmail.com> Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
…elerate` isn't installed. (#8462) * update * update * update * update * update --------- Co-authored-by: YiYi Xu <yixu310@gmail.com> Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
What does this PR do?
Fixes #8578
Since
transformers>=4.31.0
, the keytext_model.embeddings.position_id
has been made non-persistent in the CLIP models. This can cause an issue when loading older versions of the checkpoint with single file whenaccelerate
isn't installed, because we rely on strict loading withmodel.load_state_dict
in this case.This PR
model.load_state_dict
to not use strict loading, so that we can raise a warning about unexpected keys whenaccelerate
isn't installed.Fixes # (issue)
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.