huanx commited on
Commit
058fb28
·
verified ·
1 Parent(s): 531963b

Fix: COPY model files into image instead of downloading at runtime

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -4
Dockerfile CHANGED
@@ -3,7 +3,7 @@ FROM python:3.10-slim
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV PIP_NO_CACHE_DIR=1
5
 
6
- # System deps: build-essential for compilation, mecab for Japanese TTS
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
  build-essential cmake \
9
  ffmpeg libsndfile1 libgomp1 \
@@ -13,7 +13,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
13
 
14
  WORKDIR /app
15
 
16
- # CPU PyTorch (install first to avoid CUDA pulls)
17
  RUN pip install --no-cache-dir torch==2.5.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cpu
18
 
19
  # Download GPT-SoVITS source
@@ -28,7 +28,7 @@ RUN cp requirements.txt /tmp/requirements.txt.bak \
28
  && sed -i 's/onnxruntime-gpu/onnxruntime/; /python_mecab_ko/d' requirements.txt \
29
  && pip install --no-cache-dir -r requirements.txt || true
30
 
31
- # Ensure core packages (ignore failures on optional ones)
32
  RUN pip install --no-cache-dir \
33
  fastapi uvicorn python-multipart gradio \
34
  numpy scipy librosa soundfile pydub ffmpeg-python \
@@ -44,8 +44,11 @@ COPY start.sh /app/start.sh
44
  COPY ui.py /app/ui.py
45
  RUN chmod +x /app/start.sh
46
 
 
47
  RUN mkdir -p /data/models /data/audio /tmp/uploads
 
 
 
48
 
49
  EXPOSE 7860
50
-
51
  CMD ["/app/start.sh"]
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV PIP_NO_CACHE_DIR=1
5
 
6
+ # System deps
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
  build-essential cmake \
9
  ffmpeg libsndfile1 libgomp1 \
 
13
 
14
  WORKDIR /app
15
 
16
+ # CPU PyTorch
17
  RUN pip install --no-cache-dir torch==2.5.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cpu
18
 
19
  # Download GPT-SoVITS source
 
28
  && sed -i 's/onnxruntime-gpu/onnxruntime/; /python_mecab_ko/d' requirements.txt \
29
  && pip install --no-cache-dir -r requirements.txt || true
30
 
31
+ # Ensure core packages
32
  RUN pip install --no-cache-dir \
33
  fastapi uvicorn python-multipart gradio \
34
  numpy scipy librosa soundfile pydub ffmpeg-python \
 
44
  COPY ui.py /app/ui.py
45
  RUN chmod +x /app/start.sh
46
 
47
+ # Copy character models directly into image (bake in at build time)
48
  RUN mkdir -p /data/models /data/audio /tmp/uploads
49
+ COPY aimisi-e16.ckpt /data/models/aimisi-e16.ckpt
50
+ COPY aimisi_e10_s180.pth /data/models/aimisi_e10_s180.pth
51
+ COPY zh_vo_MAIN_YHX_2_12.wav /data/models/zh_vo_MAIN_YHX_2_12.wav
52
 
53
  EXPOSE 7860
 
54
  CMD ["/app/start.sh"]