Skip to content

Commit 62165d5

Browse files
committed
models(gallery): add archfunctions template
Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent 7845988 commit 62165d5

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

gallery/arch-function.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
name: "chatml"
3+
4+
config_file: |
5+
mmap: true
6+
function:
7+
disable_no_action: true
8+
grammar:
9+
mixed_mode: false
10+
disable: true
11+
parallel_calls: true
12+
expect_strings_after_json: true
13+
json_regex_match:
14+
- "(?s)<tool_call>(.*?)</tool_call>"
15+
- "(?s)<tool_call>(.*)"
16+
capture_llm_results:
17+
- (?s)<scratchpad>(.*?)</scratchpad>
18+
replace_llm_results:
19+
- key: (?s)<scratchpad>(.*?)</scratchpad>
20+
value: ""
21+
template:
22+
chat_message: |
23+
<|im_start|>{{ .RoleName }}
24+
{{ if .FunctionCall -}}
25+
Function call:
26+
{{ else if eq .RoleName "tool" -}}
27+
Function response:
28+
{{ end -}}
29+
{{ if .Content -}}
30+
{{.Content }}
31+
{{ end -}}
32+
{{ if .FunctionCall -}}
33+
{{toJson .FunctionCall}}
34+
{{ end -}}<|im_end|>
35+
function: |
36+
<|im_start|>system
37+
# Tools
38+
39+
You may call one or more functions to assist with the user query.
40+
41+
You are provided with function signatures within <tools></tools> XML tags:
42+
<tools>
43+
{{range .Functions}}
44+
{'type': 'function', 'function': {'name': '{{.Name}}', 'description': '{{.Description}}', 'parameters': {{toJson .Parameters}} }}
45+
{{end}}
46+
</tools>
47+
For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
48+
<tool_call>
49+
{"name": <function-name>, "arguments": <args-json-object>}
50+
</tool_call>
51+
<|im_end|>
52+
{{.Input -}}
53+
<|im_start|>assistant
54+
chat: |
55+
{{.Input -}}
56+
<|im_start|>assistant
57+
completion: |
58+
{{.Input}}
59+
context_size: 4096
60+
f16: true
61+
stopwords:
62+
- '<|im_end|>'
63+
- '<dummy32000>'
64+
- '</s>'
65+
- "<|eot_id|>"
66+
- "<|end_of_text|>"

0 commit comments

Comments
 (0)