Spaces:
Sleeping
Sleeping
Add Russian GPT-SoVITS weights
Browse files- Dockerfile +29 -5
Dockerfile
CHANGED
|
@@ -26,18 +26,42 @@ WORKDIR /app
|
|
| 26 |
RUN git clone --depth 1 https://github.com/RVC-Boss/GPT-SoVITS.git .
|
| 27 |
|
| 28 |
# Hugging Face Docker Spaces route traffic to port 7860.
|
|
|
|
| 29 |
RUN python - <<'PY'
|
| 30 |
from pathlib import Path
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
PY
|
| 36 |
|
| 37 |
RUN conda create -y -n GPTSoVits python=3.10 && conda clean -afy
|
| 38 |
RUN source /opt/conda/etc/profile.d/conda.sh && \
|
| 39 |
conda activate GPTSoVits && \
|
| 40 |
-
bash install.sh --device CPU --source HF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
EXPOSE 7860
|
| 43 |
CMD ["bash", "-lc", "source /opt/conda/etc/profile.d/conda.sh && conda activate GPTSoVits && python webui.py"]
|
|
|
|
| 26 |
RUN git clone --depth 1 https://github.com/RVC-Boss/GPT-SoVITS.git .
|
| 27 |
|
| 28 |
# Hugging Face Docker Spaces route traffic to port 7860.
|
| 29 |
+
# The Russian model card requires vocab size 753 and Russian base checkpoints.
|
| 30 |
RUN python - <<'PY'
|
| 31 |
from pathlib import Path
|
| 32 |
+
|
| 33 |
+
replacements = {
|
| 34 |
+
'webui_port_main = 9874': 'webui_port_main = 7860',
|
| 35 |
+
's1v3.ckpt': 's1v3-ru.ckpt',
|
| 36 |
+
's2Gv2ProPlus.pth': 's2Gv2ProPlus-rus.pth',
|
| 37 |
+
'phoneme_vocab_size: 732': 'phoneme_vocab_size: 753',
|
| 38 |
+
'phoneme_vocab_size = 732': 'phoneme_vocab_size = 753',
|
| 39 |
+
}
|
| 40 |
+
for path in [Path('config.py'), *Path('GPT_SoVITS/configs').glob('*.yaml')]:
|
| 41 |
+
if not path.exists():
|
| 42 |
+
continue
|
| 43 |
+
text = path.read_text()
|
| 44 |
+
for old, new in replacements.items():
|
| 45 |
+
text = text.replace(old, new)
|
| 46 |
+
path.write_text(text)
|
| 47 |
PY
|
| 48 |
|
| 49 |
RUN conda create -y -n GPTSoVits python=3.10 && conda clean -afy
|
| 50 |
RUN source /opt/conda/etc/profile.d/conda.sh && \
|
| 51 |
conda activate GPTSoVits && \
|
| 52 |
+
bash install.sh --device CPU --source HF && \
|
| 53 |
+
pip install --no-cache-dir epitran
|
| 54 |
+
|
| 55 |
+
# Russian GPT-SoVITS weights from https://huggingface.co/fuckSelf/GPT-SoVITS-Russian
|
| 56 |
+
RUN mkdir -p GPT_SoVITS/pretrained_models/v2Pro GPT_weights_v2ProPlus SoVITS_weights_v2ProPlus && \
|
| 57 |
+
curl -L --retry 5 -o GPT_SoVITS/pretrained_models/s1v3-ru.ckpt \
|
| 58 |
+
https://huggingface.co/fuckSelf/GPT-SoVITS-Russian/resolve/main/s1v3-ru.ckpt && \
|
| 59 |
+
curl -L --retry 5 -o GPT_SoVITS/pretrained_models/v2Pro/s2Gv2ProPlus-rus.pth \
|
| 60 |
+
https://huggingface.co/fuckSelf/GPT-SoVITS-Russian/resolve/main/s2Gv2ProPlus-rus.pth && \
|
| 61 |
+
curl -L --retry 5 -o GPT_weights_v2ProPlus/ru-base-e20.ckpt \
|
| 62 |
+
https://huggingface.co/fuckSelf/GPT-SoVITS-Russian/resolve/main/ru-base-e20.ckpt && \
|
| 63 |
+
curl -L --retry 5 -o SoVITS_weights_v2ProPlus/ru-base_e10_s123570.pth \
|
| 64 |
+
https://huggingface.co/fuckSelf/GPT-SoVITS-Russian/resolve/main/ru-base_e10_s123570.pth
|
| 65 |
|
| 66 |
EXPOSE 7860
|
| 67 |
CMD ["bash", "-lc", "source /opt/conda/etc/profile.d/conda.sh && conda activate GPTSoVits && python webui.py"]
|