LAION-AI / CLAP

Contrastive Language-Audio Pretraining
https://arxiv.org/abs/2211.06687
Creative Commons Zero v1.0 Universal
1.43k stars 137 forks source link

🤗 Transformers compatibility | delete text_branch.embeddings.position_ids key #118

Closed Vaibhavs10 closed 1 year ago

Vaibhavs10 commented 1 year ago

Hi there,

As observed earlier the most recent update to transformers has broken load_state_dict function in CLAP. This patch fixes that error. It is effectively removing the position_ids key from the text branch. It errors out because of the recent change in transformers https://github.com/huggingface/transformers/pull/24505 :)

This change fixes it. Feel free to let me know if you need any clarification. 🤗

cc: @lukewys 🙏

lukewys commented 1 year ago

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 position_ids in loading the early version of the transformers? If so, could you kindly add an if statement for checking the transformers version? Many thanks!

ylacombe commented 1 year ago

Hi @lukewys and @Vaibhavs10 , any update on this ? Many thanks :hugs:

Vaibhavs10 commented 1 year ago

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

lukewys commented 1 year ago

Sorry for the late reply. That seems great! Many thanks @Vaibhavs10 ! I will quickly check with Ke and merge this PR asap!

lukewys commented 1 year ago

Done! Thanks again @Vaibhavs10 !

dakl commented 8 months ago

@lukewys is there a new PYPI release coming with this fix? 1.1.5 for example.

lukewys commented 7 months ago

Oh, thanks for the reminder! Looping in @RetroCirce here!

kamalojasv181 commented 6 months ago

@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 :cry:

RetroCirce commented 6 months ago

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: @.***>

kamalojasv181 commented 6 months ago

Thanks so much for the response!

RetroCirce commented 6 months ago

New update: the 1.15 PYPI library is ready and we will push it in the next week.

mcherep commented 4 months ago

It'd be great to have the new release :)

RetroCirce commented 4 months ago

Sorry for the late update! Just graduate from my PHD lol. The new PIP library of laion-clap (1.1.6) is ready and released: https://pypi.org/project/laion-clap/ We fix some bugs, including supporting the new transformers library.

mcherep commented 4 months ago

Congrats and thank you for the great work!