jiang1002 commited on
Commit
d08a5ca
·
verified ·
1 Parent(s): 561bc7d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -6
Dockerfile CHANGED
@@ -1,21 +1,22 @@
1
  FROM python:3.9-slim
2
 
 
 
 
3
  WORKDIR /app
4
 
5
- # 1. 基础依赖,不指定镜像源,让它自己找最快
6
  RUN pip install --no-cache-dir --upgrade pip && \
7
  pip install --no-cache-dir \
8
- gradio \
9
  transformers==4.33.2 \
10
  sentencepiece \
11
  cpm_kernels \
12
  icetk \
13
  fastapi \
14
  uvicorn \
15
- requests
16
-
17
- # 2. 专门安装 CPU 版本的 PyTorch (这是解决你最后一张图报错的关键)
18
- RUN pip install --no-cache-dir torch==2.0.1 --index-url https://download.pytorch.org/whl/cpu
19
 
20
  COPY . .
21
 
 
1
  FROM python:3.9-slim
2
 
3
+ # 设置环境变量,确保 Python 能够实时输出日志
4
+ ENV PYTHONUNBUFFERED=1
5
+
6
  WORKDIR /app
7
 
8
+ # 先安装最基础依赖,再装 ChatGLM 必须特定库
9
  RUN pip install --no-cache-dir --upgrade pip && \
10
  pip install --no-cache-dir \
11
+ gradio==4.19.2 \
12
  transformers==4.33.2 \
13
  sentencepiece \
14
  cpm_kernels \
15
  icetk \
16
  fastapi \
17
  uvicorn \
18
+ requests \
19
+ torch==2.0.1 --index-url https://download.pytorch.org/whl/cpu
 
 
20
 
21
  COPY . .
22