-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[WIP] Load text_model.embeddings.position_ids outsude state_dict #3829
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
Conversation
|
The patch seems to work with 4.31.0. However there is a reproducible error in the logs during the conversion process: My guess is that this is related to a bad model manager event. I will investigate. |
|
As expected, the patch does not work when used with transformers 4.30.2: I've put in a try: block which tries fetching the state dict first without the key and then with the key added back in. I think this is marginally better than checking the module version number, since the transformers team might put the key back into the next version. |
lstein
left a comment
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.
Tested with both 4.31.0 and 4.30.2 and seems to be working as expected.
What type of PR is this? (check all applicable)
Description
In transformers 4.31.0
text_model.embeddings.position_idsno longer part of state_dict.Fix untested as can't run right now but should be correct. Also need to check how transformers 4.30.2 works with this fix.
Related Tickets & Documents
huggingface/transformers@8e5d161#diff-7f53db5caa73a4cbeb0dca3b396e3d52f30f025b8c48d4daf51eb7abb6e2b949R191
https://pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.register_buffer
QA Instructions, Screenshots, Recordings