2 ms·
You can, although this is definitely "hard mode" when writing Modelfiles. Easier is to override SYSTEM which allows will customize the system prompt. SYSTEM "
by jmorgan 3y ago
You can, although this is definitely "hard mode" when writing Modelfiles.
Easier is to override SYSTEM which allows will customize the system prompt.
SYSTEM "You are an expert in writing python."
If you do want modify the template, you can start by looking at the "base images" https://github.com/jmorganca/ollama/blob/main/library/modelfiles/llama2 https://github.com/jmorganca/ollama/blob/main/library/modelf...
For example with Llama 2 as a base model, you can do this, but YMWV:
FROM llama2
TEMPLATE """
{{- if .First }}
<<SYS>>
A conversation between three friends
<</SYS>>
{{- end }}
Friend 1: hello
Friend 2: hey
Friend 3: {{ .Prompt }}
"""
edit: we're looking at how to make it easier so you don't need {{ .First }} to provide the system prompt on first message