24 lines
No EOL
412 B
Go Template
24 lines
No EOL
412 B
Go Template
{{- if .Messages }}
|
|
{{- if .System }}{{ .System }}
|
|
|
|
{{ end }}
|
|
{{- range .Messages }}
|
|
{{- if eq .Role "user" }}### Instruction
|
|
{{ .Content }}
|
|
|
|
{{ else if eq .Role "assistant" }}### Response
|
|
{{ .Content }}<|endoftext|>
|
|
|
|
{{ end }}
|
|
{{- end }}### Response
|
|
{{ else }}
|
|
{{ if .System }}{{ .System }}
|
|
|
|
{{ end }}{{ if .Prompt }}### Instruction
|
|
{{ .Prompt }}
|
|
|
|
|
|
{{ end }}### Response
|
|
{{ .Response }}<|endoftext|>
|
|
|
|
{{- end }} |