-
Notifications
You must be signed in to change notification settings - Fork 16
/
install.sh
30 lines (24 loc) · 888 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
echo Starting DiffusionMagic env installation...
set -e
PYTHON_COMMAND="python3"
if ! command -v python3 &>/dev/null; then
if ! command -v python &>/dev/null; then
echo "Error: Python not found, please install python 3.8 or higher and try again"
exit 1
fi
fi
if command -v python &>/dev/null; then
PYTHON_COMMAND="python"
fi
echo "Found $PYTHON_COMMAND command"
python_version=$($PYTHON_COMMAND --version 2>&1 | awk '{print $2}')
echo "Python version : $python_version"
BASEDIR=$(pwd)
$PYTHON_COMMAND -m venv "$BASEDIR/env"
# shellcheck disable=SC1091
source "$BASEDIR/env/bin/activate"
pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu117
pip install -r "$BASEDIR/requirements.txt"
chmod +x "start.sh"
read -n1 -r -p "DiffusionMagic installation completed,press any key to continue..." key