Skip to content

Commit a04effc

Browse files
committed
feat(start.sh): pull llm using ollama (if not built into container)
closes #35
1 parent da5c3f4 commit a04effc

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

start.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/bin/bash
22

3+
set -e
4+
35
if [[ $PUBLIC_KEY ]]
46
then
57
mkdir -p ~/.ssh
68
chmod 700 ~/.ssh
79
cd ~/.ssh
8-
echo $PUBLIC_KEY >> authorized_keys
10+
echo "$PUBLIC_KEY" >> authorized_keys
911
chmod 700 -R ~/.ssh
1012
cd /
1113
service ssh start
@@ -16,10 +18,17 @@ fi
1618
echo "Starting ollama"
1719
ollama serve &
1820

21+
while ! curl "$OLLAMA_URL"; do
22+
sleep 1
23+
done
24+
25+
echo "Pulling $OLLAMA_MODEL_NAME from ollama library"
26+
ollama pull "$OLLAMA_MODEL_NAME"
27+
1928
cd /workspace
2029

2130
echo "Starting api"
2231
uvicorn gswikichat:app --reload --host 0.0.0.0 --port 8000 &
2332

24-
echo "Sleeping..."
33+
echo "Ready"
2534
sleep infinity

0 commit comments

Comments
 (0)