akr*_*iti 5 python docker rasa-nlu rasa
我正在 dockerizing rasa 应用程序,这Dockerfile是
FROM python:3.7.6
RUN apt-get update && apt-get install -y --no-install-recommends build-essential curl
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY entrypoint.sh .
COPY src/ .
EXPOSE 5005
ENTRYPOINT ["/app/entrypoint.sh"]
Run Code Online (Sandbox Code Playgroud)
的内容entrypoint.sh是
#!/bin/sh
exec "$@"
Run Code Online (Sandbox Code Playgroud)
并且requirements.txt文件有
rasa==1.10.14
Run Code Online (Sandbox Code Playgroud)
我使用rasa initdocker 内部src目录之外的命令启动了一个 rasa 应用程序,并将所有内容复制到 docker 中。
现在当我运行 rasa 时使用
docker build -t image .
docker run -it image rasa run
Run Code Online (Sandbox Code Playgroud)
它给出了以下错误
2020-10-15 19:38:00 INFO root - Starting Rasa server on http://localhost:5005
2020-10-15 19:38:02 ERROR rasa.core.agent - Could not load model due to Failed to find module 'rasa.nlu.classifiers.fallback_classifier'.
No module named 'rasa.nlu.classifiers.fallback_classifier'.
Experienced exception while trying to serve
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/rasa/nlu/registry.py", line 173, in get_component_class
return class_from_module_path(component_name)
File "/usr/local/lib/python3.7/site-packages/rasa/utils/common.py", line 210, in class_from_module_path
m = importlib.import_module(module_name)
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'rasa.nlu.classifiers.fallback_classifier'
...
Run Code Online (Sandbox Code Playgroud)
在 docker 外运行 rasa 工作正常。
| 归档时间: |
|
| 查看次数: |
481 次 |
| 最近记录: |