jalammar / ecco

Explain, analyze, and visualize NLP language models. Ecco creates interactive visualizations directly in Jupyter notebooks explaining the behavior of Transformer-based language models (like GPT2, BERT, RoBERTA, T5, and T0).
https://ecco.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.96k stars 167 forks source link

Google Colab support only Python 3.10 #102

Open Rolkarolka opened 1 year ago

Rolkarolka commented 1 year ago

Hi! Is there any chance to enable ecco for python 3.10? I've tried running jupyter notebooks from docs (like https://colab.research.google.com/github/jalammar/ecco/blob/main/notebooks/Language_Models_and_Ecco_PyData_Khobar.ipynb) in Google Colab and I can't install ecco successfully :(

Collecting ecco
  Downloading ecco-0.1.2-py2.py3-none-any.whl (70 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 70.7/70.7 kB 1.2 MB/s eta 0:00:00
Collecting transformers~=4.2 (from ecco)
  Downloading transformers-4.31.0-py3-none-any.whl (7.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.4/7.4 MB 17.3 MB/s eta 0:00:00
Requirement already satisfied: seaborn~=0.11 in /usr/local/lib/python3.10/dist-packages (from ecco) (0.12.2)
Collecting scikit-learn~=0.23 (from ecco)
  Downloading scikit-learn-0.24.2.tar.gz (7.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.5/7.5 MB 32.8 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  Preparing metadata (pyproject.toml) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
EricPeter commented 1 year ago

Hi did you manage to install it . I am having the seem issue

martin12333 commented 1 year ago

Weeks ago, I made the ecco *.ipynb mostly work. In Python 3.10 .

Locally. In a conda env with many other programs.

I remember having problems with version numbers of dependencies. I had to edit the req file(s) of ecco: as a false-beginner, I edited both setup.py, and requirements.txt

My notes are at https://github.com/martin12333/marti-onedrive/blob/main2/AI/pip----31pip310ecco.e.f8.sh

My files setup.py, and requirements.txt are at https://github.com/martin12333/marti-onedrive/tree/main2/AI/Jalammar

EDIT: the versions I have: numpy 1.24.3 scikit-learn 1.2.2 transformers 4.29.2 torch 1.13.1 PyYAML 6.0

akozlo commented 1 year ago

I'm having a similar issue. Simply running !pip install ecco on a google colab notebook produces an error now.

Untitled

iliemihai commented 1 year ago

Downgrade to python 3.8: !apt-get install python3.8 !ln -sf /usr/bin/python3.8 /usr/bin/python !sudo apt-get install python3.8-distutils !wget https://bootstrap.pypa.io/get-pip.py !sudo /usr/bin/python3.8 get-pip.py

daria-lioubashevski commented 10 months ago

Did anyone manage to resolve this issue? I tried downgrading to python 3.8 as suggested here, and it didn't work - pip install ecco comand seems to finish successfully, but when running: import ecco I get the error: ModuleNotFoundError: No module named 'ecco'

hxyin commented 9 months ago

I solved this problem by making a fork of the ecco library and change the contents in setup.py and requirements.txt based on the version provided by martin12333 https://github.com/jalammar/ecco/issues/102#issuecomment-1675574099. And then I installed my repo in colab using !sudo pip install git+https://github.com/hxyin/ecco. I hope this works for you, too!

daria-lioubashevski commented 9 months ago

@hxyin thank you so much! i managed to install ecco using your answer by doing the following:

import os from getpass import getpass user = getpass('GitHub user') password = getpass('GitHub password') os.environ['GITHUB_AUTH'] = user + ':' + password !git clone https://$GITHUB_AUTH@github.com/hxyin/ecco

%cd ecco !pip install -e .

Now a new problem - ecco.from_pretrained which appears in all examples doesn't work, and I can't find a way to import LM class directly for some reason