Create template
Browse files
template
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{{- range $i, $_ := .Messages }}
|
2 |
+
{{- if eq .Role "user" }}
|
3 |
+
{{- if and $.Tools (le (len (slice $.Messages $i)) 2) }}[AVAILABLE_TOOLS] {{ $.Tools }}[/AVAILABLE_TOOLS]
|
4 |
+
{{- end }}[INST] {{ if and $.System (eq (len (slice $.Messages $i)) 1) }}{{ $.System }}
|
5 |
+
|
6 |
+
{{ end }}{{ .Content }}[/INST]
|
7 |
+
{{- else if eq .Role "assistant" }}
|
8 |
+
{{- if .Content }} {{ .Content }}{{ if not (eq (len (slice $.Messages $i)) 1) }}</s>{{ end }}
|
9 |
+
{{- else if .ToolCalls }}[TOOL_CALLS] [
|
10 |
+
{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
|
11 |
+
{{- end }}]</s>
|
12 |
+
{{- end }}
|
13 |
+
{{- else if eq .Role "tool" }}[TOOL_RESULTS] {"content": {{ .Content }}} [/TOOL_RESULTS]
|
14 |
+
{{- end }}
|
15 |
+
{{- end }}
|