mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-11-22 08:13:22 +01:00
Use CUDA-specific torch only on Linux, not mac
This commit is contained in:
parent
28338612fa
commit
0324deec60
@ -56,6 +56,13 @@ if [ -e "GFPGANv1.3.pth" ]; then mv GFPGANv1.3.pth ../models/gfpgan/; fi
|
||||
if [ -e "RealESRGAN_x4plus.pth" ]; then mv RealESRGAN_x4plus.pth ../models/realesrgan/; fi
|
||||
if [ -e "RealESRGAN_x4plus_anime_6B.pth" ]; then mv RealESRGAN_x4plus_anime_6B.pth ../models/realesrgan/; fi
|
||||
|
||||
OS_NAME=$(uname -s)
|
||||
case "${OS_NAME}" in
|
||||
Linux*) OS_NAME="linux";;
|
||||
Darwin*) OS_NAME="macos";;
|
||||
*) echo "Unknown OS: $OS_NAME! This script runs only on Linux or Mac" && exit
|
||||
esac
|
||||
|
||||
# install torch and torchvision
|
||||
if python ../scripts/check_modules.py torch torchvision; then
|
||||
echo "torch and torchvision have already been installed."
|
||||
@ -65,10 +72,18 @@ else
|
||||
export PYTHONNOUSERSITE=1
|
||||
export PYTHONPATH="$INSTALL_ENV_DIR/lib/python3.8/site-packages"
|
||||
|
||||
if python -m pip install --upgrade torch==1.13.1+cu116 torchvision==0.14.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116 ; then
|
||||
echo "Installed."
|
||||
else
|
||||
fail "torch install failed"
|
||||
if [ "$OS_NAME" == "linux" ]; then
|
||||
if python -m pip install --upgrade torch==1.13.1+cu116 torchvision==0.14.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116 ; then
|
||||
echo "Installed."
|
||||
else
|
||||
fail "torch install failed"
|
||||
fi
|
||||
elif [ "$OS_NAME" == "macos" ]; then
|
||||
if python -m pip install --upgrade torch==1.13.1 torchvision==0.14.1 ; then
|
||||
echo "Installed."
|
||||
else
|
||||
fail "torch install failed"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user