princeton-nlp / SimCSE

[EMNLP 2021] SimCSE: Simple Contrastive Learning of Sentence Embeddings https://arxiv.org/abs/2104.08821
MIT License
3.33k stars 505 forks source link

The model I want to use was added only after transfomer 4.2.1, what should I do in this case? #199

Closed jweihe closed 1 year ago

jweihe commented 1 year ago

thank you for your great work!but if i don't use transformer=4.2.1,The code will report an error “cannot import name '_model_unwrap' from 'transformers.trainer'“,could you tell me how to solve this case?thanks a lot~

gaotianyu1350 commented 1 year ago

Hi,

In this case you can upgrade your transformers. Our code should also work for later transformers (unless there is some API change then you need to modify our code accordingly)