18 lines
620 B
Bash
Executable file
18 lines
620 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 8192" >> /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
|