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
|
2024-11-10 18:21:37 +00:00
|
|
|
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
|
2024-07-06 18:05:58 +00:00
|
|
|
echo '"""' >> /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
|