marsparamecium commited on
Commit
b664b2a
·
verified ·
1 Parent(s): 6bc3e05

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -5
Dockerfile CHANGED
@@ -1,24 +1,30 @@
1
  FROM python:3.10-slim
2
 
 
3
  RUN apt-get update && apt-get install -y \
4
  build-essential \
5
  cmake \
6
  git \
7
  git-lfs \
8
  curl \
 
9
  && rm -rf /var/lib/apt/lists/* \
10
  && git lfs install
11
 
12
  WORKDIR /app
13
 
14
- # 升级pip确保兼容性
15
  RUN pip install --upgrade pip setuptools wheel
16
 
17
- # 安装依赖,强制 llama-cpp-python 使用预编译wheel
 
 
 
 
 
 
 
18
  RUN pip install --no-cache-dir \
19
- --extra-index-url https://abetlen.github.io/llama-cpp-python/wheels/cpu \
20
- --only-binary llama-cpp-python \
21
- llama-cpp-python==0.4.5 \
22
  gradio==5.0.0 \
23
  huggingface_hub \
24
  'numpy<2.0' \
 
1
  FROM python:3.10-slim
2
 
3
+ # 安装必要系统工具(含下载工具)
4
  RUN apt-get update && apt-get install -y \
5
  build-essential \
6
  cmake \
7
  git \
8
  git-lfs \
9
  curl \
10
+ wget \
11
  && rm -rf /var/lib/apt/lists/* \
12
  && git lfs install
13
 
14
  WORKDIR /app
15
 
16
+ # 升级pip工具链
17
  RUN pip install --upgrade pip setuptools wheel
18
 
19
+ # 直接下载llama-cpp-python预编译wheel(CPU版,manylinux,Python 3.10,x86_64)
20
+ # 使用稳定版本0.5.0(若应用强依赖旧版,可修改版本号,但需确认GitHub Release中存在对应wheel)
21
+ ENV LLAMA_CPP_VERSION=0.5.0
22
+ RUN wget -O /tmp/llama_cpp_python-${LLAMA_CPP_VERSION}-cp310-cp310-manylinux_2_31_x86_64.whl \
23
+ https://github.com/abetlen/llama-cpp-python/releases/download/v${LLAMA_CPP_VERSION}/llama_cpp_python-${LLAMA_CPP_VERSION}-cp310-cp310-manylinux_2_31_x86_64.whl && \
24
+ pip install /tmp/llama_cpp_python-${LLAMA_CPP_VERSION}-cp310-cp310-manylinux_2_31_x86_64.whl
25
+
26
+ # 安装其余依赖(无特殊限制)
27
  RUN pip install --no-cache-dir \
 
 
 
28
  gradio==5.0.0 \
29
  huggingface_hub \
30
  'numpy<2.0' \