spacy.load error decorative function #13146
Replies: 1 comment
-
Hi, welcome to the forum! We'd appreciate it if you'd use markdown for formatting code & output, as that makes it all more readable. You can surround a code block with three backticks. This code seems to be just fine, what kind of environment are you executing this in? Was the model downloaded correctly, any error or warning output? Did you restart your kernel after downloading the model? To be perfectly honest I'm not sure what's going on here - I've never seen this kind of error before and I've executed Let us know how you go? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How to reproduce the behaviour
!python3 -m spacy download en_core_web_smimport spacy
nlp = spacy.load("en_core_web_sm")
Your Environment
2023-11-20 22:52:39.399591: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Info about spaCy
TypeError Traceback (most recent call last)
Cell In[33], line 1
----> 1 nlp = spacy.load("en_core_web_sm")
File ~/.local/lib/python3.10/site-packages/spacy/init.py:54, in load(name, vocab, disable, enable, exclude, config)
30 def load(
31 name: Union[str, Path],
32 *,
(...)
37 config: Union[Dict[str, Any], Config] = util.SimpleFrozenDict(),
38 ) -> Language:
39 """Load a spaCy model from an installed package or a local path.
40
41 name (str): Package name or model path.
(...)
52 RETURNS (Language): The loaded nlp object.
53 """
---> 54 return util.load_model(
55 name,
56 vocab=vocab,
57 disable=disable,
58 enable=enable,
59 exclude=exclude,
60 config=config,
...
141 assert hasattr(self, 'name')
142 if not hasattr(self, 'signature'):
--> 143 raise TypeError('You are decorating a non function: %s' % func)
TypeError: You are decorating a non function: that is odd
Beta Was this translation helpful? Give feedback.
All reactions