Hi all
I would like to have 1 instance of Rasa NLU server (through Docker) to handle multiple projects.
Here is my dir:
.
├── components
│ ├── __init__.py
│ ├── __pycache__
│ │ └── __init__.cpython-36.pyc
│ └── stanford
│ ├── com_stanford_nlp.py
│ ├── __init__.py
│ └── __pycache__
│ ├── com_stanford_nlp.cpython-36.pyc
│ └── __init__.cpython-36.pyc
├── log
│ ├── rasa_nlu_log-20181113-100055-1.log
│ └── stanford_nlp.log
├── models
│ ├── company_a
│ │ └── en
│ │ ├── metadata.json
│ │ └── training_data.json
│ └── model_config_for_server.yml
└── projects
└── company_a
├── config
│ └── config.yml
└── data
└── data.json
The command to run Rasa NLU server using Docker:
docker \
run \
--name rasa_nlu_server \
-p 5001:5001 \
-v $(pwd)/components/:/app/components \
-v $(pwd)/models/:/app/models \
-v $(pwd)/log/:/app/log \
rasa/rasa_nlu:latest-tensorflow \
run \
python -m rasa_nlu.server \
--port 5001 \
--token 12345 \
--write log/server.log \
--response_log log \
--path models \
--pre_load all \
--config models/model_config_for_server.yml
By the way, the content of model_config_for_server.yml
is:
language: "en"
pipeline:
- name: "components.stanford.com_stanford_nlp.Stanford_NLP"
When I run:
curl 'http://my_rasa_nlu_server:5001/parse?token=12345&q=hi&project=company_a'
Here is the error I got:
WARNING rasa_nlu.project - Using default interpreter, couldn't fetch model: Unable to initialize persistor
ERROR __main__ - Unable to initialize persistor
Traceback (most recent call last):
File "/app/rasa_nlu/server.py", line 245, in parse
self.data_router.parse, data))
File "/usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py", line 250, in inContext
result = inContext.theWork()
File "/usr/local/lib/python3.6/site-packages/twisted/python/threadpool.py", line 266, in <lambda>
inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
File "/usr/local/lib/python3.6/site-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python3.6/site-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
File "/app/rasa_nlu/data_router.py", line 271, in parse
model)
File "/app/rasa_nlu/project.py", line 261, in parse
interpreter = self._interpreter_for_model(model_name)
File "/app/rasa_nlu/project.py", line 366, in _interpreter_for_model
metadata = self._read_model_metadata(model_name, model_dir)
File "/app/rasa_nlu/project.py", line 383, in _read_model_metadata
self._load_model_from_cloud(model_name, path)
File "/app/rasa_nlu/project.py", line 422, in _load_model_from_cloud
raise RuntimeError("Unable to initialize persistor")
RuntimeError: Unable to initialize persistor
Can anyone please tell me how to fix it?
Thank you very much in advance for all your help.