ollama/run_model.sh

19 lines
622 B
Bash
Raw Normal View History

#! /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 128000" >> /tmp/Modelfile
echo 'TEMPLATE """{{ if .Prompt }}<start_of_turn>user" >> /tmp/Modelfile
echo "{{ .Prompt }}<end_of_turn>" >> /tmp/Modelfile
echo "{{ end }}<start_of_turn>model" >> /tmp/Modelfile
echo "{{ .Response }}<end_of_turn>" >> /tmp/Modelfile
echo '"""' >> /tmp/Modelfile
/app/ollama create -f /tmp/Modelfile model
fi
/app/ollama run model