-
Notifications
You must be signed in to change notification settings - Fork 3
/
run.sh
executable file
·44 lines (37 loc) · 1 KB
/
run.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
SHARE=false
while getopts ":s" opt; do
case ${opt} in
s ) # process option s
SHARE=true
;;
\? ) echo "Usage: cmd [-s]"
;;
esac
done
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "Setting up for macOS..."
export PYTORCH_ENABLE_MPS_FALLBACK=1
export MPS_DEVICE=mps
python3.10 -m venv illusion
source illusion/bin/activate
pip install --upgrade pip
pip install --upgrade setuptools wheel
pip install -r requirements.txt
pip uninstall -y torch torchvision
pip install --pre torch torchvision --extra-index-url https://download.pytorch.org/whl/nightly/cpu
else
echo "Setting up for Linux..."
python3.10 -m venv illusion
source illusion/bin/activate
pip install --upgrade pip
pip install --upgrade setuptools wheel
pip install -r requirements.txt
fi
if $SHARE; then
echo "Running with share option..."
python app.py --share
else
echo "Running without share option..."
python app.py
fi