ollama/run_model.sh
baalajimaestro 87345eda1b
Ditch the runner container entirely and use build environment as the runner environment
Running the binary outside the build environment crashes with signal 127 and i am unable to debug why

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
2024-07-16 22:42:01 +05:30

23 lines
937 B
Bash
Executable file

#! /usr/bin/env bash
sleep 10
if [ -n "$INIT_MODELS" ]; then
/app/ollama rm model || true
echo "FROM /models/$MODEL_NAME" > /tmp/Modelfile
echo "PARAMETER temperature 1" >> /tmp/Modelfile
echo "PARAMETER num_ctx 4096" >> /tmp/Modelfile
echo 'PARAMETER stop "<|im_start|>"' >> /tmp/Modelfile
echo 'PARAMETER stop "<|im_end|>"' >> /tmp/Modelfile
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
/app/ollama create -f /tmp/Modelfile model
fi
/app/ollama run model