forked from crynux-ai/crynux-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_mac.sh
executable file
·63 lines (49 loc) · 1.15 KB
/
setup_mac.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
#!/bin/bash
# https://github.com/AnyLifeZLB/FaceVerificationSDK/blob/main/install_newest_mediapipe_on_macos.md
export SYSTEM_VERSION_COMPAT=0
# Must use arm64 version of Python
# CONDA_SUBDIR=osx-arm64 conda create -n crynux python=3.10
# python > 3.10.2 is required
arch=$(python3.10 -c "import platform;print(platform.uname())")
if [[ $arch == *"x86_64"* ]]; then
echo "Please use the python in arm64 arch"
exit 1
fi
# remove old env
if [ -d "venv" ]; then
rm -rf venv
fi
if [ -d "worker" ]; then
rm -rf worker
fi
# prepare the Web UI
cd src/webui
if [ -d "dist" ]; then
rm -rf dist
fi
yarn
yarn build
cd ../../
# prepare the server
python3.10 -m venv venv
source ./venv/bin/activate
pip install -r requirements_desktop.txt
pip install .
# prepare the worker
mkdir worker
cp crynux-worker/crynux_worker_process.py worker/
cd worker
python3.10 -m venv venv
source ./venv/bin/activate
cd ../stable-diffusion-task
pip install -r requirements_macos.txt
pip install .
cd ../gpt-task
pip install -r requirements_macos.txt
pip install .
cd ../crynux-worker
pip install -r requirements.txt
pip install .
# go back to server venv
cd ../
source ./venv/bin/activate