mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2026-04-29 21:00:42 +08:00
Migrate to miniforge, add missing dependencies, update docker file, remove deprecated files (#2732)
* Migrate to miniforge, add missing dependencies, update docker file, remove deprecated files * Add Env Vars and Secrets
This commit is contained in:
parent
9986880b3f
commit
2d9193b0d3
30
.github/workflows/docker-publish.yaml
vendored
30
.github/workflows/docker-publish.yaml
vendored
@ -21,6 +21,7 @@ jobs:
|
|||||||
build-amd64:
|
build-amd64:
|
||||||
needs: generate-meta
|
needs: generate-meta
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
environment: Docker
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
@ -86,7 +87,7 @@ jobs:
|
|||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
username: ${{ vars.DOCKER_HUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
|
|
||||||
- name: Build and Push Docker Image (amd64)
|
- name: Build and Push Docker Image (amd64)
|
||||||
@ -108,6 +109,7 @@ jobs:
|
|||||||
build-arm64:
|
build-arm64:
|
||||||
needs: generate-meta
|
needs: generate-meta
|
||||||
runs-on: ubuntu-22.04-arm
|
runs-on: ubuntu-22.04-arm
|
||||||
|
environment: Docker
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
@ -173,7 +175,7 @@ jobs:
|
|||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
username: ${{ vars.DOCKER_HUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
|
|
||||||
- name: Build and Push Docker Image (arm64)
|
- name: Build and Push Docker Image (arm64)
|
||||||
@ -206,6 +208,7 @@ jobs:
|
|||||||
- tag_prefix: cu126
|
- tag_prefix: cu126
|
||||||
- tag_prefix: cu128-lite
|
- tag_prefix: cu128-lite
|
||||||
- tag_prefix: cu128
|
- tag_prefix: cu128
|
||||||
|
environment: Docker
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
@ -214,7 +217,7 @@ jobs:
|
|||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
username: ${{ vars.DOCKER_HUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
|
|
||||||
- name: Merge amd64 and arm64 into multi-arch image
|
- name: Merge amd64 and arm64 into multi-arch image
|
||||||
@ -223,17 +226,17 @@ jobs:
|
|||||||
TAG_PREFIX=${{ matrix.tag_prefix }}
|
TAG_PREFIX=${{ matrix.tag_prefix }}
|
||||||
|
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/gpt-sovits:${TAG_PREFIX}-${DATE_TAG} \
|
--tag ${{ vars.DOCKER_HUB_USERNAME }}/gpt-sovits:${TAG_PREFIX}-${DATE_TAG} \
|
||||||
${{ secrets.DOCKER_HUB_USERNAME }}/gpt-sovits:${TAG_PREFIX}-${DATE_TAG}-amd64 \
|
${{ vars.DOCKER_HUB_USERNAME }}/gpt-sovits:${TAG_PREFIX}-${DATE_TAG}-amd64 \
|
||||||
${{ secrets.DOCKER_HUB_USERNAME }}/gpt-sovits:${TAG_PREFIX}-${DATE_TAG}-arm64
|
${{ vars.DOCKER_HUB_USERNAME }}/gpt-sovits:${TAG_PREFIX}-${DATE_TAG}-arm64
|
||||||
|
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/gpt-sovits:latest-${TAG_PREFIX} \
|
--tag ${{ vars.DOCKER_HUB_USERNAME }}/gpt-sovits:latest-${TAG_PREFIX} \
|
||||||
${{ secrets.DOCKER_HUB_USERNAME }}/gpt-sovits:latest-${TAG_PREFIX}-amd64 \
|
${{ vars.DOCKER_HUB_USERNAME }}/gpt-sovits:latest-${TAG_PREFIX}-amd64 \
|
||||||
${{ secrets.DOCKER_HUB_USERNAME }}/gpt-sovits:latest-${TAG_PREFIX}-arm64
|
${{ vars.DOCKER_HUB_USERNAME }}/gpt-sovits:latest-${TAG_PREFIX}-arm64
|
||||||
- name: Delete old platform-specific tags via Docker Hub API
|
- name: Delete old platform-specific tags via Docker Hub API
|
||||||
env:
|
env:
|
||||||
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
DOCKER_HUB_USERNAME: ${{ vars.DOCKER_HUB_USERNAME }}
|
||||||
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
TAG_PREFIX: ${{ matrix.tag_prefix }}
|
TAG_PREFIX: ${{ matrix.tag_prefix }}
|
||||||
DATE_TAG: ${{ needs.generate-meta.outputs.tag }}
|
DATE_TAG: ${{ needs.generate-meta.outputs.tag }}
|
||||||
@ -258,6 +261,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- merge-and-clean
|
- merge-and-clean
|
||||||
|
environment: Docker
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -265,12 +269,12 @@ jobs:
|
|||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
username: ${{ vars.DOCKER_HUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||||
|
|
||||||
- name: Create Default Tag
|
- name: Create Default Tag
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
--tag ${{ secrets.DOCKER_HUB_USERNAME }}/gpt-sovits:latest \
|
--tag ${{ vars.DOCKER_HUB_USERNAME }}/gpt-sovits:latest \
|
||||||
${{ secrets.DOCKER_HUB_USERNAME }}/gpt-sovits:latest-cu126-lite
|
${{ vars.DOCKER_HUB_USERNAME }}/gpt-sovits:latest-cu126-lite
|
||||||
|
|
||||||
@ -12,4 +12,4 @@ repos:
|
|||||||
# Run the formatter.
|
# Run the formatter.
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
types_or: [ python, pyi ]
|
types_or: [ python, pyi ]
|
||||||
args: [ --line-length, "120", --target-version, "py310" ]
|
args: [ --line-length, "120", --target-version, "py311" ]
|
||||||
|
|||||||
@ -8,7 +8,7 @@ cd .. || exit 1
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
source "$HOME/miniconda3/etc/profile.d/conda.sh"
|
source "$HOME/conda/etc/profile.d/conda.sh"
|
||||||
|
|
||||||
mkdir -p GPT_SoVITS
|
mkdir -p GPT_SoVITS
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ ln -s /workspace/models/pretrained_models /workspace/GPT-SoVITS/GPT_SoVITS/pretr
|
|||||||
|
|
||||||
ln -s /workspace/models/G2PWModel /workspace/GPT-SoVITS/GPT_SoVITS/text/G2PWModel
|
ln -s /workspace/models/G2PWModel /workspace/GPT-SoVITS/GPT_SoVITS/text/G2PWModel
|
||||||
|
|
||||||
bash install.sh --device "CU${CUDA_VERSION//./}" --source HF
|
TERM=dumb bash install.sh --device "CU${CUDA_VERSION//./}" --source HF
|
||||||
|
|
||||||
pip cache purge
|
pip cache purge
|
||||||
|
|
||||||
@ -26,8 +26,8 @@ pip show torch
|
|||||||
|
|
||||||
rm -rf /tmp/* /var/tmp/*
|
rm -rf /tmp/* /var/tmp/*
|
||||||
|
|
||||||
rm -rf "$HOME/miniconda3/pkgs"
|
rm -rf "$HOME/conda/pkgs"
|
||||||
|
|
||||||
mkdir -p "$HOME/miniconda3/pkgs"
|
mkdir -p "$HOME/conda/pkgs"
|
||||||
|
|
||||||
rm -rf /root/.conda /root/.cache
|
rm -rf /root/.conda /root/.cache
|
||||||
|
|||||||
@ -1,70 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
|
||||||
|
|
||||||
cd "$SCRIPT_DIR" || exit 1
|
|
||||||
|
|
||||||
cd .. || exit 1
|
|
||||||
|
|
||||||
if [ -d "$HOME/miniconda3" ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
WORKFLOW=${WORKFLOW:-"false"}
|
|
||||||
TARGETPLATFORM=${TARGETPLATFORM:-"linux/amd64"}
|
|
||||||
|
|
||||||
if [ "$WORKFLOW" = "true" ]; then
|
|
||||||
WGET_CMD=(wget -nv --tries=25 --wait=5 --read-timeout=40 --retry-on-http-error=404)
|
|
||||||
else
|
|
||||||
WGET_CMD=(wget --tries=25 --wait=5 --read-timeout=40 --retry-on-http-error=404)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then
|
|
||||||
"${WGET_CMD[@]}" -O miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py311_25.3.1-1-Linux-x86_64.sh
|
|
||||||
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then
|
|
||||||
"${WGET_CMD[@]}" -O miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-py311_25.3.1-1-Linux-aarch64.sh
|
|
||||||
else
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
LOG_PATH="/tmp/miniconda-install.log"
|
|
||||||
|
|
||||||
bash miniconda.sh -b -p "$HOME/miniconda3" >"$LOG_PATH" 2>&1
|
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
echo "== Miniconda Installed =="
|
|
||||||
else
|
|
||||||
echo "Failed to Install miniconda"
|
|
||||||
tail -n 50 "$LOG_PATH"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm miniconda.sh
|
|
||||||
|
|
||||||
source "$HOME/miniconda3/etc/profile.d/conda.sh"
|
|
||||||
|
|
||||||
"$HOME/miniconda3/bin/conda" config --add channels conda-forge
|
|
||||||
|
|
||||||
"$HOME/miniconda3/bin/conda" update -q --all -y 1>/dev/null
|
|
||||||
|
|
||||||
"$HOME/miniconda3/bin/conda" install python=3.11 -q -y
|
|
||||||
|
|
||||||
"$HOME/miniconda3/bin/conda" install gcc=14 gxx ffmpeg cmake make unzip -q -y
|
|
||||||
|
|
||||||
if [ "$CUDA_VERSION" = "12.8" ]; then
|
|
||||||
"$HOME/miniconda3/bin/pip" install torch torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/cu128
|
|
||||||
elif [ "$CUDA_VERSION" = "12.6" ]; then
|
|
||||||
"$HOME/miniconda3/bin/pip" install torch==2.6 torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/cu126
|
|
||||||
fi
|
|
||||||
|
|
||||||
"$HOME/miniconda3/bin/pip" cache purge
|
|
||||||
|
|
||||||
rm $LOG_PATH
|
|
||||||
|
|
||||||
rm -rf "$HOME/miniconda3/pkgs"
|
|
||||||
|
|
||||||
mkdir -p "$HOME/miniconda3/pkgs"
|
|
||||||
|
|
||||||
rm -rf "$HOME/.conda" "$HOME/.cache"
|
|
||||||
82
Docker/miniforge_install.sh
Normal file
82
Docker/miniforge_install.sh
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
||||||
|
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
|
||||||
|
cd .. || exit 1
|
||||||
|
|
||||||
|
if [ -d "$HOME/conda" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
WORKFLOW=${WORKFLOW:-"false"}
|
||||||
|
TARGETPLATFORM=${TARGETPLATFORM:-"linux/amd64"}
|
||||||
|
|
||||||
|
if [ "$WORKFLOW" = "true" ]; then
|
||||||
|
WGET_CMD=(wget -nv --tries=25 --wait=5 --read-timeout=40 --retry-on-http-error=404)
|
||||||
|
else
|
||||||
|
WGET_CMD=(wget --tries=25 --wait=5 --read-timeout=40 --retry-on-http-error=404)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then
|
||||||
|
"${WGET_CMD[@]}" -O Miniforge.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
|
||||||
|
SYSROOT_PKG="sysroot_linux-64>=2.28"
|
||||||
|
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then
|
||||||
|
"${WGET_CMD[@]}" -O Miniforge.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
|
||||||
|
SYSROOT_PKG="sysroot_linux-aarch64>=2.28"
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
LOG_PATH="/tmp/miniforge-install.log"
|
||||||
|
|
||||||
|
bash Miniforge.sh -b -p "$HOME/conda" >"$LOG_PATH" 2>&1
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "== Miniforge Installed =="
|
||||||
|
else
|
||||||
|
echo "Failed to Install miniforge"
|
||||||
|
tail -n 50 "$LOG_PATH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm Miniforge.sh
|
||||||
|
|
||||||
|
source "$HOME/conda/etc/profile.d/conda.sh"
|
||||||
|
|
||||||
|
"$HOME/conda/bin/conda" init bash
|
||||||
|
|
||||||
|
source "$HOME/.bashrc"
|
||||||
|
|
||||||
|
"$HOME/conda/bin/conda" info
|
||||||
|
|
||||||
|
"$HOME/conda/bin/conda" update --all -y
|
||||||
|
|
||||||
|
"$HOME/conda/bin/conda" install python=3.12 -y
|
||||||
|
|
||||||
|
"$HOME/conda/bin/conda" install gcc=11 gxx ffmpeg cmake make unzip $SYSROOT_PKG "libstdcxx-ng>=11" -y
|
||||||
|
|
||||||
|
if [ "$CUDA_VERSION" = "12.8" ]; then
|
||||||
|
"$HOME/conda/bin/pip" install torch torchcodec --no-cache-dir --index-url https://download.pytorch.org/whl/cu128
|
||||||
|
"$HOME/conda/bin/conda" install cuda-nvcc=12.8 -y
|
||||||
|
elif [ "$CUDA_VERSION" = "12.6" ]; then
|
||||||
|
"$HOME/conda/bin/pip" install torch torchcodec --no-cache-dir --index-url https://download.pytorch.org/whl/cu126
|
||||||
|
"$HOME/conda/bin/conda" install cuda-nvcc=12.6 -y
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PATH="$HOME/conda/bin:$PATH"
|
||||||
|
|
||||||
|
"$HOME/conda/bin/pip" install psutil ninja packaging wheel "setuptools>=42" einops
|
||||||
|
"$HOME/conda/bin/pip" install flash-attn -i https://xxxxrt666.github.io/PIP-Index/ --no-build-isolation
|
||||||
|
"$HOME/conda/bin/pip" cache purge
|
||||||
|
|
||||||
|
rm $LOG_PATH
|
||||||
|
|
||||||
|
rm -rf "$HOME/conda/pkgs"
|
||||||
|
|
||||||
|
mkdir -p "$HOME/conda/pkgs"
|
||||||
|
|
||||||
|
rm -rf "$HOME/.conda" "$HOME/.cache"
|
||||||
10
Dockerfile
10
Dockerfile
@ -4,7 +4,7 @@ ARG TORCH_BASE=full
|
|||||||
FROM xxxxrt666/torch-base:cu${CUDA_VERSION}-${TORCH_BASE}
|
FROM xxxxrt666/torch-base:cu${CUDA_VERSION}-${TORCH_BASE}
|
||||||
|
|
||||||
LABEL maintainer="XXXXRT"
|
LABEL maintainer="XXXXRT"
|
||||||
LABEL version="V4"
|
LABEL version="V2 Pro"
|
||||||
LABEL description="Docker image for GPT-SoVITS"
|
LABEL description="Docker image for GPT-SoVITS"
|
||||||
|
|
||||||
ARG CUDA_VERSION=12.6
|
ARG CUDA_VERSION=12.6
|
||||||
@ -25,14 +25,6 @@ ENV WORKFLOW=${WORKFLOW}
|
|||||||
|
|
||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
ENV TARGETPLATFORM=${TARGETPLATFORM}
|
ENV TARGETPLATFORM=${TARGETPLATFORM}
|
||||||
# 解决 Conda 条款未同意导致的构建失败
|
|
||||||
ENV TERM=linux
|
|
||||||
|
|
||||||
RUN conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \
|
|
||||||
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
|
|
||||||
|
|
||||||
RUN bash Docker/miniconda_install.sh
|
|
||||||
|
|
||||||
|
|
||||||
COPY extra-req.txt /workspace/GPT-SoVITS/
|
COPY extra-req.txt /workspace/GPT-SoVITS/
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,7 @@ trap 'echo "Error Occured at \"$BASH_COMMAND\" with exit code $?"; exit 1' ERR
|
|||||||
|
|
||||||
LITE=false
|
LITE=false
|
||||||
CUDA_VERSION=12.6
|
CUDA_VERSION=12.6
|
||||||
|
WORKFLOW=true
|
||||||
|
|
||||||
print_help() {
|
print_help() {
|
||||||
echo "Usage: bash docker_build.sh [OPTIONS]"
|
echo "Usage: bash docker_build.sh [OPTIONS]"
|
||||||
@ -78,5 +79,6 @@ docker build \
|
|||||||
--build-arg LITE=$LITE \
|
--build-arg LITE=$LITE \
|
||||||
--build-arg TARGETPLATFORM="$TARGETPLATFORM" \
|
--build-arg TARGETPLATFORM="$TARGETPLATFORM" \
|
||||||
--build-arg TORCH_BASE=$TORCH_BASE \
|
--build-arg TORCH_BASE=$TORCH_BASE \
|
||||||
|
--build-arg WORKFLOW=$WORKFLOW \
|
||||||
-t "${USER}/gpt-sovits:local" \
|
-t "${USER}/gpt-sovits:local" \
|
||||||
.
|
.
|
||||||
|
|||||||
@ -1,243 +0,0 @@
|
|||||||
{
|
|
||||||
"cells": [
|
|
||||||
{
|
|
||||||
"cell_type": "markdown",
|
|
||||||
"id": "9fd922fb",
|
|
||||||
"metadata": {},
|
|
||||||
"source": [
|
|
||||||
"# Deprecated"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "45857cb2",
|
|
||||||
"metadata": {
|
|
||||||
"_cell_guid": "b1076dfc-b9ad-4769-8c92-a6c4dae69d19",
|
|
||||||
"_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e0e5",
|
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2024-02-18T14:43:46.735480Z",
|
|
||||||
"iopub.status.busy": "2024-02-18T14:43:46.735183Z",
|
|
||||||
"iopub.status.idle": "2024-02-18T14:48:10.724175Z",
|
|
||||||
"shell.execute_reply": "2024-02-18T14:48:10.723059Z"
|
|
||||||
},
|
|
||||||
"papermill": {
|
|
||||||
"duration": 263.994935,
|
|
||||||
"end_time": "2024-02-18T14:48:10.726613",
|
|
||||||
"exception": false,
|
|
||||||
"start_time": "2024-02-18T14:43:46.731678",
|
|
||||||
"status": "completed"
|
|
||||||
},
|
|
||||||
"tags": []
|
|
||||||
},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"!git clone https://github.com/RVC-Boss/GPT-SoVITS.git\n",
|
|
||||||
"%cd GPT-SoVITS\n",
|
|
||||||
"!apt-get update && apt-get install -y --no-install-recommends tzdata ffmpeg libsox-dev parallel aria2 git git-lfs && git lfs install\n",
|
|
||||||
"!pip install -r requirements.txt\n",
|
|
||||||
"!pip install -r extra-req.txt --no-deps"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "b9d346b4",
|
|
||||||
"metadata": {
|
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2024-02-18T14:48:10.815802Z",
|
|
||||||
"iopub.status.busy": "2024-02-18T14:48:10.814899Z",
|
|
||||||
"iopub.status.idle": "2024-02-18T14:50:31.253276Z",
|
|
||||||
"shell.execute_reply": "2024-02-18T14:50:31.252024Z"
|
|
||||||
},
|
|
||||||
"papermill": {
|
|
||||||
"duration": 140.484893,
|
|
||||||
"end_time": "2024-02-18T14:50:31.255720",
|
|
||||||
"exception": false,
|
|
||||||
"start_time": "2024-02-18T14:48:10.770827",
|
|
||||||
"status": "completed"
|
|
||||||
},
|
|
||||||
"tags": []
|
|
||||||
},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"# @title Download pretrained models 下载预训练模型\n",
|
|
||||||
"!mkdir -p /kaggle/working/GPT-SoVITS/GPT_SoVITS/pretrained_models\n",
|
|
||||||
"!mkdir -p /kaggle/working/GPT-SoVITS/tools/asr/models\n",
|
|
||||||
"!mkdir -p /kaggle/working/GPT-SoVITS/tools/uvr5\n",
|
|
||||||
"%cd /kaggle/working/GPT-SoVITS/GPT_SoVITS/pretrained_models\n",
|
|
||||||
"!git clone https://huggingface.co/lj1995/GPT-SoVITS\n",
|
|
||||||
"%cd /kaggle/working/GPT-SoVITS/tools/asr/models\n",
|
|
||||||
"!git clone https://www.modelscope.cn/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch.git\n",
|
|
||||||
"!git clone https://www.modelscope.cn/damo/speech_fsmn_vad_zh-cn-16k-common-pytorch.git\n",
|
|
||||||
"!git clone https://www.modelscope.cn/damo/punc_ct-transformer_zh-cn-common-vocab272727-pytorch.git\n",
|
|
||||||
"# # @title UVR5 pretrains 安装uvr5模型\n",
|
|
||||||
"%cd /kaggle/working/GPT-SoVITS/tools/uvr5\n",
|
|
||||||
"!git clone https://huggingface.co/Delik/uvr5_weights\n",
|
|
||||||
"!git config core.sparseCheckout true\n",
|
|
||||||
"!mv /kaggle/working/GPT-SoVITS/GPT_SoVITS/pretrained_models/GPT-SoVITS/* /kaggle/working/GPT-SoVITS/GPT_SoVITS/pretrained_models/"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "ea94d245",
|
|
||||||
"metadata": {
|
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2024-02-18T14:29:01.071549Z",
|
|
||||||
"iopub.status.busy": "2024-02-18T14:29:01.070592Z",
|
|
||||||
"iopub.status.idle": "2024-02-18T14:40:45.318368Z",
|
|
||||||
"shell.execute_reply": "2024-02-18T14:40:45.317130Z",
|
|
||||||
"shell.execute_reply.started": "2024-02-18T14:29:01.071512Z"
|
|
||||||
},
|
|
||||||
"papermill": {
|
|
||||||
"duration": null,
|
|
||||||
"end_time": null,
|
|
||||||
"exception": false,
|
|
||||||
"start_time": "2024-02-18T14:50:31.309013",
|
|
||||||
"status": "running"
|
|
||||||
},
|
|
||||||
"tags": []
|
|
||||||
},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"# @title launch WebUI 启动WebUI\n",
|
|
||||||
"%cd /kaggle/working/GPT-SoVITS/\n",
|
|
||||||
"!npm install -g localtunnel\n",
|
|
||||||
"import subprocess\n",
|
|
||||||
"import threading\n",
|
|
||||||
"import time\n",
|
|
||||||
"import socket\n",
|
|
||||||
"import urllib.request\n",
|
|
||||||
"\n",
|
|
||||||
"\n",
|
|
||||||
"def iframe_thread(port):\n",
|
|
||||||
" while True:\n",
|
|
||||||
" time.sleep(0.5)\n",
|
|
||||||
" sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n",
|
|
||||||
" result = sock.connect_ex((\"127.0.0.1\", port))\n",
|
|
||||||
" if result == 0:\n",
|
|
||||||
" break\n",
|
|
||||||
" sock.close()\n",
|
|
||||||
"\n",
|
|
||||||
" from colorama import Fore, Style\n",
|
|
||||||
" print(\n",
|
|
||||||
" Fore.GREEN + \"\\nIP: \",\n",
|
|
||||||
" Fore.RED,\n",
|
|
||||||
" urllib.request.urlopen(\"https://ipv4.icanhazip.com\").read().decode(\"utf8\").strip(\"\\n\"),\n",
|
|
||||||
" \"\\n\",\n",
|
|
||||||
" Style.RESET_ALL,\n",
|
|
||||||
" )\n",
|
|
||||||
" p = subprocess.Popen([\"lt\", \"--port\", \"{}\".format(port)], stdout=subprocess.PIPE)\n",
|
|
||||||
" for line in p.stdout:\n",
|
|
||||||
" print(line.decode(), end=\"\")\n",
|
|
||||||
"\n",
|
|
||||||
"\n",
|
|
||||||
"threading.Thread(target=iframe_thread, daemon=True, args=(9874,)).start()\n",
|
|
||||||
"\n",
|
|
||||||
"!python webui.py"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "dda88a6d",
|
|
||||||
"metadata": {
|
|
||||||
"execution": {
|
|
||||||
"iopub.execute_input": "2024-02-18T14:40:56.880608Z",
|
|
||||||
"iopub.status.busy": "2024-02-18T14:40:56.879879Z"
|
|
||||||
},
|
|
||||||
"papermill": {
|
|
||||||
"duration": null,
|
|
||||||
"end_time": null,
|
|
||||||
"exception": null,
|
|
||||||
"start_time": null,
|
|
||||||
"status": "pending"
|
|
||||||
},
|
|
||||||
"tags": []
|
|
||||||
},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"# 开启推理页面\n",
|
|
||||||
"%cd /kaggle/working/GPT-SoVITS/\n",
|
|
||||||
"!npm install -g localtunnel\n",
|
|
||||||
"import threading\n",
|
|
||||||
"\n",
|
|
||||||
"\n",
|
|
||||||
"def iframe_thread(port):\n",
|
|
||||||
" while True:\n",
|
|
||||||
" time.sleep(0.5)\n",
|
|
||||||
" sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n",
|
|
||||||
" result = sock.connect_ex((\"127.0.0.1\", port))\n",
|
|
||||||
" if result == 0:\n",
|
|
||||||
" break\n",
|
|
||||||
" sock.close()\n",
|
|
||||||
"\n",
|
|
||||||
" from colorama import Fore, Style\n",
|
|
||||||
" print(\n",
|
|
||||||
" Fore.GREEN + \"\\nIP: \",\n",
|
|
||||||
" Fore.RED,\n",
|
|
||||||
" urllib.request.urlopen(\"https://ipv4.icanhazip.com\").read().decode(\"utf8\").strip(\"\\n\"),\n",
|
|
||||||
" \"\\n\",\n",
|
|
||||||
" Style.RESET_ALL,\n",
|
|
||||||
" )\n",
|
|
||||||
" p = subprocess.Popen([\"lt\", \"--port\", \"{}\".format(port)], stdout=subprocess.PIPE)\n",
|
|
||||||
" for line in p.stdout:\n",
|
|
||||||
" print(line.decode(), end=\"\")\n",
|
|
||||||
"\n",
|
|
||||||
"\n",
|
|
||||||
"threading.Thread(target=iframe_thread, daemon=True, args=(9872,)).start()\n",
|
|
||||||
"\n",
|
|
||||||
"!python ./GPT_SoVITS/inference_webui.py"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"metadata": {
|
|
||||||
"kaggle": {
|
|
||||||
"accelerator": "nvidiaTeslaT4",
|
|
||||||
"dataSources": [
|
|
||||||
{
|
|
||||||
"datasetId": 4459328,
|
|
||||||
"sourceId": 7649639,
|
|
||||||
"sourceType": "datasetVersion"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"dockerImageVersionId": 30646,
|
|
||||||
"isGpuEnabled": true,
|
|
||||||
"isInternetEnabled": true,
|
|
||||||
"language": "python",
|
|
||||||
"sourceType": "notebook"
|
|
||||||
},
|
|
||||||
"kernelspec": {
|
|
||||||
"display_name": "Python 3",
|
|
||||||
"language": "python",
|
|
||||||
"name": "python3"
|
|
||||||
},
|
|
||||||
"language_info": {
|
|
||||||
"codemirror_mode": {
|
|
||||||
"name": "ipython",
|
|
||||||
"version": 3
|
|
||||||
},
|
|
||||||
"file_extension": ".py",
|
|
||||||
"mimetype": "text/x-python",
|
|
||||||
"name": "python",
|
|
||||||
"nbconvert_exporter": "python",
|
|
||||||
"pygments_lexer": "ipython3",
|
|
||||||
"version": "3.10.13"
|
|
||||||
},
|
|
||||||
"papermill": {
|
|
||||||
"default_parameters": {},
|
|
||||||
"duration": null,
|
|
||||||
"end_time": null,
|
|
||||||
"environment_variables": {},
|
|
||||||
"exception": null,
|
|
||||||
"input_path": "__notebook__.ipynb",
|
|
||||||
"output_path": "__notebook__.ipynb",
|
|
||||||
"parameters": {},
|
|
||||||
"start_time": "2024-02-18T14:43:44.011910",
|
|
||||||
"version": "2.5.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nbformat": 4,
|
|
||||||
"nbformat_minor": 5
|
|
||||||
}
|
|
||||||
@ -209,15 +209,15 @@ if ($DownloadUVR5) {
|
|||||||
switch ($Device) {
|
switch ($Device) {
|
||||||
"CU128" {
|
"CU128" {
|
||||||
Write-Info "Installing PyTorch For CUDA 12.8..."
|
Write-Info "Installing PyTorch For CUDA 12.8..."
|
||||||
Invoke-Pip torch torchaudio --index-url "https://download.pytorch.org/whl/cu128"
|
Invoke-Pip torch torchcodec --index-url "https://download.pytorch.org/whl/cu128"
|
||||||
}
|
}
|
||||||
"CU126" {
|
"CU126" {
|
||||||
Write-Info "Installing PyTorch For CUDA 12.6..."
|
Write-Info "Installing PyTorch For CUDA 12.6..."
|
||||||
Invoke-Pip torch torchaudio --index-url "https://download.pytorch.org/whl/cu126"
|
Invoke-Pip torch torchcodec --index-url "https://download.pytorch.org/whl/cu126"
|
||||||
}
|
}
|
||||||
"CPU" {
|
"CPU" {
|
||||||
Write-Info "Installing PyTorch For CPU..."
|
Write-Info "Installing PyTorch For CPU..."
|
||||||
Invoke-Pip torch torchaudio --index-url "https://download.pytorch.org/whl/cpu"
|
Invoke-Pip torch torchcodec --index-url "https://download.pytorch.org/whl/cpu"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Write-Success "PyTorch Installed"
|
Write-Success "PyTorch Installed"
|
||||||
|
|||||||
10
install.sh
10
install.sh
@ -49,7 +49,9 @@ run_pip_quiet() {
|
|||||||
|
|
||||||
run_wget_quiet() {
|
run_wget_quiet() {
|
||||||
if wget --tries=25 --wait=5 --read-timeout=40 -q --show-progress "$@" 2>&1; then
|
if wget --tries=25 --wait=5 --read-timeout=40 -q --show-progress "$@" 2>&1; then
|
||||||
|
if [ "$WORKFLOW" = "false" ]; then
|
||||||
tput cuu1 && tput el
|
tput cuu1 && tput el
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo -e "${ERROR} Wget failed"
|
echo -e "${ERROR} Wget failed"
|
||||||
exit 1
|
exit 1
|
||||||
@ -324,17 +326,17 @@ fi
|
|||||||
if [ "$USE_CUDA" = true ] && [ "$WORKFLOW" = false ]; then
|
if [ "$USE_CUDA" = true ] && [ "$WORKFLOW" = false ]; then
|
||||||
if [ "$CUDA" = 128 ]; then
|
if [ "$CUDA" = 128 ]; then
|
||||||
echo -e "${INFO}Installing PyTorch For CUDA 12.8..."
|
echo -e "${INFO}Installing PyTorch For CUDA 12.8..."
|
||||||
run_pip_quiet torch torchaudio --index-url "https://download.pytorch.org/whl/cu128"
|
run_pip_quiet torch torchcodec --index-url "https://download.pytorch.org/whl/cu128"
|
||||||
elif [ "$CUDA" = 126 ]; then
|
elif [ "$CUDA" = 126 ]; then
|
||||||
echo -e "${INFO}Installing PyTorch For CUDA 12.6..."
|
echo -e "${INFO}Installing PyTorch For CUDA 12.6..."
|
||||||
run_pip_quiet torch torchaudio --index-url "https://download.pytorch.org/whl/cu126"
|
run_pip_quiet torch torchcodec --index-url "https://download.pytorch.org/whl/cu126"
|
||||||
fi
|
fi
|
||||||
elif [ "$USE_ROCM" = true ] && [ "$WORKFLOW" = false ]; then
|
elif [ "$USE_ROCM" = true ] && [ "$WORKFLOW" = false ]; then
|
||||||
echo -e "${INFO}Installing PyTorch For ROCm 6.2..."
|
echo -e "${INFO}Installing PyTorch For ROCm 6.2..."
|
||||||
run_pip_quiet torch torchaudio --index-url "https://download.pytorch.org/whl/rocm6.2"
|
run_pip_quiet torch torchcodec --index-url "https://download.pytorch.org/whl/rocm6.2"
|
||||||
elif [ "$USE_CPU" = true ] && [ "$WORKFLOW" = false ]; then
|
elif [ "$USE_CPU" = true ] && [ "$WORKFLOW" = false ]; then
|
||||||
echo -e "${INFO}Installing PyTorch For CPU..."
|
echo -e "${INFO}Installing PyTorch For CPU..."
|
||||||
run_pip_quiet torch torchaudio --index-url "https://download.pytorch.org/whl/cpu"
|
run_pip_quiet torch torchcodec --index-url "https://download.pytorch.org/whl/cpu"
|
||||||
elif [ "$WORKFLOW" = false ]; then
|
elif [ "$WORKFLOW" = false ]; then
|
||||||
echo -e "${ERROR}Unknown Err"
|
echo -e "${ERROR}Unknown Err"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user