JohnGiorgi / DeCLUTR

The corresponding code from our paper "DeCLUTR: Deep Contrastive Learning for Unsupervised Textual Representations". Do not hesitate to open an issue if you run into any trouble!
https://aclanthology.org/2021.acl-long.72/
Apache License 2.0
378 stars 33 forks source link

Installation issue #236

Closed kingafy closed 2 years ago

kingafy commented 3 years ago

I am trying to install declutr on python=3.6. Getting the below error every time. Running command git clone -q https://github.com/JohnGiorgi/DeCLUTR.git '_' ERROR: Could not find a version that satisfies the requirement torch<1.7.0,>=1.6.0 (from allennlp) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1) ERROR: No matching distribution found for torch<1.7.0,>=1.6.0

repodiac commented 3 years ago

Hi, did you follow the instructions on the webpage - i.e. have you installed AllenNLP before installing DeCLUTR?

Btw. I could only make it work using conda for the installlation of AllenNLP since otherwise AllenNLP did not work properly in my case.

JohnGiorgi commented 3 years ago

@kingafy I am not sure what could be causing this issue. I just double-checked that running pip install git+https://github.com/JohnGiorgi/DeCLUTR.git in a colab notebook works without error (you can confirm by running the first code cell in this notebook). Maybe try using a newer python version? The colab notebook uses 3.7.

repodiac commented 3 years ago

Oh, btw. @JohnGiorgi - I figured that the version of the transformers library is outdated - you need a current version to have the bug fixed which prevents you from using huggingface hub models: https://github.com/huggingface/transformers/issues/12941

kingafy commented 3 years ago

What should I do to resolve transformers version issue?

kingafy commented 3 years ago

In colab no issues but in local I am facing issues. I set up a new environment with python=3.6. Installad Allennlp, then tried to install declutr both from source as well as via pip install command as suggested but the error keeps coming ERROR: Could not find a version that satisfies the requirement torch<1.7.0,>=1.6.0 (from allennlp) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1) ERROR: No matching distribution found for torch<1.7.0,>=1.6.0

repodiac commented 3 years ago

@kingafy : are you absolutely sure to use python 3.x? I know this kind of problem if you're accidentially using python 2.x still (for instance, you forgot to switch to the virtual environment/conda). Try python --version to check.

Regarding the transformers library, simply uninstall and reinstall:

pip uninstall -y transformers
pip install transformers
JohnGiorgi commented 3 years ago

@kingafy Has this been solved?

JohnGiorgi commented 2 years ago

Closing. Feel free to re-open if there are still issues.