-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
fix warning trigger for embed_positions when loading xglm #25798
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
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.
Hi @MattYoon
Thanks a lot for the PR ! A test that checks conversion between tensorflow and pytorch model is failing. I think we can fix it by adding a _keys_to_ignore_on_load_missing
in the TF XGLM modeling file as follows:
_keys_to_ignore_on_load_missing = [r"h.\d+.attn.masked_bias", r"h.\d+.attn.bias", r"lm_head.weight"] |
@younesbelkada Good question! There is no
Let me know if you need my help writing a PR for any of this! |
Hi, @younesbelkada. Thanks for guiding me through the PR! To be frank, I'm not familiar enough on either TF or Transformers to complete this PR. I'm worried that me attempting to fix this issue will cause some other problems and merging this PR will take way longer than necessary. The issue seems like a very simple fix for someone familiar with the internals of Transformers. Can you or someone else close this PR and take the torch? Sorry I couldn't be much help. |
@MattYoon You don't need to close it! If you allow edits from maintainers, I can push the relevant change to your branch. It should only be one line in the TF code. Are you okay with me doing that? |
Yes that sounds great! I believe "allow edits from maintainers" is active for this PR. |
@MattYoon Done! I also fixed some spelling in the TF module while I was there. cc @younesbelkada too |
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 for your great contribution @MattYoon and thanks a lot for the help @Rocketknight1 !
cc @amyeroberts for core maintainer review! |
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 for fixing!
…e#25798) * fix warning triggering for xglm.embed_positions * Make TF variable a tf.constant to match (and fix some spelling) --------- Co-authored-by: Matt <rocketknight1@gmail.com>
…e#25798) * fix warning triggering for xglm.embed_positions * Make TF variable a tf.constant to match (and fix some spelling) --------- Co-authored-by: Matt <rocketknight1@gmail.com>
…e#25798) * fix warning triggering for xglm.embed_positions * Make TF variable a tf.constant to match (and fix some spelling) --------- Co-authored-by: Matt <rocketknight1@gmail.com>
What does this PR do?
Fixes #25797
Warning no longer triggers when loading XGLM from the hub. I've followed @younesbelkada 's suggestion of making the problematic module non-persistent.
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@younesbelkada @ArthurZucker
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.