forked from aorumbayev/autogpt4all
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autogtp4all.sh
executable file
·70 lines (59 loc) · 1.7 KB
/
autogtp4all.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
#!/bin/bash
# Default URL
model_url="https://gpt4all.io/models/ggml-gpt4all-l13b-snoozy.bin"
# Default uninstall option
uninstall=false
# Help function
function display_help() {
echo "Usage: $0 [OPTIONS]"
echo
echo "Options:"
echo " --custom_model_url <URL> Specify a custom URL for the model download step."
echo " --uninstall Uninstall the projects from your local machine."
echo " --help Display this help message and exit."
echo
}
# Parse named arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--custom_model_url) model_url="$2"; shift ;;
--uninstall) uninstall=true ;;
--help) display_help; exit 0 ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift
done
if [ "$uninstall" = true ] ; then
echo "Uninstalling..."
rm -rf LocalAI
rm -rf Auto-GPT
exit 0
fi
# Check if the directory exists, if not clone the repository, else pull the latest changes
if [ ! -d "LocalAI" ]; then
git clone https://github.com/go-skynet/LocalAI
else
cd LocalAI
git pull
cd ..
fi
cd LocalAI
make build
# Only download the model if a custom URL is provided or if the model does not already exist
if [ ! -z "$2" ] || [ ! -f "models/gpt-3.5-turbo" ]; then
wget $model_url -O models/gpt-3.5-turbo
fi
cd ..
# Check if on macOS, if so install extra prerequisites using brew
if [[ "$OSTYPE" == "darwin"* ]]; then
brew install cmake go
fi
# Check if the directory exists, if not clone the repository, else pull the latest changes
if [ ! -d "Auto-GPT" ]; then
git clone -b stable https://github.com/Significant-Gravitas/Auto-GPT.git
cp .env.template Auto-GPT/.env
else
cd Auto-GPT
git pull
cd ..
fi