Skip to content

Commit 1f4e66d

Browse files
authored
chore(model gallery): add specific message templates for llama3.2 based models (#4707)
* chore(model gallery): add specific message templates for llama3.2 based models Signed-off-by: Maximilian Kenfenheuer <[email protected]> * fix: yaml lint in llama3.2-quantized.yaml Signed-off-by: Maximilian Kenfenheuer <[email protected]> * fix: yaml lint in llama3.2-quantized.yaml Signed-off-by: Maximilian Kenfenheuer <[email protected]> --------- Signed-off-by: Maximilian Kenfenheuer <[email protected]>
1 parent a37b2c7 commit 1f4e66d

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

gallery/index.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@
839839
sha256: bac8e8c1d1d9d53cbdb148b8ff9ad378ddb392429207099e85b5aae3a43bff3d
840840
uri: huggingface://cstr/salamandra-7b-instruct-GGUF/salamandra-7b-instruct.Q4_K_M-f32.gguf
841841
- &llama32 ## llama3.2
842-
url: "github:mudler/LocalAI/gallery/llama3.1-instruct.yaml@master"
842+
url: "github:mudler/LocalAI/gallery/llama3.2-quantized.yaml@master"
843843
icon: https://avatars.githubusercontent.com/u/153379578
844844
license: llama3.2
845845
description: |

gallery/llama3.2-quantized.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
name: "llama3.2-quantized"
3+
4+
config_file: |
5+
mmap: true
6+
function:
7+
disable_no_action: true
8+
grammar:
9+
disable: true
10+
response_regex:
11+
- \[(?P<name>\w+)\((?P<arguments>.*)\)\]
12+
argument_regex:
13+
- (?P<key>[^ '\(=,]+)[='"]+(?P<value>[^=,"']+)['"]?
14+
template:
15+
chat: |
16+
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
17+
You are a helpful assistant<|eot_id|><|start_header_id|>user<|end_header_id|>
18+
{{.Input }}
19+
<|start_header_id|>assistant<|end_header_id|>
20+
chat_message: |
21+
<|start_header_id|>{{if eq .RoleName "assistant"}}assistant{{else if eq .RoleName "system"}}system{{else if eq .RoleName "tool"}}tool{{else if eq .RoleName "user"}}user{{end}}<|end_header_id|>
22+
{{ if .FunctionCall -}}
23+
{{ else if eq .RoleName "tool" -}}
24+
The Function was executed and the response was:
25+
{{ end -}}
26+
{{ if .Content -}}
27+
{{.Content -}}
28+
{{ else if .FunctionCall -}}
29+
{{ range .FunctionCall }}
30+
[{{.FunctionCall.Name}}({{.FunctionCall.Arguments}})]
31+
{{ end }}
32+
{{ end -}}
33+
<|eot_id|>
34+
completion: |
35+
{{.Input}}
36+
function: |
37+
<|start_header_id|>system<|end_header_id|>
38+
You are an expert in composing functions. You are given a question and a set of possible functions.
39+
Based on the question, you will need to make one or more function/tool calls to achieve the purpose.
40+
If none of the functions can be used, point it out. If the given question lacks the parameters required by the function, also point it out. You should only return the function call in tools call sections.
41+
If you decide to invoke any of the function(s), you MUST put it in the format as follows:
42+
[func_name1(params_name1=params_value1,params_name2=params_value2,...),func_name2(params_name1=params_value1,params_name2=params_value2,...)]
43+
You SHOULD NOT include any other text in the response.
44+
Here is a list of functions in JSON format that you can invoke.
45+
{{toJson .Functions}}
46+
<|eot_id|><|start_header_id|>user<|end_header_id|>
47+
{{.Input}}
48+
<|eot_id|><|start_header_id|>assistant<|end_header_id|>
49+
context_size: 8192
50+
f16: true
51+
stopwords:
52+
- <|im_end|>
53+
- <dummy32000>
54+
- "<|eot_id|>"
55+
- <|end_of_text|>

0 commit comments

Comments
 (0)