1 Star 6 Fork 1

Gitee 极速下载/ChatGLM-cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/li-plus/chatglm.cpp
克隆/下载
Dockerfile 1.73 KB
一键复制 编辑 原始数据 按行查看 历史
ARG BASE_IMAGE=ubuntu:20.04
FROM ${BASE_IMAGE} AS build
ARG CMAKE_ARGS="-DGGML_CUDA=OFF"
WORKDIR /chatglm.cpp
# apt
RUN \
sed -e "s/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g" \
-e "s/security.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g" -i /etc/apt/sources.list && \
apt update && \
DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends \
gcc g++ make python3-dev python3-pip python3-venv && \
rm -rf /var/lib/apt/lists/*
# pip
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 build cmake
ARG PATH=${PATH}:/usr/local/bin
ADD . .
# build cpp binary
RUN \
cmake -B build ${CMAKE_ARGS} && \
cmake --build build -j --config Release
# build python binding
RUN \
CMAKE_ARGS=${CMAKE_ARGS} python3 -m build --wheel
FROM ${BASE_IMAGE}
WORKDIR /chatglm.cpp
RUN \
sed -e "s/archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g" \
-e "s/security.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g" -i /etc/apt/sources.list && \
apt update && \
DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends \
python3 python3-pip && \
rm -rf /var/lib/apt/lists/*
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/mirrors/ChatGLM-cpp.git
git@gitee.com:mirrors/ChatGLM-cpp.git
mirrors
ChatGLM-cpp
ChatGLM-cpp
main

搜索帮助