16 lines
No EOL
363 B
Go Template
16 lines
No EOL
363 B
Go Template
{{- if .Messages }}
|
|
{{- range $index, $_ := .Messages }}
|
|
{{- if eq .Role "user" }}[INST] {{ if eq $index 0 }}<<SYS>>
|
|
{{- if $.System }}
|
|
{{ $.System }}
|
|
{{ end }}<</SYS>>
|
|
|
|
{{ end }}{{ .Content }}
|
|
{{- else }} [/INST] {{ .Content }}</s><s>
|
|
{{- end }}
|
|
{{- end }} [/INST]
|
|
{{- else }}
|
|
[INST] <<SYS>>{{ .System }}<</SYS>>
|
|
|
|
{{ .Prompt }} [/INST] {{ .Response }}
|
|
{{- end }} |