vipsphi commited on
Commit
03ae61c
·
verified ·
1 Parent(s): a156e43

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -11
Dockerfile CHANGED
@@ -1,4 +1,3 @@
1
- # Sử dụng Python 3.11 để tương thích tốt nhất
2
  FROM python:3.11-slim
3
 
4
  # 1. Cài đặt thư viện hệ thống
@@ -8,21 +7,23 @@ RUN apt-get update && apt-get install -y \
8
 
9
  WORKDIR /app
10
 
11
- # 2. Tải code từ GitHub
12
  RUN git clone https://github.com/pnnbao97/VieNeu-TTS.git .
13
 
14
- # 3. DỌN DẸP requirements.txt: Xóa các yêu cầu phiên bản Torch cụ thể để tránh lỗi CUDA/CPU
15
- # Lệnh này xóa các dòng bắt đầu bằng torch, torchvision, torchaudio trong file gốc
16
- RUN sed -i '/torch/d' requirements.txt && \
17
- sed -i '/numpy/d' requirements.txt
 
 
18
 
19
- # 4. CÀI ĐẶT THƯ VIỆN THEO THỨ TỰ CHUẨN
20
  RUN pip install --no-cache-dir --upgrade pip
21
- # Cài đặt Torch CPU trước
22
  RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
23
- # Cài đặt numpy bản ổn định cho Python 3.11
24
- RUN pip install --no-cache-dir "numpy<2.1.0"
25
- # Cài đặt các thư viện còn lại
26
  RUN pip install --no-cache-dir -r requirements.txt
27
  RUN pip install --no-cache-dir neucodec>=0.0.4 phonemizer>=3.3.0
28
 
 
 
1
  FROM python:3.11-slim
2
 
3
  # 1. Cài đặt thư viện hệ thống
 
7
 
8
  WORKDIR /app
9
 
10
+ # 2. TẢI NGUỒN LÊN TRƯỚC (Clone từ GitHub)
11
  RUN git clone https://github.com/pnnbao97/VieNeu-TTS.git .
12
 
13
+ # 3. DỌN DẸP TRIỆT ĐỂ requirements.txt
14
+ # Xóa triton-windows (vì đây Linux), xóa torch/numpy để cài bản riêng
15
+ RUN sed -i '/triton-windows/d' requirements.txt && \
16
+ sed -i '/torch/d' requirements.txt && \
17
+ sed -i '/numpy/d' requirements.txt && \
18
+ sed -i '/networkx/d' requirements.txt
19
 
20
+ # 4. CÀI ĐẶT TỪNG BƯỚC AN TOÀN
21
  RUN pip install --no-cache-dir --upgrade pip
22
+ # Cài Torch CPU
23
  RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
24
+ # Cài các bản thư viện tương thích Python 3.11
25
+ RUN pip install --no-cache-dir "numpy<2.1.0" "networkx<3.3"
26
+ # Cài các gói còn lại trong requirements.txt (sau khi đã dọn dẹp lỗi)
27
  RUN pip install --no-cache-dir -r requirements.txt
28
  RUN pip install --no-cache-dir neucodec>=0.0.4 phonemizer>=3.3.0
29