vipsphi commited on
Commit
321ff82
·
verified ·
1 Parent(s): 565de57

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -20
Dockerfile CHANGED
@@ -1,31 +1,27 @@
1
- FROM python:3.10-slim
2
 
3
- # Cài đặt các thư viện hệ thống cần thiết (Bổ sung portaudio để fix pyaudio nếu cần)
4
  RUN apt-get update && apt-get install -y \
5
- ffmpeg git cmake build-essential \
6
- portaudio19-dev libasound2-dev libsndfile1-dev \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
  WORKDIR /app
10
 
11
- # Tải mã nguồn
12
- RUN git clone --depth 1 https://github.com/fishaudio/fish-speech.git .
13
 
14
- # Cài đặt PyTorch CPU
15
- RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
 
16
 
17
- # Cài đặt các gói phụ thuộc, bỏ qua PyAudio nếu nó gây lỗi build
18
- # Lệnh này sẽ cài các thư viện cần thiết trước
19
- RUN pip install --no-cache-dir setuptools wheel
20
- RUN pip install --no-cache-dir -e . || (sed -i '/pyaudio/d' requirements.txt && pip install --no-cache-dir -e .)
21
 
22
- # Thiết lập cổng cho Hugging Face
23
- ENV GRADIO_SERVER_NAME="0.0.0.0"
24
- ENV GRADIO_SERVER_PORT=7860
25
- ENV PYTHONUNBUFFERED=1
26
-
27
- # Mở cổng giao diện
28
  EXPOSE 7860
29
 
30
- # Chạy WebUIAPI
31
- CMD python -m tools.api_server --device cpu --port 7861 & python -m tools.webui --device cpu
 
 
1
+ FROM python:3.9-slim
2
 
3
+ # Cài đặt thư viện hệ thống
4
  RUN apt-get update && apt-get install -y \
5
+ ffmpeg git git-lfs cmake build-essential \
6
+ && git lfs install \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
  WORKDIR /app
10
 
11
+ # 1. Tải mã nguồn GPT-SoVITS
12
+ RUN git clone https://github.com/RVC-Boss/GPT-SoVITS.git .
13
 
14
+ # 2. Xóa tải bộ trọng số model đầy đủ
15
+ RUN rm -rf /app/GPT_SoVITS/pretrained_models && \
16
+ git clone https://huggingface.co/lj1995/GPT-SoVITS /app/GPT_SoVITS/pretrained_models
17
 
18
+ # 3. Cài đặt các thư viện Python
19
+ RUN pip install --no-cache-dir -r requirements.txt
20
+ RUN pip install --no-cache-dir torch-complex fastapi uvicorn
 
21
 
22
+ # Hugging Face yêu cầu cổng 7860
 
 
 
 
 
23
  EXPOSE 7860
24
 
25
+ # Lệnh khởi chạy: Chạy API ở nền sau WebUI ở nền trước
26
+ # WebUI sẽ hiển thị tại tab "App", API sẽ sẵn sàng cho các công cụ của bạn
27
+ CMD python api_v2.py -a 0.0.0.0 -p 9880 & python webui.py en