mistral-instruct.gotmpl 390 B

12345678910
  1. {{- if .Messages }}
  2. {{- range $index, $_ := .Messages }}
  3. {{- if eq .Role "user" }}[INST] {{ if and $.System (eq (len (slice $.Messages $index)) 1) }}{{ $.System }}
  4. {{ end }}{{ .Content }}
  5. {{- else if eq .Role "assistant" }}[/INST] {{ .Content }}</s>
  6. {{- end }}
  7. {{- end }}[/INST]
  8. {{- else -}}
  9. [INST] {{ if .System }}{{ .System }} {{ end }}{{ .Prompt }}[/INST] {{ .Response }}</s>
  10. {{- end -}}