mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-09-01 03:55:53 +08:00
Add Pre-Commit Hook
Update Docker
This commit is contained in:
parent
bf90e8f4aa
commit
8c6abbf930
15
.github/workflows/docker-publish.yaml
vendored
15
.github/workflows/docker-publish.yaml
vendored
@ -26,16 +26,16 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- cuda_version: 12.4
|
- cuda_version: 12.4
|
||||||
use_fasterwhisper: false
|
lite: false
|
||||||
tag_prefix: lite-cu124
|
tag_prefix: lite-cu124
|
||||||
- cuda_version: 12.4
|
- cuda_version: 12.4
|
||||||
use_fasterwhisper: true
|
lite: true
|
||||||
tag_prefix: cu124
|
tag_prefix: cu124
|
||||||
- cuda_version: 12.8
|
- cuda_version: 12.8
|
||||||
use_fasterwhisper: false
|
lite: false
|
||||||
tag_prefix: lite-cu128
|
tag_prefix: lite-cu128
|
||||||
- cuda_version: 12.8
|
- cuda_version: 12.8
|
||||||
use_fasterwhisper: true
|
lite: true
|
||||||
tag_prefix: cu128
|
tag_prefix: cu128
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -93,12 +93,11 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: false
|
push: false
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
build-args: |
|
build-args: |
|
||||||
USE_FUNASR=true
|
LITE=${{ matrix.lite }}
|
||||||
USE_FASTERWHISPER=${{ matrix.use_fasterwhisper }}
|
|
||||||
CUDA_VERSION=${{ matrix.cuda_version }}
|
CUDA_VERSION=${{ matrix.cuda_version }}
|
||||||
WGET_CMD=wget -nv --tries=25 --wait=5 --read-timeout=40 --retry-on-http-error=404
|
WORKFLOW=true
|
||||||
SKIP_CHECK=true
|
|
||||||
tags: |
|
tags: |
|
||||||
xxxxrt666/gpt-sovits:${{ matrix.tag_prefix }}-${{ needs.generate-meta.outputs.tag }}
|
xxxxrt666/gpt-sovits:${{ matrix.tag_prefix }}-${{ needs.generate-meta.outputs.tag }}
|
||||||
xxxxrt666/gpt-sovits:latest-${{ matrix.tag_prefix }}
|
xxxxrt666/gpt-sovits:latest-${{ matrix.tag_prefix }}
|
||||||
|
15
.pre-commit-config.yaml
Normal file
15
.pre-commit-config.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
ci:
|
||||||
|
autoupdate_schedule: monthly
|
||||||
|
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
|
rev: v0.11.7
|
||||||
|
hooks:
|
||||||
|
# Run the linter.
|
||||||
|
- id: ruff
|
||||||
|
types_or: [ python, pyi ]
|
||||||
|
args: [ --fix ]
|
||||||
|
# Run the formatter.
|
||||||
|
- id: ruff-format
|
||||||
|
types_or: [ python, pyi ]
|
||||||
|
args: [--line-length=120]
|
30
Docker/anaconda_install.sh
Normal file
30
Docker/anaconda_install.sh
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
||||||
|
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
cd .. || exit 1
|
||||||
|
|
||||||
|
WORKFLOW=${WORKFLOW:-"false"}
|
||||||
|
TARGETPLATFORM=${TARGETPLATFORM:-"linux/amd64"}
|
||||||
|
|
||||||
|
if [ "$WORKFLOW" = "true" ]; then
|
||||||
|
WGET_CMD="wget --tries=25 --wait=5 --read-timeout=40 --retry-on-http-error=404"
|
||||||
|
else
|
||||||
|
WGET_CMD="wget -nv --tries=25 --wait=5 --read-timeout=40 --retry-on-http-error=404"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then
|
||||||
|
eval "$WGET_CMD -O anaconda.sh https://repo.anaconda.com/archive/Anaconda3-2024.02-1-Linux-x86_64.sh"
|
||||||
|
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then
|
||||||
|
eval "$WGET_CMD -O anaconda.sh https://repo.anaconda.com/archive/Anaconda3-2024.02-1-Linux-aarch.sh"
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
bash anaconda.sh -b -p "$HOME/anaconda3"
|
||||||
|
|
||||||
|
rm anaconda.sh
|
63
Docker/setup.sh
Normal file
63
Docker/setup.sh
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
||||||
|
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
cd .. || exit 1
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
WORKFLOW=${WORKFLOW:-"false"}
|
||||||
|
LITE=${LITE:-"false"}
|
||||||
|
|
||||||
|
if [ "$WORKFLOW" = "true" ]; then
|
||||||
|
WGET_CMD="wget --tries=25 --wait=5 --read-timeout=40 --retry-on-http-error=404"
|
||||||
|
else
|
||||||
|
WGET_CMD="wget -nv --tries=25 --wait=5 --read-timeout=40 --retry-on-http-error=404"
|
||||||
|
fi
|
||||||
|
|
||||||
|
USE_FUNASR=false
|
||||||
|
USE_FASTERWHISPER=false
|
||||||
|
|
||||||
|
if [ "$LITE" = "true" ]; then
|
||||||
|
USE_FUNASR=true
|
||||||
|
USE_FASTERWHISPER=false
|
||||||
|
else
|
||||||
|
USE_FUNASR=true
|
||||||
|
USE_FASTERWHISPER=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$USE_FUNASR" = "true" ]; then
|
||||||
|
echo "Downloading funasr..." &&
|
||||||
|
$WGET_CMD "https://huggingface.co/XXXXRT/GPT-SoVITS-Pretrained/resolve/main/funasr.zip" &&
|
||||||
|
unzip funasr.zip -d tools/asr/models/ &&
|
||||||
|
rm -rf funasr.zip
|
||||||
|
else
|
||||||
|
echo "Skipping funasr download"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$USE_FASTERWHISPER" = "true" ]; then
|
||||||
|
echo "Downloading faster-whisper..." &&
|
||||||
|
$WGET_CMD "https://huggingface.co/XXXXRT/GPT-SoVITS-Pretrained/resolve/main/faster-whisper.zip" &&
|
||||||
|
unzip faster-whisper.zip -d tools/asr/models/ &&
|
||||||
|
rm -rf faster-whisper.zip
|
||||||
|
else
|
||||||
|
echo "Skipping faster-whisper download"
|
||||||
|
fi
|
||||||
|
|
||||||
|
source "$HOME/anaconda3/etc/profile.d/conda.sh"
|
||||||
|
|
||||||
|
if [ "$LITE" = "true" ]; then
|
||||||
|
bash install.sh --device "CU${CUDA_VERSION//./}" --source HF --skip-check "$WORKFLOW"
|
||||||
|
elif [ "$LITE" = "false" ]; then
|
||||||
|
bash install.sh --device "CU${CUDA_VERSION//./}" --source HF --skip-check "$WORKFLOW" --download-uvr5
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
pip cache purge
|
||||||
|
|
||||||
|
pip show torch
|
||||||
|
|
||||||
|
rm -rf "$HOME/.cache" /tmp/* /var/tmp/*
|
85
Dockerfile
85
Dockerfile
@ -1,15 +1,15 @@
|
|||||||
ARG CUDA_VERSION=12.4
|
ARG CUDA_VERSION=12.4
|
||||||
|
|
||||||
FROM nvidia/cuda:${CUDA_VERSION}.1-cudnn-runtime-ubuntu22.04
|
FROM nvidia/cuda:${CUDA_VERSION}.1-cudnn-devel-ubuntu22.04
|
||||||
|
|
||||||
ARG CUDA_VERSION
|
|
||||||
|
|
||||||
ENV CUDA_VERSION=${CUDA_VERSION}
|
|
||||||
|
|
||||||
LABEL maintainer="XXXXRT"
|
LABEL maintainer="XXXXRT"
|
||||||
LABEL version="V4-0429"
|
LABEL version="V4-0501"
|
||||||
LABEL description="Docker image for GPT-SoVITS"
|
LABEL description="Docker image for GPT-SoVITS"
|
||||||
|
|
||||||
|
ARG CUDA_VERSION=12.4
|
||||||
|
|
||||||
|
ENV CUDA_VERSION=${CUDA_VERSION}
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
build-essential \
|
build-essential \
|
||||||
gcc \
|
gcc \
|
||||||
@ -29,76 +29,35 @@ WORKDIR /workspace/GPT-SoVITS
|
|||||||
|
|
||||||
COPY . /workspace/GPT-SoVITS
|
COPY . /workspace/GPT-SoVITS
|
||||||
|
|
||||||
ARG WGET_CMD=wget --tries=25 --wait=5 --read-timeout=40 --retry-on-http-error=404
|
ARG LITE=false
|
||||||
ENV WGET_CMD=${WGET_CMD}
|
ENV LITE=${LITE}
|
||||||
|
|
||||||
RUN echo "== /usr ==" && du -h --max-depth=2 /usr | sort -hr | head -n 10 && \
|
ARG WORKFLOW=false
|
||||||
echo "== /opt ==" && du -h --max-depth=2 /opt | sort -hr | head -n 10 && \
|
ENV WORKFLOW=${WORKFLOW}
|
||||||
echo "== /root ==" && du -h --max-depth=2 /root | sort -hr | head -n 10 && \
|
|
||||||
echo "==workspace==" && du -h --max-depth=2 /workspace/GPT-SoVITS | sort -hr | head -n 10
|
|
||||||
|
|
||||||
RUN eval "$WGET_CMD -O anaconda.sh https://repo.anaconda.com/archive/Anaconda3-2024.10-1-Linux-x86_64.sh" && \
|
ARG TARGETPLATFORM=linux/amd64
|
||||||
bash anaconda.sh -b -p /root/anaconda3 && \
|
ENV TARGETPLATFORM=${TARGETPLATFORM}
|
||||||
rm anaconda.sh
|
|
||||||
|
|
||||||
|
RUN bash Docker/anaconda_install.sh
|
||||||
|
|
||||||
RUN echo "== /usr ==" && du -h --max-depth=2 /usr | sort -hr | head -n 10 && \
|
RUN echo "== $HOME/anaconda3/pkgs ==" && du -h --max-depth=2 $HOME/anaconda3/pkgs | sort -hr | head -n 10 && \
|
||||||
echo "== /opt ==" && du -h --max-depth=2 /opt | sort -hr | head -n 10 && \
|
echo "== $HOME/anaconda3 ==" && du -h --max-depth=2 $HOME/anaconda3 | sort -hr | head -n 10
|
||||||
echo "== /root ==" && du -h --max-depth=2 /root | sort -hr | head -n 10 && \
|
|
||||||
echo "==workspace==" && du -h --max-depth=2 /workspace/GPT-SoVITS | sort -hr | head -n 10
|
|
||||||
|
|
||||||
ARG USE_FUNASR=false
|
ENV PATH="$HOME/anaconda3/bin:$PATH"
|
||||||
ARG USE_FASTERWHISPER=false
|
|
||||||
|
|
||||||
RUN if [ "$USE_FUNASR" = "true" ]; then \
|
|
||||||
echo "Downloading funasr..." && \
|
|
||||||
$WGET_CMD "https://huggingface.co/XXXXRT/GPT-SoVITS-Pretrained/resolve/main/funasr.zip" && \
|
|
||||||
unzip funasr.zip -d tools/asr/models/ && \
|
|
||||||
rm -rf funasr.zip ; \
|
|
||||||
else \
|
|
||||||
echo "Skipping funasr download" ; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
RUN if [ "$USE_FASTERWHISPER" = "true" ]; then \
|
|
||||||
echo "Downloading faster-whisper..." && \
|
|
||||||
$WGET_CMD "https://huggingface.co/XXXXRT/GPT-SoVITS-Pretrained/resolve/main/faster-whisper.zip" && \
|
|
||||||
unzip faster-whisper.zip -d tools/asr/models/ && \
|
|
||||||
rm -rf faster-whisper.zip ; \
|
|
||||||
else \
|
|
||||||
echo "Skipping faster-whisper download" ; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
RUN echo "== /usr ==" && du -h --max-depth=2 /usr | sort -hr | head -n 10 && \
|
|
||||||
echo "== /opt ==" && du -h --max-depth=2 /opt | sort -hr | head -n 10 && \
|
|
||||||
echo "== /root ==" && du -h --max-depth=2 /root | sort -hr | head -n 10 && \
|
|
||||||
echo "==workspace==" && du -h --max-depth=2 /workspace/GPT-SoVITS | sort -hr | head -n 10
|
|
||||||
|
|
||||||
ENV PATH="/root/anaconda3/bin:$PATH"
|
|
||||||
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
SHELL ["/bin/bash", "-c"]
|
||||||
|
|
||||||
RUN conda create -n GPTSoVITS python=3.10 -y
|
|
||||||
|
|
||||||
ENV PATH="/usr/local/cuda/bin:$PATH"
|
ENV PATH="/usr/local/cuda/bin:$PATH"
|
||||||
ENV CUDA_HOME="/usr/local/cuda"
|
ENV CUDA_HOME="/usr/local/cuda"
|
||||||
ENV MAKEFLAGS="-j$(nproc)"
|
ENV MAKEFLAGS="-j$(nproc)"
|
||||||
|
|
||||||
ARG SKIP_CHECK=false
|
RUN bash Docker/setup.sh
|
||||||
ENV SKIP_CHECK=${SKIP_CHECK}
|
|
||||||
|
|
||||||
RUN source /root/anaconda3/etc/profile.d/conda.sh && \
|
RUN echo "== $HOME/anaconda3/pkgs ==" && du -h --max-depth=2 $HOME/anaconda3/pkgs | sort -hr | head -n 10 && \
|
||||||
conda activate GPTSoVITS && \
|
echo "== $HOME/anaconda3 ==" && du -h --max-depth=2 $HOME/anaconda3 | sort -hr | head -n 10
|
||||||
bash install.sh --device CU${CUDA_VERSION//./} --source HF --skip-check ${SKIP_CHECK} --download-uvr5 && \
|
|
||||||
pip cache purge && \
|
|
||||||
pip show torch
|
|
||||||
|
|
||||||
RUN echo "== /usr ==" && du -h --max-depth=2 /usr | sort -hr | head -n 10 && \
|
|
||||||
echo "== /opt ==" && du -h --max-depth=2 /opt | sort -hr | head -n 10 && \
|
|
||||||
echo "== /root ==" && du -h --max-depth=2 /root | sort -hr | head -n 10 && \
|
|
||||||
echo "==workspace==" && du -h --max-depth=2 /workspace/GPT-SoVITS | sort -hr | head -n 10
|
|
||||||
|
|
||||||
RUN rm -rf /root/anaconda3/pkgs
|
|
||||||
|
|
||||||
EXPOSE 9871 9872 9873 9874 9880
|
EXPOSE 9871 9872 9873 9874 9880
|
||||||
|
|
||||||
CMD ["/bin/bash", "-c", "source /root/anaconda3/etc/profile.d/conda.sh && conda activate GPTSoVITS && export PYTHONPATH=$(pwd) && exec bash"]
|
ENV PYTHONPATH="/workspace/GPT-SoVITS"
|
||||||
|
|
||||||
|
CMD ["/bin/bash", "-c", "source $HOME/anaconda3/etc/profile.d/conda.sh && exec bash"]
|
@ -16,7 +16,6 @@ services:
|
|||||||
- /workspace/tools/asr/models
|
- /workspace/tools/asr/models
|
||||||
- /workspace/tools/uvr5/uvr5_weights
|
- /workspace/tools/uvr5/uvr5_weights
|
||||||
environment:
|
environment:
|
||||||
- PYTHONPATH=/workspace/GPT-SoVITS
|
|
||||||
- is_half=true
|
- is_half=true
|
||||||
tty: true
|
tty: true
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
@ -38,7 +37,6 @@ services:
|
|||||||
- /workspace/tools/asr/models
|
- /workspace/tools/asr/models
|
||||||
- /workspace/tools/uvr5/uvr5_weights
|
- /workspace/tools/uvr5/uvr5_weights
|
||||||
environment:
|
environment:
|
||||||
- PYTHONPATH=/workspace/GPT-SoVITS
|
|
||||||
- is_half=true
|
- is_half=true
|
||||||
tty: true
|
tty: true
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
|
17
install.sh
17
install.sh
@ -17,7 +17,7 @@ trap 'echo "Error Occured at \"$BASH_COMMAND\" with exit code $?"; exit 1' ERR
|
|||||||
USE_CUDA=false
|
USE_CUDA=false
|
||||||
USE_ROCM=false
|
USE_ROCM=false
|
||||||
USE_CPU=false
|
USE_CPU=false
|
||||||
SKIP_CHECK=false
|
WORKFLOW=${WORKFLOW:-"false"}
|
||||||
|
|
||||||
USE_HF=false
|
USE_HF=false
|
||||||
USE_HF_MIRROR=false
|
USE_HF_MIRROR=false
|
||||||
@ -66,17 +66,6 @@ while [[ $# -gt 0 ]]; do
|
|||||||
esac
|
esac
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
--skip-check)
|
|
||||||
case "$2" in
|
|
||||||
true)
|
|
||||||
SKIP_CHECK=true
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
:
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
--device)
|
--device)
|
||||||
case "$2" in
|
case "$2" in
|
||||||
CU124)
|
CU124)
|
||||||
@ -204,7 +193,7 @@ if [ "$DOWNLOAD_UVR5" = "true" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$USE_CUDA" = true ] && [ $SKIP_CHECK = false ]; then
|
if [ "$USE_CUDA" = true ] && [ "$WORKFLOW" = false ]; then
|
||||||
echo "Checking for CUDA installation..."
|
echo "Checking for CUDA installation..."
|
||||||
if command -v nvidia-smi &>/dev/null; then
|
if command -v nvidia-smi &>/dev/null; then
|
||||||
echo "CUDA found."
|
echo "CUDA found."
|
||||||
@ -215,7 +204,7 @@ if [ "$USE_CUDA" = true ] && [ $SKIP_CHECK = false ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$USE_ROCM" = true ] && [ $SKIP_CHECK = false ]; then
|
if [ "$USE_ROCM" = true ] && [ "$WORKFLOW" = false ]; then
|
||||||
echo "Checking for ROCm installation..."
|
echo "Checking for ROCm installation..."
|
||||||
if [ -d "/opt/rocm" ]; then
|
if [ -d "/opt/rocm" ]; then
|
||||||
echo "ROCm found."
|
echo "ROCm found."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user