I've deployed a Django
web app in Elastic Beanstalk
and I'm trying to implement spacy, yet encountering errors.
I've listed the download link for the en_core_web_sm
in my requirements.txt
as https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-1.2.0/en_core_web_sm-1.2.0.tar.gz
I'm importing it in my code my calling import en_core_web_sm
and later trying to load it with:
nlp = en_core_web_sm.load()
However in my logs from eb
I'm getting errors indicating the model isn't loading properly. Am I missing something here? My instance is configured for 2gb
of RAM, that might not be enough, but it shouldn't effect the loading of the model, right? Why would it load the tokenizer but not the model?
[Fri Sep 01 04:33:49.276836 2017] [:error] [pid 23201] \x1b[93m Warning: no model found for 'en'\x1b[0m
[Fri Sep 01 04:33:49.276841 2017] [:error] [pid 23201]
[Fri Sep 01 04:33:49.276849 2017] [:error] [pid 23201]
[Fri Sep 01 04:33:49.276851 2017] [:error] [pid 23201] Only loading the 'en' tokenizer.
[Fri Sep 01 04:33:49.276855 2017] [:error] [pid 23201]
[Fri Sep 01 04:33:49.333165 2017] [:error] [pid 23201] Internal Server Error: /webhookmb/
[Fri Sep 01 04:33:49.333187 2017] [:error] [pid 23201] Traceback (most recent call last):
[Fri Sep 01 04:33:49.333189 2017] [:error] [pid 23201] File "/opt/python/run/venv/lib/python3.4/site-packages/django/core/handlers/exception.py", line 41, in inner
[Fri Sep 01 04:33:49.333192 2017] [:error] [pid 23201] response = get_response(request)
[Fri Sep 01 04:33:49.333194 2017] [:error] [pid 23201] File "/opt/python/run/venv/lib/python3.4/site-packages/django/core/handlers/base.py", line 187, in _get_response
[Fri Sep 01 04:33:49.333196 2017] [:error] [pid 23201] response = self.process_exception_by_middleware(e, request)
[Fri Sep 01 04:33:49.333198 2017] [:error] [pid 23201] File "/opt/python/run/venv/lib/python3.4/site-packages/django/core/handlers/base.py", line 185, in _get_response
[Fri Sep 01 04:33:49.333201 2017] [:error] [pid 23201] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Fri Sep 01 04:33:49.333203 2017] [:error] [pid 23201] File "/opt/python/run/venv/lib/python3.4/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
[Fri Sep 01 04:33:49.333205 2017] [:error] [pid 23201] return view_func(*args, **kwargs)
[Fri Sep 01 04:33:49.333216 2017] [:error] [pid 23201] File "/opt/python/run/venv/lib/python3.4/site-packages/django/views/decorators/http.py", line 40, in inner
[Fri Sep 01 04:33:49.333218 2017] [:error] [pid 23201] return func(request, *args, **kwargs)
[Fri Sep 01 04:33:49.333220 2017] [:error] [pid 23201] File "/opt/python/current/app/webhookmb/views.py", line 81, in webhookmb
[Fri Sep 01 04:33:49.333222 2017] [:error] [pid 23201] interpreter = Interpreter.load(metadata, RasaNLUConfig("rasa_nlu/config_spacy.json"))
[Fri Sep 01 04:33:49.333224 2017] [:error] [pid 23201] File "/opt/python/current/app/rasa_nlu/model.py", line 213, in load
[Fri Sep 01 04:33:49.333226 2017] [:error] [pid 23201] component_name, model_metadata.model_dir, model_metadata, **context)
[Fri Sep 01 04:33:49.333228 2017] [:error] [pid 23201] File "/opt/python/current/app/rasa_nlu/components.py", line 310, in load_component
[Fri Sep 01 04:33:49.333229 2017] [:error] [pid 23201] model_metadata, cached_component, **context)
[Fri Sep 01 04:33:49.333231 2017] [:error] [pid 23201] File "/opt/python/current/app/rasa_nlu/registry.py", line 128, in load_component_by_name
[Fri Sep 01 04:33:49.333233 2017] [:error] [pid 23201] return component_clz.load(model_dir, metadata, cached_component, **kwargs)
[Fri Sep 01 04:33:49.333235 2017] [:error] [pid 23201] File "/opt/python/current/app/rasa_nlu/utils/spacy_utils.py", line 99, in load
[Fri Sep 01 04:33:49.333237 2017] [:error] [pid 23201] cls.ensure_proper_language_model(nlp)
[Fri Sep 01 04:33:49.333239 2017] [:error] [pid 23201] File "/opt/python/current/app/rasa_nlu/utils/spacy_utils.py", line 113, in ensure_proper_language_model
[Fri Sep 01 04:33:49.333240 2017] [:error] [pid 23201] "Make sure you have downloaded the correct model (https://spacy.io/docs/usage/).")
[Fri Sep 01 04:33:49.333244 2017] [:error] [pid 23201] Exception: Failed to load spacy language model for lang 'en'. Make sure you have downloaded the correct model (https://spacy.io/docs/usage/).