-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebui_setup.sh
executable file
·80 lines (62 loc) · 2.7 KB
/
webui_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
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
#!/bin/bash
#Runpod setup directions here: https://www.youtube.com/watch?v=TP2yID7Ubr4
#You MUST set container image to runpod/oobabooga:1.1.0
#Set Disk size to at least 50GB
#Always use a fresh pod.
#git clone this file by default to /text-generation-webui
cd /text-generation-webui
# Ask the user if they are using "Silly Tavern"
read -p "Are you using a separate interface with TTS, such as silly tavern? (y/n) " SILLY_TAVERN
read -p "Stop installation on errors? Choose 'n' if simply re-installing. (y/n) " ERROR_STOP
# Stop on error?
if [[ "$ERROR_STOP" != "n" ]]
then
set -e
fi
# Update git repository
git pull
pip install -r requirements.txt
# Create repositories directory and clone GPTQ-for-LLaMa
mkdir -p repositories
cd repositories
git clone https://github.com/oobabooga/GPTQ-for-LLaMa.git -b cuda
cd GPTQ-for-LLaMa
python setup_cuda.py install
# Install additional Python dependencies
cd /text-generation-webui
pip install scipy
# Update system packages and install ffmpeg
apt-get update
apt-get install -y ffmpeg
# Install Python dependencies for each extension
cd extensions/elevenlabs_tts
pip install -r requirements.txt
cd /text-generation-webui/extensions/whisper_stt
pip install -r requirements.txt
cd /text-generation-webui/extensions/api
pip install -r requirements.txt
# Go back to text-generation-webui
cd /text-generation-webui
echo -e "\e[32mBypassing model load and Initializing server...\e[0m"
# Run server and get its PID
#Note: setting the model keeps ooba from autoloading pyg
if [ "$SILLY_TAVERN" = "y" ]
then
python server.py --share --public-api --api --trust-remote-code --chat --auto-devices --model llama --model_type llama --extension whisper_stt api &
else
python server.py --share --public-api --api --trust-remote-code --chat --auto-devices --model llama --model_type llama --extension whisper_stt elevenlabs_tts api &
fi
sleep 12
SERVER_PID=$!
echo -e "\e[32mServer_init PID is $SERVER_PID\e[0m"
echo -e "\e[32mStarting server... press Ctrl-C and re-run server.py if fails\e[0m"
kill $SERVER_PID
sleep 5
if [ "$SILLY_TAVERN" = "y" ]
then
echo -e "\e[32mrunning python server.py --share --public-api --api --trust-remote-code --chat --auto-devices --model_type llama --extension whisper_stt api\e[0m"
python server.py --share --public-api --api --trust-remote-code --chat --auto-devices --model llama --model_type llama --extension whisper_stt api
else
echo -e "\e[32mrunning python server.py --share --public-api --api --trust-remote-code --chat --auto-devices --model_type llama --extension whisper_stt elevenlabs_tts api\e[0m"
python server.py --share --public-api --api --trust-remote-code --chat --auto-devices model llama --model_type llama --extension whisper_stt elevenlabs_tts api
fi