lastmass commited on
Commit
fce4f2b
·
verified ·
1 Parent(s): a9e4d13

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -8
Dockerfile CHANGED
@@ -1,26 +1,26 @@
1
  # ------------------------------------------------------------------
2
- # HuggingFace Space Dockerfile - 使用预编译 llama-cpp-python wheel
3
  # ------------------------------------------------------------------
4
- FROM python:3.10-bullseye
5
 
6
- # 1. 安装基础工具(仅运行时,不含编译器)
7
  RUN apt-get update && apt-get install -y \
8
  wget \
9
  git \
10
  ca-certificates \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # 2. 升级 pip 以保证支持 pre-built wheel
14
  RUN pip install --upgrade pip setuptools wheel
15
 
16
- # 3. 安装 llama-cpp-python CPU 预编译 wheel
17
- RUN pip install --no-cache-dir llama-cpp-python \
18
- --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
19
 
20
  # 4. 安装其他 Python 依赖
21
  RUN pip install --no-cache-dir gradio huggingface-hub
22
 
23
- # 5. 设置模型路径
24
  ENV MODEL_REPO="mradermacher/Qwen3_Medical_GRPO-i1-GGUF"
25
  ENV MODEL_FILE="Qwen3_Medical_GRPO.i1-Q4_K_M.gguf"
26
  ENV MODEL_DIR="/models"
 
1
  # ------------------------------------------------------------------
2
+ # HuggingFace Space Dockerfile - 使用本地预编译 llama-cpp-python wheel
3
  # ------------------------------------------------------------------
4
+ FROM python:3.11-bullseye
5
 
6
+ # 1. 安装运行时依赖
7
  RUN apt-get update && apt-get install -y \
8
  wget \
9
  git \
10
  ca-certificates \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # 2. 升级 pip setuptools wheel
14
  RUN pip install --upgrade pip setuptools wheel
15
 
16
+ # 3. 复制本地 wheel 到临时目录并安装 llama-cpp-python
17
+ COPY llama_cpp_python-0.3.2-cp311-cp311-linux_x86_64.whl /tmp/
18
+ RUN pip install --no-cache-dir /tmp/llama_cpp_python-0.3.2-cp311-cp311-linux_x86_64.whl
19
 
20
  # 4. 安装其他 Python 依赖
21
  RUN pip install --no-cache-dir gradio huggingface-hub
22
 
23
+ # 5. 设置模型路径(保持你原来的配置)
24
  ENV MODEL_REPO="mradermacher/Qwen3_Medical_GRPO-i1-GGUF"
25
  ENV MODEL_FILE="Qwen3_Medical_GRPO.i1-Q4_K_M.gguf"
26
  ENV MODEL_DIR="/models"