duyan2803 commited on
Commit
e2a9288
·
verified ·
1 Parent(s): 02daa9f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -10
Dockerfile CHANGED
@@ -1,7 +1,5 @@
1
- # Dùng base image mặc định của Space
2
  FROM python:3.10
3
 
4
- # Cài đặt các gói hệ thống cần thiết
5
  RUN apt-get update && apt-get install -y \
6
  git \
7
  git-lfs \
@@ -13,22 +11,18 @@ RUN apt-get update && apt-get install -y \
13
  libgl1-mesa-glx \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
- # Thiết lập thư mục làm việc
17
  WORKDIR /home/user/app
18
 
19
- # Cài đặt pip mới nhất
20
  RUN pip install --no-cache-dir pip -U
21
 
22
- # Force reinstall torch và transformers để tránh xung đột
23
- RUN pip install --no-cache-dir --force-reinstall torch==2.1.0
24
- RUN pip install --no-cache-dir --force-reinstall transformers>=4.32.0
25
 
26
- # Cài các gói còn lại từ requirements.txt
27
  COPY requirements.txt .
28
  RUN pip install --no-cache-dir -r requirements.txt
29
 
30
- # Copy app.py
31
  COPY app.py .
32
 
33
- # Chạy ứng dụng
34
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.10
2
 
 
3
  RUN apt-get update && apt-get install -y \
4
  git \
5
  git-lfs \
 
11
  libgl1-mesa-glx \
12
  && rm -rf /var/lib/apt/lists/*
13
 
 
14
  WORKDIR /home/user/app
15
 
 
16
  RUN pip install --no-cache-dir pip -U
17
 
18
+ # Cài torch và transformers trước với force-reinstall
19
+ RUN pip install --no-cache-dir --force-reinstall torch==2.2.0
20
+ RUN pip install --no-cache-dir --force-reinstall transformers==4.38.2
21
 
22
+ # Cài các gói còn lại
23
  COPY requirements.txt .
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
 
26
  COPY app.py .
27
 
 
28
  CMD ["python", "app.py"]