Spaces:
Sleeping
Sleeping
File size: 1,327 Bytes
2d915e6 2af3d49 4c031d8 2d915e6 5532cb9 e903c18 2af3d49 fd15357 2af3d49 4c031d8 6f1355a f89f2b3 2d915e6 4c031d8 2af3d49 242707c 2d915e6 4c031d8 9f19044 4c031d8 e903c18 5532cb9 4c031d8 2af3d49 4c031d8 2af3d49 6f1355a 2af3d49 e5f39bb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# Debian slim base, glibc compatible
FROM python:3.12-slim
# HF cache 指向可写目录
ENV HF_HOME=/tmp/.cache
ENV XDG_CACHE_HOME=/tmp/.cache
# 安装系统依赖 - 使用 libopenblas-dev 而不是 libblas3
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
git \
wget \
libgomp1 \
libstdc++6 \
curl \
libopenblas-dev \
liblapack-dev \
&& rm -rf /var/lib/apt/lists/*
# 升级 pip / setuptools / wheel
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
# 复制并安装本地 CPU-only wheel(linux_x86_64 + Python 3.12)
COPY llama_cpp_python-0.3.16-cp312-cp312-linux_x86_64.whl /tmp/
RUN pip install --no-cache-dir /tmp/llama_cpp_python-0.3.16-cp312-cp312-linux_x86_64.whl \
&& rm -f /tmp/llama_cpp_python-0.3.16-cp312-cp312-linux_x86_64.whl
# 安装 Python 依赖
RUN pip install --no-cache-dir gradio huggingface-hub
# 环境变量
ENV MODEL_DIR="/models"
ENV MODEL_FILE="Qwen3_Medical_GRPO.i1-Q4_K_M.gguf"
ENV MODEL_REPO="mradermacher/Qwen3_Medical_GRPO-i1-GGUF"
# 创建可写目录
RUN mkdir -p ${MODEL_DIR} /tmp/.cache \
&& chmod -R 0777 ${MODEL_DIR} /tmp/.cache
# 复制 app.py
COPY app.py /app/app.py
WORKDIR /app
# 暴露端口
EXPOSE 7860
# 启动
CMD ["python", "app.py"] |