35 2 months ago

{{- if .Suffix }}<|fim▁begin|>{{ .Prompt }}<|fim▁hole|>{{ .Suffix }}<|fim▁end|>
{{- else if .Messages }}<|begin▁of▁sentence|>
{{- $system := "" }}
{{- range $i, $_ := .Messages }}
{{- if eq .Role "system" }}
{{- $system = printf "%s %s" $system .Content }}
{{- else if eq .Role "user" }}
{{- if $system }}{{ $system }}
{{ $system = "" }}
{{ end }}User: {{ .Content }}
{{ if eq (len (slice $.Messages $i)) 1 }}Assistant:
{{- end }}
{{- else if eq .Role "assistant" }}Assistant: {{ .Content }}<|end▁of▁sentence|>
{{- end }}
{{- end }}
{{- else }}
{{- if .System }}{{ .System }}
{{- end }}
{{- if .Prompt }}User: {{ .Prompt }}
{{- end }}Assistant:{{ .Response }}
{{- end }}