Sweaterdog commited on
Commit
c3fc951
·
verified ·
1 Parent(s): 0418c3a

Update modelfile

Browse files
Files changed (1) hide show
  1. modelfile +48 -3
modelfile CHANGED
@@ -6,11 +6,56 @@ PARAMETER top_k 0
6
  PARAMETER repeat_penalty 1.15
7
  PARAMETER num_ctx 8192
8
 
9
- TEMPLATE """{{ if .System }}<|im_start|>system
10
- {{ .System }}<|im_end|>
11
- {{ end }}{{ range .Messages }}<|im_start|>{{ .Role }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  {{ .Content }}<|im_end|>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  {{ end }}<|im_start|>assistant
 
14
  """
15
 
16
  SYSTEM """You are GRaPE Mini Beta, GRaPE stands for General Reasoning Agent for Project Exploration.
 
6
  PARAMETER repeat_penalty 1.15
7
  PARAMETER num_ctx 8192
8
 
9
+ TEMPLATE """{{- if .Messages }}
10
+ {{- if or .System .Tools }}<|im_start|>system
11
+ {{- if .System }}
12
+ {{ .System }}
13
+ {{- end }}
14
+ {{- if .Tools }}
15
+
16
+ # Tools
17
+
18
+ You may call one or more functions to assist with the user query.
19
+
20
+ You are provided with function signatures within <tools></tools> XML tags:
21
+ <tools>
22
+ {{- range .Tools }}
23
+ {"type": "function", "function": {{ .Function }}}
24
+ {{- end }}
25
+ </tools>
26
+
27
+ For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
28
+ <tool_call>
29
+ {"name": <function-name>, "arguments": <args-json-object>}
30
+ </tool_call>
31
+ {{- end }}<|im_end|>
32
+ {{ end }}
33
+ {{- range $i, $_ := .Messages }}
34
+ {{- $last := eq (len (slice $.Messages $i)) 1 -}}
35
+ {{- if eq .Role "user" }}<|im_start|>user
36
  {{ .Content }}<|im_end|>
37
+ {{ else if eq .Role "assistant" }}<|im_start|>assistant
38
+ {{ if .Content }}{{ .Content }}
39
+ {{- else if .ToolCalls }}<tool_call>
40
+ {{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
41
+ {{ end }}</tool_call>
42
+ {{- end }}{{ if not $last }}<|im_end|>
43
+ {{ end }}
44
+ {{- else if eq .Role "tool" }}<|im_start|>user
45
+ <tool_response>
46
+ {{ .Content }}
47
+ </tool_response><|im_end|>
48
+ {{ end }}
49
+ {{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
50
+ {{ end }}
51
+ {{- end }}
52
+ {{- else }}
53
+ {{- if .System }}<|im_start|>system
54
+ {{ .System }}<|im_end|>
55
+ {{ end }}{{ if .Prompt }}<|im_start|>user
56
+ {{ .Prompt }}<|im_end|>
57
  {{ end }}<|im_start|>assistant
58
+ {{ end }}{{ .Response }}{{ if .Response }}<|im_end|>{{ end }}
59
  """
60
 
61
  SYSTEM """You are GRaPE Mini Beta, GRaPE stands for General Reasoning Agent for Project Exploration.