|
|
|
FROM pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime |
|
|
|
|
|
USER root |
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 \ |
|
PIP_DISABLE_PIP_VERSION_CHECK=1 \ |
|
PIP_PREFER_BINARY=1 \ |
|
NUMBA_CACHE_DIR=/tmp/numba_cache |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && \ |
|
apt-get install -y --no-install-recommends \ |
|
ffmpeg libsox-dev git \ |
|
build-essential cmake ninja-build pkg-config && \ |
|
rm -rf /var/lib/apt/lists/* && \ |
|
mkdir -p /tmp/numba_cache && chmod -R 777 /tmp/numba_cache |
|
|
|
|
|
RUN mkdir -p /nltk_data && chmod 777 /nltk_data |
|
|
|
|
|
RUN git clone --depth 1 https://github.com/RVC-Boss/GPT-SoVITS.git /app |
|
|
|
|
|
RUN pip install --upgrade pip && \ |
|
pip install --no-cache-dir -r /app/requirements.txt && \ |
|
pip install --no-cache-dir --force-reinstall numpy==1.23.5 librosa==0.9.2 numba==0.56.4 && \ |
|
pip install --no-cache-dir fastapi uvicorn soundfile huggingface_hub ffmpeg-python |
|
|
|
|
|
|
|
RUN python -c "import nltk; nltk.download('punkt', quiet=True, download_dir='/nltk_data'); nltk.download('averaged_perceptron_tagger', quiet=True, download_dir='/nltk_data'); nltk.download('averaged_perceptron_tagger_eng', quiet=True, download_dir='/nltk_data')" |
|
|
|
|
|
COPY download_support_models.py /app/download_support_models.py |
|
RUN python /app/download_support_models.py || true |
|
|
|
|
|
COPY weights/ /app/pretrained_models/shantianliang/ |
|
COPY reference_audio/ /app/reference_audio/ |
|
|
|
|
|
RUN chown -R 1000:1000 /app |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["python", "api_v2.py", "-a", "0.0.0.0", "-p", "7860", "-c", "GPT_SoVITS/configs/tts_infer.yaml"] |