zimhe commited on
Commit
d519e8c
·
verified ·
1 Parent(s): 7fd6570

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -6
Dockerfile CHANGED
@@ -1,15 +1,13 @@
1
- # HF Spaces 官方基础镜像,匹配CUDA
2
- FROM hf-mirror.com/huggingface/transformers-pytorch-gpu:latest
3
 
4
- # 1. 预装编译flash-attn必需的系统依赖
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  gcc g++ build-essential ninja-build cuda-nvcc-12-1 \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
- # 升级基础打包工具
10
  RUN pip install --upgrade pip setuptools wheel ninja
11
 
12
- # 2. 复制依赖并安装,强制源码编译flash-attn,规避wheel不兼容
13
  COPY requirements.txt /tmp/requirements.txt
14
  RUN MAX_JOBS=2 pip install \
15
  --no-cache-dir \
@@ -21,5 +19,4 @@ RUN MAX_JOBS=2 pip install \
21
  "websockets>=10.4" \
22
  spaces
23
 
24
- # HF Spaces固定启动命令,不要修改
25
  CMD ["python", "app.py"]
 
1
+ # 固定带Python3.10、CUDA12.1的镜像,不再用latest
2
+ FROM huggingface/transformers-pytorch-gpu:4.48.2-py310-cu121
3
 
4
+ # 编译flash-attn系统依赖
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  gcc g++ build-essential ninja-build cuda-nvcc-12-1 \
7
  && rm -rf /var/lib/apt/lists/*
8
 
 
9
  RUN pip install --upgrade pip setuptools wheel ninja
10
 
 
11
  COPY requirements.txt /tmp/requirements.txt
12
  RUN MAX_JOBS=2 pip install \
13
  --no-cache-dir \
 
19
  "websockets>=10.4" \
20
  spaces
21
 
 
22
  CMD ["python", "app.py"]