File size: 364 Bytes
458a998
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

FROM .
TEMPLATE """{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- if eq .Role "assistant" }}<|turn>model
<|channel>thought
<channel|>{{ .Content }}{{ if not $last }}<turn|>
{{ end }}
{{- else }}<|turn>{{ .Role }}
{{ .Content }}<turn|>
{{ if $last }}<|turn>model
<|channel>thought
<channel|>{{ end }}
{{- end }}
{{- end }}"""