-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import ecco ERRO #88
Comments
I updated numpy using the command Then tried to run the notebook cell import ecco lm = ecco.from_pretrained('t5-small') output = lm.generate(f"sst2 sentence: {review}", generate=1, do_sample=False) But its giving the following error TypeError Traceback (most recent call last) 1 frames TypeError: argument of type 'NoneType' is not iterable |
Fixed |
I solved this problem by pip install -U numpy and the , the most important thing, you must restart your notebook kernel |
tried the above options both in colab and local jupyter notebook. But giving the same error: TypeError: argument of type 'NoneType' is not iterable `` ! pip uninstall numpy -y import ecco lm = ecco.from_pretrained('t5-small') output = lm.generate(f"sst2 sentence: {review}", generate=1, do_sample=False) TypeError Traceback (most recent call last) ~/miniconda3/envs/py3.8/lib/python3.8/site-packages/ecco/lm.py in generate(self, input_str, max_length, temperature, top_k, top_p, do_sample, attribution, generate, beam_size, **generate_kwargs) ~/miniconda3/envs/py3.8/lib/python3.8/site-packages/transformers/generation/utils.py in _prepare_decoder_input_ids_for_generation(self, batch_size, model_input_name, model_kwargs, decoder_start_token_id, bos_token_id, device) TypeError: argument of type 'NoneType' is not iterable |
Same |
Yeah the
gives
|
Just fixed the issue. Downgrading your |
Note that this solution is a quick fix. If you want to use models like |
Maybe another solution is: Locally. In a conda env with many other programs. My notes are at My files setup.py, and requirements.txt are at EDIT: additional info is at #102 (comment) |
Hey,
I tried pip install ecco on google colab then import ecco
but I have the error below:
RuntimeError Traceback (most recent call last)
init.pxd in numpy.import_array()
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf . Check the section C-API incompatibility at the Troubleshooting ImportError section at https://numpy.org/devdocs/user/troubleshooting-importerror.html#c-api-incompatibility for indications on how to solve this problem .
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
in <cell line: 1>()
----> 1 import ecco
2 lm = ecco.from_pretrained('distilgpt2')
5 frames
/usr/local/lib/python3.10/dist-packages/ecco/init.py in
14
15 version = '0.1.2'
---> 16 from ecco.lm import LM
17 from transformers import AutoTokenizer, AutoModelForCausalLM, AutoModel, AutoModelForSeq2SeqLM
18 from typing import Any, Dict, Optional, List
/usr/local/lib/python3.10/dist-packages/ecco/lm.py in
13 from torch.nn import functional as F
14 from ecco.attribution import compute_primary_attributions_scores
---> 15 from ecco.output import OutputSeq
16 from typing import Optional, Any, List, Tuple, Dict, Union
17 from operator import attrgetter
/usr/local/lib/python3.10/dist-packages/ecco/output.py in
9 import torch
10 from torch.nn import functional as F
---> 11 from sklearn import decomposition
12 from typing import Dict, Optional, List, Tuple, Union
13 from ecco.util import strip_tokenizer_prefix, is_partial_token
/usr/local/lib/python3.10/dist-packages/sklearn/init.py in
80 from . import _distributor_init # noqa: F401
81 from . import __check_build # noqa: F401
---> 82 from .base import clone
83 from .utils._show_versions import show_versions
84
/usr/local/lib/python3.10/dist-packages/sklearn/base.py in
15 from . import version
16 from ._config import get_config
---> 17 from .utils import _IS_32BIT
18 from .utils._tags import (
19 _DEFAULT_TAGS,
/usr/local/lib/python3.10/dist-packages/sklearn/utils/init.py in
20 from scipy.sparse import issparse
21
---> 22 from .murmurhash import murmurhash3_32
23 from .class_weight import compute_class_weight, compute_sample_weight
24 from . import _joblib
sklearn/utils/murmurhash.pyx in init sklearn.utils.murmurhash()
init.pxd in numpy.import_array()
ImportError: numpy.core.multiarray failed to import
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
The text was updated successfully, but these errors were encountered: