spaCy loads "spacy-transformers" library even when using CPU model #11926
-
Usually this is not a problem, but when running spaCy with Python optimize level set to 2 this would cause Error traceback:
Could this behavior be changed to only load the Relevant code: Line 162 in df0cb4b |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
There's no way for spacy to use entry points like those for the additional architectures in I would suggest filing an issue in the (Also, due to issues with numpy and torch we haven't published |
Beta Was this translation helpful? Give feedback.
There's no way for spacy to use entry points like those for the additional architectures in
spacy-transformers
without loading the packages to some degree.I would suggest filing an issue in the
transformers
repo because this could be updated to check for whether__doc__
is defined first, which they do in other places in the code. (I checked and couldn't find any related issues or PRs, but it's kind of hard to search for__doc__
, so I might have missed something.)(Also, due to issues with numpy and torch we haven't published
spacy-transformers
packages that support the very newest version oftransformers
yet, but I've tested newer releases oftransformers
and they were fine even ifspacy…