Notter7 commited on
Commit
ddea3f6
·
verified ·
1 Parent(s): 818dd70

Pin Gradio FastAPI Starlette compatibility

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -26
Dockerfile CHANGED
@@ -1,5 +1,6 @@
1
  FROM continuumio/miniconda3:24.7.1-0
2
 
 
3
  ENV DEBIAN_FRONTEND=noninteractive \
4
  PYTHONUNBUFFERED=1 \
5
  PYTHONFAULTHANDLER=1 \
@@ -11,8 +12,10 @@ ENV DEBIAN_FRONTEND=noninteractive \
11
  GRADIO_SERVER_PORT=7860 \
12
  TERM=xterm
13
 
 
14
  SHELL ["/bin/bash", "-lc"]
15
 
 
16
  RUN apt-get update && apt-get install -y --no-install-recommends \
17
  git \
18
  git-lfs \
@@ -25,14 +28,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
25
  ca-certificates \
26
  && rm -rf /var/lib/apt/lists/*
27
 
 
28
  WORKDIR /app
29
  RUN git clone --depth 1 https://github.com/RVC-Boss/GPT-SoVITS.git .
30
 
 
31
  # Hugging Face Docker Spaces route traffic to port 7860.
32
  # The Russian model card requires vocab size 753 and Russian base checkpoints.
33
  RUN python - <<'PY'
34
  from pathlib import Path
35
 
 
36
  replacements = {
37
  'webui_port_main = 9874': 'webui_port_main = 7860',
38
  's1v3.ckpt': 's1v3-ru.ckpt',
@@ -49,11 +55,16 @@ for path in [Path('config.py'), *Path('GPT_SoVITS/configs').glob('*.yaml')]:
49
  path.write_text(text)
50
  PY
51
 
 
52
  RUN conda create -y -n GPTSoVits python=3.10 && conda clean -afy
53
  RUN source /opt/conda/etc/profile.d/conda.sh && \
54
  conda activate GPTSoVits && \
55
  bash install.sh --device CPU --source HF && \
56
- pip install --no-cache-dir epitran
 
 
 
 
57
 
58
  # Russian GPT-SoVITS weights from https://huggingface.co/fuckSelf/GPT-SoVITS-Russian
59
  RUN mkdir -p GPT_SoVITS/pretrained_models/v2Pro GPT_weights_v2ProPlus SoVITS_weights_v2ProPlus && \
@@ -66,6 +77,7 @@ RUN mkdir -p GPT_SoVITS/pretrained_models/v2Pro GPT_weights_v2ProPlus SoVITS_wei
66
  curl -L --retry 5 -o SoVITS_weights_v2ProPlus/ru-base_e10_s123570.pth \
67
  https://huggingface.co/fuckSelf/GPT-SoVITS-Russian/resolve/main/ru-base_e10_s123570.pth
68
 
 
69
  RUN cat > /app/start-space.sh <<'SH'
70
  #!/usr/bin/env bash
71
  set -euxo pipefail
@@ -73,28 +85,3 @@ source /opt/conda/etc/profile.d/conda.sh
73
  conda activate GPTSoVits
74
  cd /app
75
 
76
- echo "=== GPT-SoVITS Space startup ==="
77
- python - <<'PY'
78
- from pathlib import Path
79
- checks = [
80
- 'config.py',
81
- 'GPT_SoVITS/pretrained_models/s1v3-ru.ckpt',
82
- 'GPT_SoVITS/pretrained_models/v2Pro/s2Gv2ProPlus-rus.pth',
83
- 'GPT_weights_v2ProPlus/ru-base-e20.ckpt',
84
- 'SoVITS_weights_v2ProPlus/ru-base_e10_s123570.pth',
85
- ]
86
- for item in checks:
87
- path = Path(item)
88
- print(f'{item}: exists={path.exists()} size={path.stat().st_size if path.exists() else 0}', flush=True)
89
- for line in Path('config.py').read_text().splitlines():
90
- if 'webui_port_main' in line or 's1v3' in line or 's2Gv2ProPlus' in line:
91
- print(line, flush=True)
92
- PY
93
-
94
- echo "=== Launching webui.py on port ${GRADIO_SERVER_PORT} ==="
95
- exec python -u webui.py
96
- SH
97
- RUN chmod +x /app/start-space.sh
98
-
99
- EXPOSE 7860
100
- CMD ["/app/start-space.sh"]
 
1
  FROM continuumio/miniconda3:24.7.1-0
2
 
3
+
4
  ENV DEBIAN_FRONTEND=noninteractive \
5
  PYTHONUNBUFFERED=1 \
6
  PYTHONFAULTHANDLER=1 \
 
12
  GRADIO_SERVER_PORT=7860 \
13
  TERM=xterm
14
 
15
+
16
  SHELL ["/bin/bash", "-lc"]
17
 
18
+
19
  RUN apt-get update && apt-get install -y --no-install-recommends \
20
  git \
21
  git-lfs \
 
28
  ca-certificates \
29
  && rm -rf /var/lib/apt/lists/*
30
 
31
+
32
  WORKDIR /app
33
  RUN git clone --depth 1 https://github.com/RVC-Boss/GPT-SoVITS.git .
34
 
35
+
36
  # Hugging Face Docker Spaces route traffic to port 7860.
37
  # The Russian model card requires vocab size 753 and Russian base checkpoints.
38
  RUN python - <<'PY'
39
  from pathlib import Path
40
 
41
+
42
  replacements = {
43
  'webui_port_main = 9874': 'webui_port_main = 7860',
44
  's1v3.ckpt': 's1v3-ru.ckpt',
 
55
  path.write_text(text)
56
  PY
57
 
58
+
59
  RUN conda create -y -n GPTSoVits python=3.10 && conda clean -afy
60
  RUN source /opt/conda/etc/profile.d/conda.sh && \
61
  conda activate GPTSoVits && \
62
  bash install.sh --device CPU --source HF && \
63
+ pip install --no-cache-dir epitran \
64
+ "fastapi[standard]==0.115.2" \
65
+ "starlette==0.40.0" \
66
+ "gradio==4.44.1"
67
+
68
 
69
  # Russian GPT-SoVITS weights from https://huggingface.co/fuckSelf/GPT-SoVITS-Russian
70
  RUN mkdir -p GPT_SoVITS/pretrained_models/v2Pro GPT_weights_v2ProPlus SoVITS_weights_v2ProPlus && \
 
77
  curl -L --retry 5 -o SoVITS_weights_v2ProPlus/ru-base_e10_s123570.pth \
78
  https://huggingface.co/fuckSelf/GPT-SoVITS-Russian/resolve/main/ru-base_e10_s123570.pth
79
 
80
+
81
  RUN cat > /app/start-space.sh <<'SH'
82
  #!/usr/bin/env bash
83
  set -euxo pipefail
 
85
  conda activate GPTSoVits
86
  cd /app
87