diff --git a/README.md b/README.md index 18bd5a9..e87fa22 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ This is a simple project to make hosting multiple AI tools easily on Linux with AMD GPUs using ROCM locally (without docker). +> [!WARNING] +> Currently rewriting this project to be more modular and easier to use. This is a work in progress. +> Instructions below outdated ! + To use you have to clone the repo run the install script for the service you want to use. ```bash diff --git a/background-removal-dis-rocm/.gitignore b/background-removal-dis-rocm/.gitignore deleted file mode 100644 index 70295cf..0000000 --- a/background-removal-dis-rocm/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -venv/ -webui/ diff --git a/background-removal-dis-rocm/install.sh b/background-removal-dis-rocm/install.sh deleted file mode 100755 index 0801369..0000000 --- a/background-removal-dis-rocm/install.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -source ../utils.sh -python_exec="$(pwd)/venv/bin/python3.10" - -# Function to install StableDiffusion -install_background_remover() { - # As no data is stored in the webui folder, we can re-run the installation process for updates - rm -R webui -f - - echo "Cloning webui..." - # original repo (hf): https://huggingface.co/spaces/ECCV2022/dis-background-removal/tree/main - git clone ssh://git@git.broillet.ch:222/Clone/dis-background-removal.git webui - - echo "Installing requirements..." - $python_exec -m pip install -r webui/requirements.txt - - echo "Cloning DIS repo" - git clone ssh://git@git.broillet.ch:222/Clone/DIS.git tmp-dis - mv tmp-dis/IS-Net/* webui/ - sudo rm -R tmp-dis - - echo "Finalizing..." - mkdir webui/saved_models -p - mv webui/isnet.pth webui/saved_models - sudo rm -R webui/.git - -} - -# Main function -main() { - prepare_env - - # Set it up - install_background_remover - - clean - - echo "BackgroundRemover installation complete." -} - -# Run main function -main diff --git a/background-removal-dis-rocm/run.sh b/background-removal-dis-rocm/run.sh deleted file mode 100755 index 11e3703..0000000 --- a/background-removal-dis-rocm/run.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -source ../utils.sh -python_exec="$(pwd)/venv/bin/python3.10" - -# Main function -main() { - # Create virtual environment - use_venv - - # Prints ROCM info with available GPUs - rocm-smi - - # Start BG-remover - cd webui/ - TORCH_BLAS_PREFER_HIPBLASLT=0 $python_exec app.py - -} - -main diff --git a/bitsandbytes-rocm-build/.gitignore b/bitsandbytes-rocm-build/.gitignore deleted file mode 100644 index ac099bf..0000000 --- a/bitsandbytes-rocm-build/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build_output/ diff --git a/bitsandbytes-rocm-build/Dockerfile b/bitsandbytes-rocm-build/Dockerfile deleted file mode 100644 index d53e64c..0000000 --- a/bitsandbytes-rocm-build/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM rocm/dev-ubuntu-22.04:6.1.2 - -ENV ROCM_ARCH="gfx1030" \ - TORCH_VERSION="rocm6.1" \ - DEBIAN_FRONTEND=noninteractive \ - PYTHONUNBUFFERED=1 \ - PYTHONIOENCODING=UTF-8 - -WORKDIR /tmp - -RUN apt-get update -y -RUN apt-get install -y wget git cron cmake make software-properties-common - -# Install python3.10 -RUN add-apt-repository ppa:deadsnakes/ppa -y && apt-get update -y -RUN apt-get install -y python3.10 python3.10-dev python3.10-venv - -ENV VIRTUAL_ENV=/opt/venv -RUN python3.10 -m venv $VIRTUAL_ENV -ENV PATH="$VIRTUAL_ENV/bin:$PATH" - -RUN pip3 install --upgrade pip wheel setuptools - -# Install pytorch for rocm -RUN pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/${TORCH_VERSION} - -# ROCM bitsandbytes -RUN apt-get install -y hipblas hipblaslt hiprand hipsparse hipcub rocthrust-dev -## Clone repo and install python requirements -RUN git clone --depth 1 -b multi-backend-refactor https://github.com/bitsandbytes-foundation/bitsandbytes.git -WORKDIR /tmp/bitsandbytes -RUN pip3 install -r requirements-dev.txt -## Build -RUN cmake -DCOMPUTE_BACKEND=hip -S . -DBNB_ROCM_ARCH=${ROCM_ARCH} -RUN make -RUN python3.10 setup.py bdist_wheel --universal - -# Cleanup -RUN apt-get clean && pip3 cache purge diff --git a/bitsandbytes-rocm-build/README.md b/bitsandbytes-rocm-build/README.md deleted file mode 100644 index 971b6ee..0000000 --- a/bitsandbytes-rocm-build/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# bitsandbytes-rocm-build-pip - -This is a simple script to help you build the latest bitsandbytes for rocm. -The official build process requires a lot of ROCM-related packages and can mess up your computer easily if you install the wrong packages. - -This creates a Docker image that builds the package and extract the built wheel file that you can then easily install using pip. - -```bash -./build.sh -./extract_build.sh -``` - -The wheel file will be in a folder named ``build_output/`` - -*You might also find one of my already built wheel in this folder or on the github releases page (may not be up to date)* diff --git a/bitsandbytes-rocm-build/bitsandbytes-0.43.3.dev0-cp310-cp310-linux_x86_64.whl b/bitsandbytes-rocm-build/bitsandbytes-0.43.3.dev0-cp310-cp310-linux_x86_64.whl deleted file mode 100644 index 2702b0e..0000000 Binary files a/bitsandbytes-rocm-build/bitsandbytes-0.43.3.dev0-cp310-cp310-linux_x86_64.whl and /dev/null differ diff --git a/bitsandbytes-rocm-build/build.sh b/bitsandbytes-rocm-build/build.sh deleted file mode 100755 index cd38e05..0000000 --- a/bitsandbytes-rocm-build/build.sh +++ /dev/null @@ -1 +0,0 @@ -docker build . -t 'bitsandbytes-rocm-build:6.1.2' -f Dockerfile diff --git a/bitsandbytes-rocm-build/extract_build.sh b/bitsandbytes-rocm-build/extract_build.sh deleted file mode 100755 index 41a684f..0000000 --- a/bitsandbytes-rocm-build/extract_build.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# Set variables -IMAGE_NAME="bitsandbytes-rocm-build:6.1.2" -CONTAINER_NAME="bitsandbytes-rocm-build" -FILE_IN_CONTAINER="/tmp/bitsandbytes/dist/" -FILE_ON_HOST="./build_output/" - -# Run the Docker container -docker run -d --name $CONTAINER_NAME $IMAGE_NAME - -# Check if the container is running -if [ "$(docker ps -q -f name=$CONTAINER_NAME)" ]; then - echo "Container $CONTAINER_NAME is running." - - # Copy the file from the container to the host - docker cp $CONTAINER_NAME:$FILE_IN_CONTAINER $FILE_ON_HOST - - if [ $? -eq 0 ]; then - echo "File copied successfully to $FILE_ON_HOST" - else - echo "Failed to copy file." - fi -else - echo "Failed to start container $CONTAINER_NAME." -fi - -docker stop $CONTAINER_NAME -docker rm $CONTAINER_NAME - -echo "Now you can install bitsandbytes locally using \"pip install\" with the file in the build_output/ folder" diff --git a/comfyui-rocm/.gitignore b/comfyui-rocm/.gitignore deleted file mode 100644 index 70cd356..0000000 --- a/comfyui-rocm/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -venv/ -webui/ -models/ -*.log \ No newline at end of file diff --git a/comfyui-rocm/install.sh b/comfyui-rocm/install.sh deleted file mode 100755 index afffafb..0000000 --- a/comfyui-rocm/install.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -source ../utils.sh -python_exec="$(pwd)/venv/bin/python3.10" - -NAME="ComfyUI" - -# Function to install/update -install() { - if [ -d "webui" ]; then - echo $NAME "is already installed. Updating..." - yes_or_no "Do you want to update $NAME?" && { - cd webui - git pull - echo "$NAME WebUI successfully updated." - } - - else - echo "Cloning $NAME repository..." - git clone https://github.com/comfyanonymous/ComfyUI.git webui - - echo "Running $NAME setup..." - $python_exec -m pip install -r webui/requirements.txt - - - cd webui/custom_nodes - - # Install manager - git clone https://github.com/ltdrdata/ComfyUI-Manager.git - - # Add GGUF support - git clone https://github.com/city96/ComfyUI-GGUF - $python_exec -m pip install --upgrade gguf numpy==1.26.4 - - # Add NF4 support - git clone https://github.com/comfyanonymous/ComfyUI_bitsandbytes_NF4.git - $python_exec -m pip install --upgrade ../../../bitsandbytes-rocm-build/bitsandbytes-0.43.3.dev0-cp310-cp310-linux_x86_64.whl # install bitsandbytes for rocm until it is available on pypi - - ln -s webui/models models - fi - -} - -# Main function -main() { - prepare_env - install - clean - echo "$NAME installation/update complete. Use ./run.sh to start" -} - -# Run main function -main diff --git a/comfyui-rocm/run.sh b/comfyui-rocm/run.sh deleted file mode 100755 index 923fb32..0000000 --- a/comfyui-rocm/run.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -source ../utils.sh -python_exec="$(pwd)/venv/bin/python3.10" - -# Main function -main() { - # Create virtual environment - use_venv - - # Prints ROCM info with available GPUs - rocm-smi - - # Start - TORCH_BLAS_PREFER_HIPBLASLT=0 $python_exec webui/main.py - -} - -main diff --git a/llama-cpp-python-rocm-build/.gitignore b/llama-cpp-python-rocm-build/.gitignore deleted file mode 100644 index ac099bf..0000000 --- a/llama-cpp-python-rocm-build/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build_output/ diff --git a/llama-cpp-python-rocm-build/Dockerfile b/llama-cpp-python-rocm-build/Dockerfile deleted file mode 100644 index e8dd209..0000000 --- a/llama-cpp-python-rocm-build/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM rocm/dev-ubuntu-22.04:6.1.2 - -ENV TORCH_VERSION="rocm6.1" \ - DEBIAN_FRONTEND=noninteractive \ - PYTHONUNBUFFERED=1 \ - PYTHONIOENCODING=UTF-8 \ - # for llama - CMAKE_ARGS="-DGGML_HIPBLAS=on" \ - FORCE_CMAKE=1 - -WORKDIR /tmp - -RUN apt-get update -y -RUN apt-get install -y wget git cron cmake make software-properties-common - -# Install python3.10 -RUN add-apt-repository ppa:deadsnakes/ppa -y && apt-get update -y -RUN apt-get install -y python3.10 python3.10-dev python3.10-venv - -ENV VIRTUAL_ENV=/opt/venv -RUN python3.10 -m venv $VIRTUAL_ENV -ENV PATH="$VIRTUAL_ENV/bin:$PATH" - -RUN pip3 install --upgrade pip wheel setuptools build - -# Install pytorch for rocm -RUN pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/${TORCH_VERSION} - -# ROCM llama-cpp-python -RUN apt-get install -y hipblas hipblaslt hiprand hipsparse hipcub rocthrust-dev -## Clone repo and install python requirements -RUN git clone --recurse-submodules https://github.com/abetlen/llama-cpp-python.git -WORKDIR /tmp/llama-cpp-python - -## Build -RUN python3.10 -m build --wheel - -# Cleanup -RUN apt-get clean && pip3 cache purge diff --git a/llama-cpp-python-rocm-build/README.md b/llama-cpp-python-rocm-build/README.md deleted file mode 100644 index 3c1cdd7..0000000 --- a/llama-cpp-python-rocm-build/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# llama-cpp-python-rocm-build-pip - -This is a simple script to help you build the latest llama-cpp-python for rocm. -The official build process requires a lot of ROCM-related packages and can mess up your computer easily if you install the wrong packages. - -This creates a Docker image that builds the package and extract the built wheel file that you can then easily install using pip. - -```bash -./build.sh -./extract_build.sh -``` - -The wheel file will be in a folder named ``build_output/`` - -*You might also find one of my already built wheel in this folder or on the github releases page (may not be up to date)* - diff --git a/llama-cpp-python-rocm-build/build.sh b/llama-cpp-python-rocm-build/build.sh deleted file mode 100755 index 3626f70..0000000 --- a/llama-cpp-python-rocm-build/build.sh +++ /dev/null @@ -1 +0,0 @@ -docker build . -t 'llama-cpp-python-rocm-build:6.1.2' -f Dockerfile diff --git a/llama-cpp-python-rocm-build/extract_build.sh b/llama-cpp-python-rocm-build/extract_build.sh deleted file mode 100755 index 96385a6..0000000 --- a/llama-cpp-python-rocm-build/extract_build.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# Set variables -IMAGE_NAME="llama-cpp-python-rocm-build:6.1.2" -CONTAINER_NAME="llama-cpp-python-rocm-build" -FILE_IN_CONTAINER="/tmp/llama-cpp-python/dist/" -FILE_ON_HOST="./build_output/" - -# Run the Docker container -docker run -d --name $CONTAINER_NAME $IMAGE_NAME - -# Check if the container is running -if [ "$(docker ps -q -f name=$CONTAINER_NAME)" ]; then - echo "Container $CONTAINER_NAME is running." - - # Copy the file from the container to the host - docker cp $CONTAINER_NAME:$FILE_IN_CONTAINER $FILE_ON_HOST - - if [ $? -eq 0 ]; then - echo "File copied successfully to $FILE_ON_HOST" - else - echo "Failed to copy file." - fi -else - echo "Failed to start container $CONTAINER_NAME." -fi - -docker stop $CONTAINER_NAME -docker rm $CONTAINER_NAME - -echo "Now you can install llama-cpp-python locally using \"pip install\" with the file in the build_output/ folder" diff --git a/stablediffusion-forge-rocm/.gitignore b/stablediffusion-forge-rocm/.gitignore deleted file mode 100644 index 4c452cd..0000000 --- a/stablediffusion-forge-rocm/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -venv/ -webui/ -models/ -outputs/ \ No newline at end of file diff --git a/stablediffusion-forge-rocm/install.sh b/stablediffusion-forge-rocm/install.sh deleted file mode 100755 index 176bbd7..0000000 --- a/stablediffusion-forge-rocm/install.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -source ../utils.sh -python_exec="$(pwd)/venv/bin/python3.10" - -# Function to install/update StableDiffusion -install_stablediffusionforge() { - if [ -d "webui" ]; then - echo "StableDiffusionForge repository already exists." - yes_or_no "Do you want to update StableDiffusionForge WebUI ?" && { - cd webui - git pull - echo "StableDiffusionForge WebUI successfully updated." - } - else - echo "Cloning StableDiffusionForge repository..." - git clone https://github.com/lllyasviel/stable-diffusion-webui-forge webui - - echo "Running StableDiffusionForge setup..." - $python_exec webui/launch.py --skip-torch-cuda-test --exit - - echo "Adding Flux NF4 support for ROCM" - $python_exec -m pip install --upgrade ../bitsandbytes-rocm-build/bitsandbytes-0.43.3.dev0-cp310-cp310-linux_x86_64.whl # install bitsandbytes for rocm until it is available on pypi - - ln -s webui/models models - ln -s webui/outputs outputs - fi - -} - -# Main function -main() { - prepare_env - - # Install StableDiffusionForge - install_stablediffusionforge - - clean - - echo "StableDiffusion installation/update complete. Use ./run.sh to start" -} - -# Run main function -main diff --git a/stablediffusion-forge-rocm/run.sh b/stablediffusion-forge-rocm/run.sh deleted file mode 100755 index 47198fe..0000000 --- a/stablediffusion-forge-rocm/run.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -source ../utils.sh -python_exec="$(pwd)/venv/bin/python3.10" - -# Main function -main() { - # Create virtual environment - use_venv - - # Prints ROCM info with available GPUs - rocm-smi - - # Start SD - TORCH_BLAS_PREFER_HIPBLASLT=0 $python_exec webui/launch.py --listen --enable-insecure-extension-access # --opt-split-attention - -} - -main diff --git a/stablediffusion-rocm/.gitignore b/stablediffusion-rocm/.gitignore deleted file mode 100644 index 4c452cd..0000000 --- a/stablediffusion-rocm/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -venv/ -webui/ -models/ -outputs/ \ No newline at end of file diff --git a/stablediffusion-rocm/install.sh b/stablediffusion-rocm/install.sh deleted file mode 100755 index a445ec1..0000000 --- a/stablediffusion-rocm/install.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -source ../utils.sh -python_exec="$(pwd)/venv/bin/python3.10" - -# Function to install/update StableDiffusion -install_stablediffusion() { - if [ -d "webui" ]; then - echo "StableDiffusion repository already exists." - yes_or_no "Do you want to update StableDiffusion WebUI (dev branch) ?" && { - cd webui - git pull - echo "StableDiffusion WebUI successfully updated." - } - else - echo "Cloning StableDiffusion repository..." - git clone -b dev https://github.com/AUTOMATIC1111/stable-diffusion-webui webui - - echo "Running StableDiffusion setup..." - $python_exec webui/launch.py --skip-torch-cuda-test --exit - - ln -s webui/models models - ln -s webui/outputs outputs - fi - -} - -# Main function -main() { - prepare_env - - # Install StableDiffusion - install_stablediffusion - - clean - - echo "StableDiffusion installation/update complete. Use ./run.sh to start" -} - -# Run main function -main diff --git a/stablediffusion-rocm/run.sh b/stablediffusion-rocm/run.sh deleted file mode 100755 index 70f9146..0000000 --- a/stablediffusion-rocm/run.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -source ../utils.sh -python_exec="$(pwd)/venv/bin/python3.10" - -# Main function -main() { - # Create virtual environment - use_venv - - # Prints ROCM info with available GPUs - rocm-smi - - # Start SD - TORCH_BLAS_PREFER_HIPBLASLT=0 $python_exec webui/launch.py --listen --enable-insecure-extension-access --opt-split-attention - -} - -main diff --git a/text-generation-rocm/.gitignore b/text-generation-rocm/.gitignore deleted file mode 100644 index 4c452cd..0000000 --- a/text-generation-rocm/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -venv/ -webui/ -models/ -outputs/ \ No newline at end of file diff --git a/text-generation-rocm/install.sh b/text-generation-rocm/install.sh deleted file mode 100755 index 9201d1a..0000000 --- a/text-generation-rocm/install.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -source ../utils.sh -python_exec="$(pwd)/venv/bin/python3.10" - -NAME="TextGeneration" - -# Function to install/update -install() { - if [ -d "webui" ]; then - echo $NAME "is already installed. Updating..." - yes_or_no "Do you want to update $NAME?" && { - cd webui - git pull - echo "$NAME WebUI successfully updated." - } - - else - # Add BnB - $python_exec -m pip install --upgrade https://github.com/M4TH1EU/ai-suite-rocm-local/releases/download/prebuilt-wheels-for-rocm/bitsandbytes-0.43.3-cp310-cp310-linux_x86_64.whl # install bitsandbytes for rocm until it is available on pypi - - # Add AutoGPTQ - $python_exec -m pip install auto-gptq --no-build-isolation --extra-index-url https://huggingface.github.io/autogptq-index/whl/rocm573/ - - # Add ExLlamav2 - $python_exec -m pip install https://github.com/turboderp/exllamav2/releases/download/v0.1.9/exllamav2-0.1.9+rocm6.1.torch2.4.0-cp310-cp310-linux_x86_64.whl - - # Add LlamaCPP - CMAKE_ARGS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python # cpu - # CMAKE_ARGS="-DGGML_HIPBLAS=on" FORCE_CMAKE=1 $python_exec -m pip install llama-cpp-python # gpu - - # llama cpp built with hipblas doesn't work unless the whole rocm stack is installed locally - # so for now, use llama with openblas (cpu) - -# main_venv_path=$(dirname $(python -c "import torch; print(torch.__file__)"))"/lib/" -# llama_lib_path="$(pwd)/venv/lib64/python3.10/site-packages/llama_cpp/lib" -# -# for file in "$main_venv_path"/*.so; do -# ln -s "$file" "$llama_lib_path/$(basename "$file")" -# done - -# ln -s "$llama_lib_path/libhipblas.so" "$llama_lib_path/libhipblas.so.1" -# ln -s "$llama_lib_path/libhipblas.so" "$llama_lib_path/libhipblas.so.2" -# ln -s "$llama_lib_path/librocblas.so" "$llama_lib_path/librocblas.so.3" -# ln -s "$llama_lib_path/librocblas.so" "$llama_lib_path/librocblas.so.4" -# ln -s "$llama_lib_path/libamdhip64.so" "$llama_lib_path/libamdhip64.so.5" -# ln -s "$llama_lib_path/libamdhip64.so" "$llama_lib_path/libamdhip64.so.6" - - - # Add Triton -# $python_exec -m pip install https://github.com/M4TH1EU/ai-suite-rocm-local/releases/download/prebuilt-wheels-for-rocm/llama_cpp_python-0.2.89-cp310-cp310-linux_x86_64.whl -# git clone https://github.com/ROCmSoftwarePlatform/triton.git .tritonrocm -# cd .tritonrocm/python -# $python_exec -m pip install ninja cmake; # build time dependencies -# $python_exec -m pip uninstall triton -y && $python_exec -m pip install -e . -# cd .. && sudo rm -R .tritonrocm - - echo "Cloning $NAME repository..." - git clone https://github.com/oobabooga/text-generation-webui.git webui - - echo "Running $NAME setup..." - - # For some reasons theses want to reinstall torch for nvidia instead of using the download for rocm so manually install them - sed -i '/accelerate/d' webui/requirements_amd.txt - sed -i '/lm_eval/d' webui/requirements_amd.txt - sed -i '/optimum/d' webui/requirements_amd.txt - sed -i '/autoawq/d' webui/requirements_amd.txt - sed -i '/llama_cpp_python/d' webui/requirements_amd.txt - - $python_exec -m pip install -r webui/requirements_amd.txt - - # only works after requirements_amd.txt is installed ??! - $python_exec -m pip install accelerate optimum - $python_exec -m pip install https://github.com/casper-hansen/AutoAWQ_kernels/releases/download/v0.0.7/autoawq_kernels-0.0.7+rocm571-cp310-cp310-linux_x86_64.whl --no-deps - $python_exec -m pip install https://github.com/casper-hansen/AutoAWQ/releases/download/v0.2.6/autoawq-0.2.6-cp310-cp310-linux_x86_64.whl --no-deps - $python_exec -m pip install lm_eval - ln -s webui/models models - fi - -} - -# Main function -main() { - prepare_env - install - clean - echo "$NAME installation/update complete. Use ./run.sh to start" -} - -# Run main function -main diff --git a/text-generation-rocm/run.sh b/text-generation-rocm/run.sh deleted file mode 100755 index 1abe6ab..0000000 --- a/text-generation-rocm/run.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -source ../utils.sh -python_exec="$(pwd)/venv/bin/python3.10" - -# Main function -main() { - # Create virtual environment - use_venv - - # Prints ROCM info with available GPUs - rocm-smi - - # Start - cd webui - TORCH_BLAS_PREFER_HIPBLASLT=0 $python_exec server.py --listen -} - -main diff --git a/xtts-rocm/.gitignore b/xtts-rocm/.gitignore deleted file mode 100644 index 70295cf..0000000 --- a/xtts-rocm/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -venv/ -webui/ diff --git a/xtts-rocm/install.sh b/xtts-rocm/install.sh deleted file mode 100755 index fb5f38f..0000000 --- a/xtts-rocm/install.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -source ../utils.sh -python_exec=venv/bin/python3.10 - -# Function to install/update StableDiffusion -install_xtts() { - if [ -d "webui" ]; then - echo "XTTS repository already exists. Skipping clone." - yes_or_no "Do you want to update XTTS WebUI ?" && { - cd webui - rm requirements_without_torch.txt - git pull - echo "XTTS WebUI successfully updated." - cd .. - } - else - echo "Cloning XTTS repository..." - git clone https://github.com/daswer123/xtts-webui webui - fi - - iconv -f UTF-16 -t UTF-8 webui/requirements.txt | grep -v 'torch' > webui/requirements_without_torch.txt - $python_exec -m pip install -r webui/requirements_without_torch.txt - - # Disable gpu for faster-whipser as ROCM isn't supported yet - sed -i 's/device = "cuda" if torch.cuda.is_available() else "cpu"/device = "cpu"/' webui/scripts/utils/formatter.py - sed -i 's/asr_model = WhisperModel(whisper_model, device=device, compute_type="float16")/asr_model = WhisperModel(whisper_model, device=device, compute_type="int8")/' webui/scripts/utils/formatter.py - - # Deepspeed and ninja (not working) - $python_exec -m pip install ninja deepspeed - # apt-get install -y ninja-build - - ln -S webui/models models -} - -# Main function -main() { - prepare_env - - # Install XTTS - install_xtts - - clean - - echo "XTTS installation/update complete." -} - -# Run main function -main diff --git a/xtts-rocm/run.sh b/xtts-rocm/run.sh deleted file mode 100755 index 2ae189c..0000000 --- a/xtts-rocm/run.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -source ../utils.sh -python_exec=venv/bin/python3.10 - -# Main function -main() { - # Create virtual environment - use_venv - - # Prints ROCM info with available GPUs - rocm-smi - - # Start XTTS - cd webui/ - TORCH_BLAS_PREFER_HIPBLASLT=0 ../$python_exec app.py --host 0.0.0.0 -v v2.0.3 -} - -main \ No newline at end of file