-
Notifications
You must be signed in to change notification settings - Fork 0
/
bmaltais-kohya_ss.sh
executable file
·83 lines (57 loc) · 1.42 KB
/
bmaltais-kohya_ss.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
set -e -u -o pipefail;
declare progname=${0##*/};
declare progpath=${0%/*};
pushd "${progpath}";
source common.sh;
declare tag;
declare parentdir=bmaltais/;
declare projectsubdir=kohya_ss/;
declare optupdate="false";
while getopts ":u" arg; do
case $arg in
u) # Update the codebase
optupdate="true";
;;
esac
done
aptinstall \
libgl1 \
libglib2.0-0 \
libgoogle-perftools-dev \
python3-pip \
python3-tk \
python3.10-venv;
cd "${progpath}";
./nvidia-cuda.sh;
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:/usr/lib/wsl/lib/:/usr/local/cuda/lib64/;
mkdir --parents --verbose "${rootdir}${parentdir}";
cd "${rootdir}${parentdir}";
if [ ! -d "${projectsubdir}" ]; then
optupdate="true";
git clone https://github.com/bmaltais/kohya_ss.git "${projectsubdir}";
fi
cd "${projectsubdir}";
if [ "${optupdate}" == "true" ]; then
git fetch --all;
git checkout master;
git pull;
fi
if [ ! -d venv ]; then
python3.10 -m venv venv/;
fi
source venv/bin/activate;
tag=$(git tag |
grep --extended-regexp --invert-match "(pre|RC)" |
sort --reverse --version-sort |
head --lines=1);
if [ "${optupdate}" == "true" ]; then
git checkout "${tag}";
fi
python -m pip install --upgrade pip;
python -m pip install scipy;
linkcentraldir "training-data" training-data/;
linklogsdir "${parentdir}${projectsubdir}" logs/;
linkmodelsdir "embeddings" embeddings/;
./setup.sh --no-git-update;
./gui.sh;