From b6d7e971a915dc381e4c3ca003fd7ab45ca6552d Mon Sep 17 00:00:00 2001 From: XXXXRT666 <157766680+XXXXRT666@users.noreply.github.com> Date: Wed, 30 Apr 2025 23:20:30 +0100 Subject: [PATCH] Fix Bugs --- Docker/anaconda_install.sh | 4 +++- Docker/setup.sh | 10 +++++++++- Dockerfile | 1 - docker_build.sh | 4 ++-- install.sh | 4 ++-- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Docker/anaconda_install.sh b/Docker/anaconda_install.sh index aae4c1c5..f5bce252 100644 --- a/Docker/anaconda_install.sh +++ b/Docker/anaconda_install.sh @@ -41,6 +41,8 @@ rm anaconda.sh rm $LOG_PATH -rm -rf "$HOME/anaconda3/pkgs/*" +sudo rm -rf "$HOME/anaconda3/pkgs" + +mkdir "$HOME/anaconda3/pkgs" rm -rf "$HOME/.conda" "$HOME/.cache" diff --git a/Docker/setup.sh b/Docker/setup.sh index 14f4d8f2..392a8043 100644 --- a/Docker/setup.sh +++ b/Docker/setup.sh @@ -52,6 +52,12 @@ conda config --add channels conda-forge conda update --all -y +if [ "$CUDA_VERSION" = 128 ]; then + pip install torch torchaudio --no-cache-dir --index-url https://download.pytorch.org/whl/cu128 +elif [ "$CUDA_VERSION" = 124 ]; then + pip install torch==2.5.1 torchaudio==2.5.1 --no-cache-dir --index-url https://download.pytorch.org/whl/cu124 +fi + if [ "$LITE" = "true" ]; then bash install.sh --device "CU${CUDA_VERSION//./}" --source HF elif [ "$LITE" = "false" ]; then @@ -66,6 +72,8 @@ pip show torch rm -rf /tmp/* /var/tmp/* -rm -rf "$HOME/anaconda3/pkgs/*" +sudo rm -rf "$HOME/anaconda3/pkgs" + +mkdir "$HOME/anaconda3/pkgs" rm -rf /root/.conda /root/.cache diff --git a/Dockerfile b/Dockerfile index ccab9b9f..ed53883d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,7 +38,6 @@ ENV WORKFLOW=${WORKFLOW} ARG TARGETPLATFORM ENV TARGETPLATFORM=${TARGETPLATFORM} -RUN echo "${TARGETPLATFORM}" && echo ${WORKFLOW} ENV HOME="/root" diff --git a/docker_build.sh b/docker_build.sh index ea4960cd..88bf1a3c 100644 --- a/docker_build.sh +++ b/docker_build.sh @@ -70,6 +70,6 @@ TARGETPLATFORM=$(uname -m | grep -q 'x86_64' && echo "linux/amd64" || echo "linu docker build \ --build-arg CUDA_VERSION=$CUDA_VERSION \ --build-arg LITE=$LITE \ - --build-arg TARGETPLATFORM="$TARGETPLATFORM" --t "${USER}/gpt-sovits:local" \ + --build-arg TARGETPLATFORM="$TARGETPLATFORM" \ + -t "${USER}/gpt-sovits:local" \ . diff --git a/install.sh b/install.sh index 67c59ffb..30ed3ca0 100644 --- a/install.sh +++ b/install.sh @@ -226,14 +226,14 @@ if [ "$USE_ROCM" = true ] && [ "$WORKFLOW" = false ]; then fi fi -if [ "$USE_CUDA" = true ]; then +if [ "$USE_CUDA" = true ] && [ "$WORKFLOW" = false ]; then echo "Installing PyTorch with CUDA support..." if [ "$CUDA_VERSION" = 128 ]; then pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu128 elif [ "$CUDA_VERSION" = 124 ]; then pip install torch==2.5.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu124 fi -elif [ "$USE_ROCM" = true ]; then +elif [ "$USE_ROCM" = true ] && [ "$WORKFLOW" = false ]; then echo "Installing PyTorch with ROCm support..." pip install torch==2.5.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/rocm6.2 elif [ "$USE_CPU" = true ]; then