izuemon commited on
Commit
229ea4d
·
verified ·
1 Parent(s): 54e6e0a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -16
Dockerfile CHANGED
@@ -1,9 +1,8 @@
 
1
  FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
-
5
- # system packages
6
- RUN apt-get update && apt-get install -y \
7
  git \
8
  git-lfs \
9
  ffmpeg \
@@ -16,10 +15,9 @@ RUN apt-get update && apt-get install -y \
16
  && rm -rf /var/lib/apt/lists/* \
17
  && git lfs install
18
 
19
- # upgrade pip
20
- RUN pip install --no-cache-dir -U pip
21
 
22
- # python utilities
23
  RUN pip install --no-cache-dir \
24
  datasets \
25
  "huggingface-hub>=0.30" \
@@ -31,16 +29,10 @@ RUN pip install --no-cache-dir \
31
  spaces \
32
  "gradio[oauth,mcp]==6.9.0"
33
 
34
- # torch を先に入れる
35
- RUN pip install --no-cache-dir torch==2.3.1
36
-
37
- # requirements
38
- COPY requirements.txt .
39
 
40
- # flash-attn を含む残り
41
- RUN pip install --no-cache-dir -r requirements.txt
42
-
43
- # source
44
  COPY . .
45
-
46
  CMD ["python", "app.py"]
 
1
+ # Dockerfile.cpu
2
  FROM python:3.10-slim
3
 
4
  WORKDIR /app
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
 
 
6
  git \
7
  git-lfs \
8
  ffmpeg \
 
15
  && rm -rf /var/lib/apt/lists/* \
16
  && git lfs install
17
 
18
+ RUN pip install --no-cache-dir -U pip setuptools wheel
 
19
 
20
+ # HF 関連等
21
  RUN pip install --no-cache-dir \
22
  datasets \
23
  "huggingface-hub>=0.30" \
 
29
  spaces \
30
  "gradio[oauth,mcp]==6.9.0"
31
 
32
+ COPY requirements.txt /tmp/requirements.txt
33
+ # requirements.txt flash_attn が入っていたら除外しておく
34
+ RUN sed -i '/flash_attn/d' /tmp/requirements.txt && \
35
+ pip install --no-cache-dir -r /tmp/requirements.txt
 
36
 
 
 
 
 
37
  COPY . .
 
38
  CMD ["python", "app.py"]