Files
AI-Profile-Router/experiments/xvc-voice-conversion/Dockerfile
T

57 lines
2.2 KiB
Docker

FROM nvidia/cuda:12.8.1-cudnn-runtime-ubuntu24.04
ARG XVC_COMMIT=49df8c591eafc48b096e466d96f9839f9c0dd739
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates curl ffmpeg git libsndfile1 python3 python3-pip python3-venv \
&& rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/Jerrister/X-VC.git /opt/xvc \
&& cd /opt/xvc \
&& git checkout "${XVC_COMMIT}" \
&& rm -rf .git
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:${PATH}"
# RTX 5080: use a CUDA 12.8 PyTorch build instead of X-VC's older training pin.
RUN python -m pip install --no-cache-dir --upgrade pip \
&& python -m pip install --no-cache-dir \
--index-url https://download.pytorch.org/whl/cu128 \
"torch==2.8.0" "torchaudio==2.8.0" \
&& python -m pip install --no-cache-dir \
"gradio>=5.49,<6" "huggingface_hub>=0.34,<2" \
"transformers>=4.44,<5" "hydra-core>=1.3,<2" "omegaconf>=2.3,<3" \
"x-transformers>=1.40,<3" "einops>=0.8,<1" "einx>=0.3,<1" \
"numpy>=1.26,<3" "scipy>=1.13,<2" "soundfile>=0.12,<1" \
"soxr>=0.5,<1" "tqdm>=4.66,<5" "wandb>=0.18,<1"
RUN python -m pip install --no-cache-dir "descript-audiotools==0.7.2"
# Resemble Enhance declares old training-time pins for PyTorch, Gradio and
# DeepSpeed. Install only its inference code plus the small modules imported by
# that path, then remove the two unnecessary training imports. X-VC keeps the
# CUDA 12.8 / PyTorch 2.8 runtime required by the RTX 5080.
RUN python -m pip install --no-cache-dir --no-deps "resemble-enhance==0.0.1" \
&& python -m pip install --no-cache-dir \
"numpy==1.26.4" "scipy==1.11.4" \
"librosa==0.10.1" "soundfile==0.12.1" \
"matplotlib>=3.8,<4" "pandas>=2.1,<3" "rich>=13,<15" "tabulate>=0.9,<1"
COPY patch_resemble_enhance.py /tmp/patch_resemble_enhance.py
RUN python /tmp/patch_resemble_enhance.py && rm /tmp/patch_resemble_enhance.py
COPY app.py /opt/xvc/local_webui.py
COPY inference_log.py /opt/xvc/utils/log.py
ENV HF_HOME=/models/huggingface \
PYTHONUNBUFFERED=1
EXPOSE 8009
HEALTHCHECK --interval=5s --timeout=3s --start-period=600s --retries=3 \
CMD curl -fsS http://127.0.0.1:8009/ >/dev/null || exit 1
CMD ["python", "/opt/xvc/local_webui.py"]