gemma3-instruct.gotmpl 363 B

12345678910111213
  1. {{- range $i, $_ := .Messages }}
  2. {{- $last := eq (len (slice $.Messages $i)) 1 }}
  3. {{- if eq .Role "user" }}<start_of_turn>user
  4. {{- if and (eq $i 1) $.System }}
  5. {{ $.System }}
  6. {{ end }}
  7. {{ .Content }}<end_of_turn>
  8. {{ else if eq .Role "assistant" }}<start_of_turn>model
  9. {{ .Content }}<end_of_turn>
  10. {{ end }}
  11. {{- if $last }}<start_of_turn>model
  12. {{ end }}
  13. {{- end }}