ollama/run_model.sh
baalajimaestro 79fc0dd4db
Fix the prompt
Signed-off-by: baalajimaestro <baalajimaestro@ptr.moe>
2024-11-10 23:58:17 +05:30

18 lines
622 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 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