Hi everyone,
I’m new with docker, i’m trying to deploy my model on Rasa-X using docker-compose, and i followed the Quick Tutorial by Rasa. After completed all the steps, i can see the model, stories and nlu, but the assistant doesn’t answer to utterances, neither extract the correct user intent.
After a debugging session, i saw that the problem comes from the rasa container: even if i used the rasa/rasa 2.7.2-full image, if i write docker-compose logs rasa-worker, i get this error:
rasa.core.agent - Failed to update model. The previous model will stay loaded instead.
Traceback (most recent call last):
| File "/opt/venv/lib/python3.8/site-packages/rasa/nlu/utils/spacy_utils.py", line 50, in load_model
| return spacy.load(spacy_model_name, disable=["parser"])
| File "/opt/venv/lib/python3.8/site-packages/spacy/__init__.py", line 50, in load
| return util.load_model(
| File "/opt/venv/lib/python3.8/site-packages/spacy/util.py", line 331, in load_model
| raise IOError(Errors.E050.format(name=name))
| OSError: [E050] Can't find model 'en_core_web_lg'. It doesn't seem to be a Python package or a valid path to a data directory.
Oh that was clear, but how can i add it?
From the little i have studied, i thought that SpaCy was already included in the {RASA_VERSION}-full container, but clearly i’m wrong.
Can you kindly explain how to do it, or link me some guide please?
I already tried this, but doesn’t work. I think that’s because it cannot insert the spacy_lg model in the docker container. I have to do something like adding the model installation in the container image, and build it
@nik202 finally i solved this. Thank you very much for your help.
I followed these steps:
Move in /etc/rasa and create an empty file “Dockerfile”, insert the commands to install spacy with the model, for me was:
FROM rasa/rasa:2.7.2-full
# you can choose any pre-existing docker-image from rasa, even rasa-x or rasa-sdk
# set privileges
USER root
# install the model you need
RUN pip install rasa[spacy] && python -m spacy download en_core_web_lg
USER 1001
build this new image, and assign a tag to it
sudo docker build -t rasa_spacy .
open the docker-compose.yml file and substitute the new image you modified, in my case the name was: rasa_spacy:lastest, save and exit
Please confirm with me that this issue related to Rasa Open Source or Rasa X (If Rasa X please channge the topic category) and I’d recommend to you to use atleast 2.8.1 > image for rasa.
@nik202 it’s mostly related to rasa X, i change the topic category.
I use the 2.7.2 because this model will be installed on a Pepper Robot which has inside that version of rasa, not depending on me ahah