Create template
Browse files
template
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{{- if .System }}{{ .System }}{{ end }}
|
2 |
+
{{- range $i, $_ := .Messages }}
|
3 |
+
{{- $last := eq (len (slice $.Messages $i)) 1}}
|
4 |
+
{{- if eq .Role "user" }}<|User|>{{ .Content }}
|
5 |
+
{{- else if eq .Role "assistant" }}<|Assistant|>
|
6 |
+
{{- if and $.IsThinkSet (and $last .Thinking) -}}
|
7 |
+
<think>
|
8 |
+
{{ .Thinking }}
|
9 |
+
</think>
|
10 |
+
{{- end }}{{ .Content }}{{- if not $last }}<|end▁of▁sentence|>{{- end }}
|
11 |
+
{{- end }}
|
12 |
+
{{- if and $last (ne .Role "assistant") }}<|Assistant|>
|
13 |
+
{{- if and $.IsThinkSet (not $.Think) -}}
|
14 |
+
<think>
|
15 |
+
|
16 |
+
</think>
|
17 |
+
|
18 |
+
{{ end }}
|
19 |
+
{{- end -}}
|
20 |
+
{{- end }}
|