-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·60 lines (48 loc) · 1.37 KB
/
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
#set -eo pipefail
if [ -z "$OPENAI_API_KEY" ]; then
echo "OPENAI_API_KEY is not set"
return
fi
if [ -z "$(which jq)" ]; then
echo "Missing jq tool, install from https://jqlang.github.io/jq/"
return
fi
if [ ! -f "./scripts/floats-to-blob" ]; then
echo "Compiling floats-to-blob"
gcc -o ./scripts/floats-to-blob ./assets/floats-to-blob.c
fi
if [ ! -f "./scripts/floats-to-hex" ]; then
echo "Compiling floats-to-hex"
gcc -o ./scripts/floats-to-hex ./assets/floats-to-hex.c
fi
base_path="$(realpath "$(dirname "$0")")"
export REDIS_PORT=6879
docker compose up -d
all_alias=(
emb=embeddings.sh
mm-emb=embeddings.sh
embed=embeddings.sh
dist=distance.sh
mm-dist=distance.sh
distance=distance.sh
rd=redis.sh
mm-rd=redis.sh
ask=ask.sh
session=session.sh
)
echo "\nAlias:"
for i in "${all_alias[@]}" ; do
alias_name=$(echo $i | cut -d'=' -f1)
alias_cmd=$(echo $i | cut -d'=' -f2)
echo ${alias_name} = ${alias_cmd}
alias $alias_name="$base_path/scripts/$alias_cmd"
done
#alias emb=/scripts/embeddings.sh
#alias mm-emb=$base_path/scripts/embeddings.sh
#alias embed=$base_path/scripts/embeddings.sh
#alias dist=$base_path/scripts/distance.sh
#alias mm-dist=$base_path/scripts/distance.sh
#alias distance=$base_path/scripts/distance.sh
#alias rd=$base_path/scripts/redis.sh
#alias red=$base_path/scripts/redis.sh
#alias mm-rd=$base_path/scripts/redis.sh