forked from LAION-AI/Open-Assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfull-dev-setup.sh
executable file
·36 lines (31 loc) · 1.41 KB
/
full-dev-setup.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
#!/bin/bash
# set MODEL_ID to first argument or default to distilgpt2
MODEL_ID=${1:-distilgpt2}
LOGLEVEL=${LOGLEVEL:-DEBUG}
# Creates a tmux window with splits for the individual services
tmux new-session -d -s "inference-dev-setup"
tmux send-keys "docker run --rm -it -p 5432:5432 -e POSTGRES_PASSWORD=postgres --name postgres postgres" C-m
tmux split-window -h
tmux send-keys "docker run --rm -it -p 6379:6379 --name redis redis" C-m
# only if model is not _lorem
if [ "$MODEL_ID" != "_lorem" ]; then
tmux split-window -h
tmux send-keys "docker run --rm -it -p 8001:80 -e MODEL_ID=distilgpt2 \
-v $HOME/.cache/huggingface:/root/.cache/huggingface \
--name text-generation-inference ghcr.io/yk/text-generation-inference" C-m
fi
tmux split-window -h
tmux send-keys "cd server" C-m
tmux send-keys "LOGURU_LEVEL=$LOGLEVEL DEBUG_API_KEYS='0000,0001' ALLOW_DEBUG_AUTH=True uvicorn main:app" C-m
tmux split-window -h
tmux send-keys "cd text-client" C-m
tmux send-keys "sleep 5" C-m
tmux send-keys "LOGURU_LEVEL=$LOGLEVEL python __main__.py --model-id=$MODEL_ID" C-m
tmux split-window -h
tmux send-keys "cd worker" C-m
tmux send-keys "LOGURU_LEVEL=$LOGLEVEL API_KEY=0000 MODEL_ID=$MODEL_ID python __main__.py" C-m
tmux split-window -v
tmux send-keys "cd worker" C-m
tmux send-keys "LOGURU_LEVEL=$LOGLEVEL API_KEY=0001 MODEL_ID=$MODEL_ID python __main__.py" C-m
tmux select-layout even-horizontal
tmux attach-session -t "inference-dev-setup"