princeton-nlp / SimCSE

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

evaluation.py `ImportError: cannot import name 'AutoModel'` #108

Closed SumNeuron closed 3 years ago

SumNeuron commented 3 years ago
pip install -r requirements.txt 
python SimCSE/evaluation.py      --model_name_or_path princeton-nlp/sup-simcse-bert-base-uncased      --pooler cls     --task_set sts     --mode test
Traceback (most recent call last):
  File "SimCSE/evaluation.py", line 9, in <module>
    from transformers import AutoModel, AutoTokenizer
ImportError: cannot import name 'AutoModel'
gaotianyu1350 commented 3 years ago

Can you check the version of transformers you were using? We suggest you use transformers higher than 4.2.1.