mirror of
https://github.com/tcsenpai/ollama.git
synced 2025-06-06 19:25:21 +00:00
10 lines
390 B
Go Template
10 lines
390 B
Go Template
{{- if .Messages }}
|
|
{{- range $index, $_ := .Messages }}
|
|
{{- if eq .Role "user" }}[INST] {{ if and $.System (eq (len (slice $.Messages $index)) 1) }}{{ $.System }}
|
|
{{ end }}{{ .Content }}
|
|
{{- else if eq .Role "assistant" }}[/INST] {{ .Content }}</s>
|
|
{{- end }}
|
|
{{- end }}[/INST]
|
|
{{- else -}}
|
|
[INST] {{ if .System }}{{ .System }} {{ end }}{{ .Prompt }}[/INST] {{ .Response }}</s>
|
|
{{- end -}} |