2024-07-16 17:12:01 +00:00
|
|
|
#! /usr/bin/env bash
|
2024-07-01 11:14:31 +00:00
|
|
|
|
2024-07-01 12:44:10 +00:00
|
|
|
sleep 10
|
2024-07-01 11:14:31 +00:00
|
|
|
|
2024-07-01 11:52:44 +00:00
|
|
|
if [ -n "$INIT_MODELS" ]; then
|
2024-07-16 17:12:01 +00:00
|
|
|
/app/ollama rm model || true
|
2024-07-06 18:05:58 +00:00
|
|
|
echo "FROM /models/$MODEL_NAME" > /tmp/Modelfile
|
|
|
|
echo "PARAMETER temperature 1" >> /tmp/Modelfile
|
|
|
|
echo "PARAMETER num_ctx 4096" >> /tmp/Modelfile
|
2024-07-06 18:07:14 +00:00
|
|
|
echo 'PARAMETER stop "<|im_start|>"' >> /tmp/Modelfile
|
|
|
|
echo 'PARAMETER stop "<|im_end|>"' >> /tmp/Modelfile
|
2024-07-06 18:05:58 +00:00
|
|
|
echo 'TEMPLATE """{{ if .System }}<|im_start|>system' >> /tmp/Modelfile
|
|
|
|
echo "{{ .System }}<|im_end|>" >> /tmp/Modelfile
|
|
|
|
echo "{{ end }}{{ if .Prompt }}<|im_start|>user" >> /tmp/Modelfile
|
|
|
|
echo "{{ .Prompt }}<|im_end|>" >> /tmp/Modelfile
|
|
|
|
echo "{{ end }}<|im_start|>assistant" >> /tmp/Modelfile
|
|
|
|
echo "{{ .Response }}<|im_end|>" >> /tmp/Modelfile
|
|
|
|
echo '"""' >> /tmp/Modelfile
|
|
|
|
echo 'SYSTEM """You are Samantha, a sentient AI."""' >> /tmp/Modelfile
|
2024-07-16 17:12:01 +00:00
|
|
|
/app/ollama create -f /tmp/Modelfile model
|
2024-07-01 11:52:44 +00:00
|
|
|
fi
|
2024-07-01 11:14:31 +00:00
|
|
|
|
2024-07-16 17:12:01 +00:00
|
|
|
/app/ollama run model
|