li-plus / chatglm.cpp

C++ implementation of ChatGLM-6B & ChatGLM2-6B & ChatGLM3 & GLM4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix: Dockerfile Building Locally

wangzhe258369 opened this issue · comments

chatglm.cpp/Dockerfile

Lines 49 to 58 in 3286db5

COPY --from=build /chatglm.cpp/build/bin/main /chatglm.cpp/build/bin/main
COPY --from=build /chatglm.cpp/dist/ /chatglm.cpp/dist/
ADD examples examples
RUN \
python3 -m pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple pip && \
python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
python3 -m pip install --no-cache-dir -f dist 'chatglm-cpp[api]' && \
rm -rf dist

需要修改如下:

  1. 添加/chatglm.cpp/build/lib,否则对于For CUDA supportmain程序,会缺少libggml.so
  2. pip install添加--pre,否则pip install -f dist 'chatglm-cpp[api]'会忽略dist目录下的新构建的Python包,而是下载编译 pypi 里的正式版本
COPY --from=build /chatglm.cpp/build/bin/main /chatglm.cpp/build/bin/main
COPY --from=build /chatglm.cpp/build/lib /chatglm.cpp/build/lib
COPY --from=build /chatglm.cpp/dist/ /chatglm.cpp/dist/

ADD examples examples

RUN \
    python3 -m pip install --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple pip && \
    python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
    python3 -m pip install --no-cache-dir --pre -f dist 'chatglm-cpp[api]' && \
    rm -rf dist