hankcs/HanLP

cpu docker部署安装依赖cuda环境

cpla13 opened this issue · 1 comments

cpla13 commented

cpu docker部署安装依赖cuda环境
image

Code to reproduce the issue
image

FROM python:3.8.16
WORKDIR /home/byze

COPY hanlp2 /home/byze/hanlp2
COPY static /home/byze/static
COPY model /home/byze/model
ENV HANLP_HOME=/home/byze/model
RUN mkdir work
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip --no-cache-dir install hanlp fastapi==0.94.1 uvicorn python-multipart boto3

ENTRYPOINT ["python", "-u", "./hanlp2/ner_app.py"]
CMD ["test"]

System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): centos7.9
Python version: 3.8.16
HanLP version: 2.1

  • I've completed this form and searched the web for solutions.
hankcs commented
  1. 是pytorch觉得你的系统依赖cuda,不是HanLP依赖cuda。HanLP只依赖pytorch,pytorch说它依赖什么就依赖什么,HanLP不参与决策。
  2. 你可以在装HanLP之前,先装一个CPU版的pytorch