fix: add compatibility with Transformers 4.55.0

#2
by Yrooo - opened

Context:

On the github repo, "https://github.com/BUTSpeechFIT/DiCoW/blob/main/requirements.txt" shows a transformers=4.55.0 dependency, introduced by this commit :
https://github.com/yro7/DiCoW-dockerized/commit/897f76935277c51b5fda0d23189c2997933d8a8d

However, the HF code still uses a code that seems to be from transformers=4.42.0 , such as "WHISPER_ATTENTION_CLASSES"
(see https://huggingface.co/openbmb/MiniCPM-o-2_6/discussions/49)

Those changes in the transformers API break the model. Hence following the installation directives achieve to a broken setup.

This PR fixes this by patching the imports to be transformers=4.5.5 compliant, almost without touching the rest of the code.

Yrooo changed pull request title from fix: add compatibility with Transformers 4.40.1+ to fix: add compatibility with Transformers 4.5.5+
Yrooo changed pull request title from fix: add compatibility with Transformers 4.5.5+ to fix: add compatibility with Transformers 4.55.0

Hey,

I tried my best to avoid touching at as much code as possible. However I had to backport some helpers functions from transformers 4.40.

This version compiles with transformers=4.55.0 and can run a full pipeline without issues.
See "https://github.com/yro7/DiCoW-dockerized" and simply "docker compose up" to test it :)

Best regards,
Marin

Yrooo changed pull request status to open
Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment