-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitScript.bash
More file actions
executable file
·66 lines (59 loc) · 1.08 KB
/
Copy pathinitScript.bash
File metadata and controls
executable file
·66 lines (59 loc) · 1.08 KB
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
#!/bin/bash
LOG_FILE="/var/log/muse.log"
function start_jupyter {
jupyter notebook --allow-root --no-browser --port 8888 --ip=0.0.0.0
}
function start_ollama {
echo "Starting Ollama, any logs will be written to ${LOG_FILE}"
OLLAMA_MODELS=${HOME}/models ollama serve > ${LOG_FILE} 2>&1 &
while true; do
if curl -s http://localhost:11434 > /dev/null; then
break
fi
sleep 5
done
}
cd "${MUSE_HOME}" || exit 1
start_ollama
if [ "$1" == "deploy" ];
then
echo "Deploying"
start_jupyter
elif [ "$1" == "develop" ];
then
echo "Developing"
start_jupyter &
echo "Jupyter started"
bash
elif [ "$1" == "debug" ];
then
echo "Debugging"
bash
elif [ "$1" == "model" ];
then
echo "Fetching model"
i=1
while [[ "$i" != "0" ]]
do
echo "Pulling model: $2"
ollama pull "$2"
i=$?
echo $i
done
echo "Model fetched"
elif [ "$1" == "test" ];
then
echo "Testing"
hatch run test
if [ $? -ne 0 ]; then
echo "Tests failed"
exit 1
fi
echo "Tests passed"
exit 0
else
echo "Defaulting to develop"
start_jupyter &
echo "Jupyter started"
bash
fi