Spacy model en-core-web-trf
hangs when executed in a celery task
#9028
-
How to reproduce the behaviourWhat is celery?Celery is a standard python job queue meant to schedule and execute tasks at a later point. Bug descriptionHere's a short snippet of code I use to access import spacy
NLP = spacy.load("en_core_web_trf")
def get_people(text):
sents = NLP(text)
return [str(ee) for ee in sents.ents if ee.label_ == "PERSON"] Here's a short snippet of code to reproduce the celery issue: @task
def testing_spacy():
import spacy_utils # Snippet of code above
print(spacy_utils.get_people("John called Mary")) If the function from above, is called directly, i.e. Furthermore, I came across a closed issue #6662 which described a similar bug. I ran that PoC (normally in a python shell), and it got stuck with this warning:
Trying to set I'm not sure what's the difference between running this code normally and in celery but the PoC from the mentioned issue also isn't working so I think spacy tries some parallelism that's available when running in celery. Your Environment
Thanks for the help in advance, I hope I just misconfigured something basic. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi, please see: #8694 |
Beta Was this translation helpful? Give feedback.
Hi, please see: #8694