danielhanchen commited on
Commit
24db642
·
verified ·
1 Parent(s): 5ff2162

Create template

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