pygaggle
pygaggle copied to clipboard
File "pipes.pyx", line 1465, in spacy.pipeline.pipes.Sentencizer.from_nlp TypeError: type() takes 1 or 3 arguments
Running the re-ranking example throws the following exception:
Traceback (most recent call last):
File "/project_scratch/t5_ranking.py", line 2, in <module>
from pygaggle.rerank.transformer import MonoBERT
File "/project_scratch/users/amir/projects/RAG/dialdoc-task/env/lib/python3.9/site-packages/pygaggle/rerank/transformer.py", line 13, in <module>
from .similarity import SimilarityMatrixProvider
File "/project_scratch/users/amir/projects/RAG/dialdoc-task/env/lib/python3.9/site-packages/pygaggle/rerank/similarity.py", line 5, in <module>
from pygaggle.model.encode import SingleEncoderOutput
File "/project_scratch/users/amir/projects/RAG/dialdoc-task/env/lib/python3.9/site-packages/pygaggle/model/__init__.py", line 6, in <module>
from .encode import *
File "/project_scratch/users/amir/projects/RAG/dialdoc-task/env/lib/python3.9/site-packages/pygaggle/model/encode.py", line 8, in <module>
from .tokenize import BatchTokenizer
File "/project_scratch/users/amir/projects/RAG/dialdoc-task/env/lib/python3.9/site-packages/pygaggle/model/tokenize.py", line 172, in <module>
class SpacySenticizer:
File "/project_scratch/users/amir/projects/RAG/dialdoc-task/env/lib/python3.9/site-packages/pygaggle/model/tokenize.py", line 174, in SpacySenticizer
nlp.add_pipe(nlp.create_pipe('sentencizer'))
File "/project_scratch/users/amir/projects/RAG/dialdoc-task/env/lib/python3.9/site-packages/spacy/language.py", line 302, in create_pipe
return factory(self, **config)
File "/project_scratch/users/amir/projects/RAG/dialdoc-task/env/lib/python3.9/site-packages/spacy/language.py", line 1045, in factory
return obj.from_nlp(nlp, **cfg)
File "pipes.pyx", line 1465, in spacy.pipeline.pipes.Sentencizer.from_nlp
TypeError: type() takes 1 or 3 arguments
Do you know what's the problem and how can I fix it?
spacy version: 2.2.4 tokenizers version: 0.10.3 transformers version: 4.15.0
Python 3.9.7
Thanks
Install from source? The spacy version is not 2.2.4
in the requirements file
Thanks for your quick reply.
I installed the library by running pip install -r requirements
. The issue was due to my python version, the problem fixed when I switched to python 3.7 :)
Hi @hadifar - Can you try using Python 3.8 and see what happens? cf. https://github.com/castorini/pyserini/issues/916