Token Classification
GLiNER
PyTorch
multilingual

Scipy "triu" error

#11
by nextlvl23 - opened

Traceback (most recent call last):
File "/Users/tannergreen/Code/goofin/goofin.py", line 1, in
from gliner import GLiNER
File "/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/gliner/init.py", line 3, in
from .model import GLiNER
File "/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/gliner/model.py", line 13, in
from gliner.modules.token_rep import TokenRepLayer
File "/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/gliner/modules/token_rep.py", line 4, in
from flair.data import Sentence
File "/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/flair/init.py", line 42, in
from . import ( # noqa: E402 import after setting device
File "/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/flair/models/init.py", line 1, in
from .clustering import ClusteringModel
File "/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/flair/models/clustering.py", line 14, in
from flair.embeddings import DocumentEmbeddings
File "/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/flair/embeddings/init.py", line 13, in
from .document import (
File "/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/flair/embeddings/document.py", line 16, in
from flair.embeddings.token import FlairEmbeddings, StackedEmbeddings, TokenEmbeddings
File "/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/flair/embeddings/token.py", line 10, in
import gensim
File "/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/gensim/init.py", line 11, in
from gensim import parsing, corpora, matutils, interfaces, models, similarities, utils # noqa:F401
File "/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/gensim/corpora/init.py", line 6, in
from .indexedcorpus import IndexedCorpus # noqa:F401 must appear before the other classes
File "/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/gensim/corpora/indexedcorpus.py", line 14, in
from gensim import interfaces, utils
File "/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/gensim/interfaces.py", line 19, in
from gensim import utils, matutils
File "/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/gensim/matutils.py", line 20, in
from scipy.linalg import get_blas_funcs, triu
ImportError: cannot import name 'triu' from 'scipy.linalg' (/Users/tannergreen/.pyenv/versions/3.10.10/lib/python3.10/site-packages/scipy/linalg/init.py)

Owner

The triu package from spicy has been deprecated and is not used in 1.13 (latest).
Downgrading to spicy 1.12 resolve the issue.

Worked perfect, thank you! Also "spicy" lol gotta love auto-correct

nextlvl23 changed discussion status to closed

Sign up or log in to comment