-
Notifications
You must be signed in to change notification settings - Fork 193
🤗 Transformers compatibility | delete text_branch.embeddings.position_ids key #118
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
|
Hi @Vaibhavs10 ! Many thanks for the PR! I would like to double-check: Is this fix backward compatible? That is, do we still need the |
|
Hi @lukewys and @Vaibhavs10 , any update on this ? Many thanks 🤗 |
| import re | ||
| from copy import deepcopy | ||
| from pathlib import Path | ||
| from packaging import version |
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.
Since it is already a dependency of setup tools - we don't quite need to install this.
| state_dict = {k[7:]: v for k, v in state_dict.items()} | ||
|
|
||
| # removing position_ids to maintain compatibility with latest transformers update | ||
| if version.parse(transformers.__version__) >= version.parse("4.31.0"): |
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.
Explicit statement since this change only effects beyond 4.31.0.
|
H @lukewys - This should fix it now, Here's how you can verify it (made a quick colab for you to test): https://github.com/Vaibhavs10/scratchpad/blob/main/laion_clap_fix_repro.ipynb |
|
Sorry for the late reply. That seems great! Many thanks @Vaibhavs10 ! I will quickly check with Ke and merge this PR asap! |
|
Done! Thanks again @Vaibhavs10 ! |
|
@lukewys is there a new PYPI release coming with this fix? 1.1.5 for example. |
|
Oh, thanks for the reminder! Looping in @RetroCirce here! |
|
@lukewys @RetroCirce a polite reminder again. I am tired of downloading this package manually for all the repos and importing stuff from the local files since I cannot afford to downgrade transformers 😢 |
|
Hi,Thank you for the reminder! And sorry for the delayed update as both of us are busy these days.We will push a new 1.1.5 PYPI library to fix these problems, as well as other bugs reported by other issue posts before May 10th.And we will notify here and in readme once it gets updated.Best,Ke在 2024年5月1日,03:22,OJASV Kamal ***@***.***> 写道:
@lukewys @RetroCirce a polite reminder again. I am tired of downloading this package manually for all the repos and importing stuff from the local files since I cannot afford to downgrade transformers 😢
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
Thanks so much for the response! |
|
New update: the 1.15 PYPI library is ready and we will push it in the next week. |
|
It'd be great to have the new release :) |
|
Sorry for the late update! |
|
Congrats and thank you for the great work! |
Hi there,
As observed earlier the most recent update to
transformershas brokenload_state_dictfunction in CLAP.This patch fixes that error. It is effectively removing the
position_idskey from the text branch. It errors out because of the recent change in transformers huggingface/transformers#24505 :)This change fixes it. Feel free to let me know if you need any clarification. 🤗
cc: @lukewys 🙏