mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-10 15:57:04 +00:00
update templates to use messages
This commit is contained in:
@@ -1,8 +1,18 @@
|
||||
{{ if .System }}{{ .System }}
|
||||
{{- $system := "" }}
|
||||
{{- range .Messages }}
|
||||
{{- if eq .Role "system" }}
|
||||
{{- if not $system }}{{ $system = .Content }}
|
||||
{{- else }}{{ $system = printf "%s\n\n%s" $system .Content }}
|
||||
{{- end }}
|
||||
{{- else if eq .Role "user" }}
|
||||
{{- if $system }}{{ $system }}
|
||||
|
||||
{{ end }}{{ if .Prompt }}### Instruction
|
||||
{{ .Prompt }}
|
||||
{{ $system = "" }}
|
||||
{{- end }}### Instruction
|
||||
{{ .Content }}
|
||||
|
||||
{{ end }}### Response
|
||||
{{ .Response }}<|endoftext|>
|
||||
{{ else if eq .Role "assistant" }}### Response
|
||||
{{ .Content }}<|endoftext|>
|
||||
|
||||
{{ end }}
|
||||
{{- end }}### Response
|
||||
|
||||
Reference in New Issue
Block a user