forked from RassilonSleeps/MagicPrompt-SD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaunch_linux.sh
37 lines (32 loc) · 944 Bytes
/
launch_linux.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
#!/usr/bin/env bash
function locate {
dirname -- "$( readlink -f -- "$0"; )"
}
cd $( locate )
if [[ -a $( locate )/venv/bin/activate ]]
then
source $( locate )/venv/bin/activate
elif [[ ! -d $( locate )/venv ]]
then
python3 -m venv $( locate )/venv
source $( locate )/venv/bin/activate
else
echo "Could not locate venv/bin/activate";
exit
fi
if [[ "$1" == "--jupyter" ]] || [[ "$1" == "--colab" ]]
then
python3 -m pip install -r notebook-requirements.txt | grep -v 'already satisfied'
elif [[ -z "$1" ]]
then
python3 -m pip install -r requirements.txt | grep -v 'already satisfied'
fi
if [[ "$1" == "--jupyter" ]]
then
python3 -m jupyter notebook MagicPrompt.ipynb --no-browser
elif [[ "$1" == "--colab" ]]
then
python3 -m jupyter notebook --no-browser --NotebookApp.allow_origin="https://colab.research.google.com" --port=8888 --NotebookApp.port_retries=0
else
python3 MagicPrompt.py
fi