ALBEF icon indicating copy to clipboard operation
ALBEF copied to clipboard

TypeError: add_code_sample_docstrings() got an unexpected keyword argument "tokenizer_class"

Open dongxinfeng1 opened this issue 2 years ago • 5 comments

Hello, when run this code, I found a problem in "xbert.py", TypeError: add_code_sample_docstrings() got an unexpected keyword argument "tokenizer_class", could you please tell me why?

dongxinfeng1 avatar Nov 18 '22 03:11 dongxinfeng1

可能是transformer版本太高,试试降低一下版本

qinshuaibo avatar Nov 26 '22 09:11 qinshuaibo

It is most likely due to a transformer version mismatch

LiJunnan1992 avatar Nov 28 '22 01:11 LiJunnan1992

Solution for python 3.7:

pip install transformers==4.8.1

charlesxu90 avatar Jun 25 '23 08:06 charlesxu90

Solve it by updating the argument according to the following: hugging face transformer update

JingyuanHe1222 avatar Dec 03 '23 00:12 JingyuanHe1222

Replacing tokenizer_class with processor_class within models/xbert.py works for me.

shyammarjit avatar Feb 15 '24 12:02 shyammarjit