This commit is contained in:
XXXXRT666 2025-09-04 22:23:06 +08:00
parent fd1dd1622e
commit dead5ebd2c
2 changed files with 14 additions and 11 deletions

View File

@ -75,7 +75,7 @@ print_help() {
echo "Usage: bash install.sh [OPTIONS]"
echo ""
echo "Options:"
echo " --device CU126|CU128|ROCM|MPS|CPU Specify the Device (REQUIRED)"
echo " --device CU126|CU128|ROCM|MLX|CPU Specify the Device (REQUIRED)"
echo " --source HF|HF-Mirror|ModelScope Specify the model source (REQUIRED)"
echo " --download-uvr5 Enable downloading the UVR5 model"
echo " -h, --help Show this help message and exit"
@ -126,8 +126,8 @@ while [[ $# -gt 0 ]]; do
ROCM)
USE_ROCM=true
;;
MPS)
USE_MPS=true
MLX)
USE_MLX=true
;;
CPU)
USE_CPU=true
@ -157,7 +157,7 @@ while [[ $# -gt 0 ]]; do
esac
done
if ! $USE_CUDA && ! $USE_ROCM && ! $USE_MPS && ! $USE_CPU; then
if ! $USE_CUDA && ! $USE_ROCM && ! $USE_MLX && ! $USE_CPU; then
echo -e "${ERROR}Error: Device is REQUIRED"
echo ""
print_help
@ -329,28 +329,28 @@ if [ "$USE_CUDA" = true ] && [ "$WORKFLOW" = false ]; then
echo -r "${WARNING}CUDA 12.8 Is Not Supported By Current Driver"
fi
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 --index-url "https://download.pytorch.org/whl/cu128"
run_conda_quiet cuda-nvcc=12.8
elif [ "$CUDA" = 126 ]; then
if awk "BEGIN {exit !($CUDAVERSION < 12.6)}"; then
echo -r "${WARNING}CUDA 12.6 Is Not Supported By Current Driver"
fi
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 --index-url "https://download.pytorch.org/whl/cu126"
run_conda_quiet cuda-nvcc=12.6
fi
run_pip_quiet psutil ninja packaging wheel "setuptools>=42"
run_pip_quiet flash-attn -i https://xxxxrt666.github.io/PIP-Index/ --no-build-isolation
elif [ "$USE_MPS" = true ] && [ "$WORKFLOW" = false ]; then
echo -e "${INFO}Installing PyTorch For MPS..."
run_pip_quiet torch torchaudio --index-url "https://download.pytorch.org/whl/cpu"
elif [ "$USE_MLX" = true ] && [ "$WORKFLOW" = false ]; then
echo -e "${INFO}Installing MLX & PyTorch For MPS..."
run_pip_quiet torch --index-url "https://download.pytorch.org/whl/cpu"
run_pip_quiet mlx
elif [ "$USE_ROCM" = true ] && [ "$WORKFLOW" = false ]; then
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 --index-url "https://download.pytorch.org/whl/rocm6.2"
elif [ "$USE_CPU" = true ] && [ "$WORKFLOW" = false ]; then
echo -e "${INFO}Installing PyTorch For CPU..."
run_pip_quiet torch torchaudio --index-url "https://download.pytorch.org/whl/cpu"
run_pip_quiet torch --index-url "https://download.pytorch.org/whl/cpu"
elif [ "$WORKFLOW" = false ]; then
echo -e "${ERROR}Unknown Err"
exit 1
@ -361,6 +361,8 @@ echo -e "${INFO}Installing Python Dependencies From requirements.txt..."
hash -r
run_pip_quiet torchcodec
run_pip_quiet -r extra-req.txt --no-deps
run_pip_quiet -r requirements.txt

View File

@ -13,6 +13,7 @@ peft
py-cpuinfo
pypinyin
split-lang
torchaudio
transformers
tensorboard
ToJyutping