princeton-nlp / SimCSE

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

环境的要求 #138

Closed EEE1even closed 2 years ago

EEE1even commented 2 years ago

我想知道对于transformers的版本要求是什么,pytorch我使用的是1.7.1版本,但是我在使用SimCSE库时会报错:ImportError: cannot import name 'AutoModel' from 'transformers' (unknown location),我最初认为是pytorch的原因,但是我尝试了pytorch不同的版本还是会出现无法import name 'AutoModel'的问题

gaotianyu1350 commented 2 years ago

Hi please use transformers==4.2.1, which is included in the requirements.txt

EEE1even commented 2 years ago

thanks , I was the one who overlooked the requirements.txt