-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Bug]: Support Transformers 4.31.0 #3284
Comments
Same here, pinning transformers to 4.30.2 solve the problem. |
Hi @konrad0101 @M4nouel , If I understand this correct, this only applies to loading old models, loading models trained with the same version still works fine. Hence I am against preventing transformers 4.31.0 to be installed. I will work on a propper fix, until then you can either:
|
As long as inference is done using 4.31.0, the issue exists. It doesn't solve the problem to train on 4.31.0. |
Using
for
|
OK @helpmefindaname , I tried retraining an old model using transformers 4.31.0 and it seems to work. I will use transformers 4.30.2 for the models I can't or don't want to retrain and train/retrain the others without pinning the transformers lib. Thanks a lot ! |
#3289 is now out, which should fix the problem. Can you please check if it works for your case and report back if there any problems with it? |
Hi @helpmefindaname, I built your branch and tried it with an old model and everything looks great ! Thanks ! |
@helpmefindaname Thanks! The changes work for me with the new transformers version. |
Hey! @alanakbik & @helpmefindaname ! Thanks for the fix, this works fine for me. Any intentions on updating the requirements.txt in main or releasing a minor release? |
Hi @s1lvester |
Actually I just encountered this bug again and reverte to use transformers 4.30 ... |
Describe the bug
When the python environment is updated to use the latest version of
transformers
, SequenceTagger fails due to an unexpected key in state_dict:To Reproduce
edit by @helpmefindaname
(install
transformers>=4.31.0
)Expected behavior
SequenceTagger should load without issue.
Logs and Stack traces
No response
Screenshots
No response
Additional Context
No response
Environment
Versions:
Flair
0.12.2
Pytorch
2.0.1+cu118
Transformers
4.31.0
GPU
True
The text was updated successfully, but these errors were encountered: