-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
models(gallery): add mistral-0.3 and command-r, update functions (#2388)
* models(gallery): add mistral-0.3 and command-r, update functions Add also disable_parallel_new_lines to disable newlines in the JSON output when forcing parallel tools. Some models (like mistral) might be very sensible to that when being used for function calling. Signed-off-by: Ettore Di Giacinto <[email protected]> * models(gallery): add aya-23-8b Signed-off-by: Ettore Di Giacinto <[email protected]> --------- Signed-off-by: Ettore Di Giacinto <[email protected]>
- Loading branch information
Showing
12 changed files
with
266 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
name: "command-r" | ||
|
||
config_file: | | ||
context_size: 131072 | ||
stopwords: | ||
- "<|END_OF_TURN_TOKEN|>" | ||
function: | ||
# disable injecting the "answer" tool | ||
disable_no_action: true | ||
grammar: | ||
# This allows the grammar to also return messages | ||
mixed_mode: true | ||
# Not all models have a sketchpad or something to write thoughts on. | ||
# This one will OR reply to strings OR JSON, but not both in the same reply | ||
#no_mixed_free_string: true | ||
# Disable grammar | ||
# Base instructor model doesn't work well with grammars | ||
#disable: true | ||
disable_parallel_new_lines: true | ||
return_name_in_function_response: true | ||
replace_function_results: | ||
# Replace everything that is not JSON array or object | ||
- key: '(?s)^[^{\[]*' | ||
value: "" | ||
- key: '(?s)[^}\]]*$' | ||
value: "" | ||
# Convert single quotes to double quotes | ||
- key: "'([^']*?)'" | ||
value: "_DQUOTE_${1}_DQUOTE_" | ||
- key: '\\"' | ||
value: "__TEMP_QUOTE__" | ||
- key: "\'" | ||
value: "'" | ||
- key: "_DQUOTE_" | ||
value: '"' | ||
- key: "__TEMP_QUOTE__" | ||
value: '"' | ||
template: | ||
join_chat_messages_by_character: "" ## No newlines between messages | ||
chat: |- | ||
{{.Input -}}<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|> | ||
chat_message: |- | ||
{{if eq .RoleName "user" -}} | ||
<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{.Content}}<|END_OF_TURN_TOKEN|> | ||
{{- else if eq .RoleName "system" -}} | ||
<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{.Content}}<|END_OF_TURN_TOKEN|> | ||
{{- else if eq .RoleName "assistant" -}} | ||
<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{{.Content}}<|END_OF_TURN_TOKEN|> | ||
{{- else if eq .RoleName "tool" -}} | ||
<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{{.Content}}<|END_OF_TURN_TOKEN|> | ||
{{- else if .FunctionCall -}} | ||
<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{{toJson .FunctionCall}}}<|END_OF_TURN_TOKEN|> | ||
{{- end -}} | ||
completion: | | ||
{{.Input}} | ||
function: |- | ||
<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|> | ||
You are a function calling AI model, you can call the following functions: | ||
## Available Tools | ||
{{range .Functions}} | ||
- {"type": "function", "function": {"name": "{{.Name}}", "description": "{{.Description}}", "parameters": {{toJson .Parameters}} }} | ||
{{end}} | ||
When using a tool, reply with JSON, for instance {"name": "tool_name", "arguments": {"param1": "value1", "param2": "value2"}} | ||
<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{{.Input -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
name: "mistral-0.3" | ||
|
||
config_file: | | ||
context_size: 8192 | ||
mmap: true | ||
stopwords: | ||
- "<|im_end|>" | ||
- "<dummy32000>" | ||
- "</tool_call>" | ||
- "<|eot_id|>" | ||
- "<|end_of_text|>" | ||
- "</s>" | ||
- "[/TOOL_CALLS]" | ||
- "[/ACTIONS]" | ||
function: | ||
# disable injecting the "answer" tool | ||
disable_no_action: true | ||
grammar: | ||
# This allows the grammar to also return messages | ||
#mixed_mode: true | ||
# Not all models have a sketchpad or something to write thoughts on. | ||
# This one will OR reply to strings OR JSON, but not both in the same reply | ||
#no_mixed_free_string: true | ||
# Disable grammar | ||
# Base instructor model doesn't work well with grammars | ||
disable: true | ||
parallel_calls: true | ||
disable_parallel_new_lines: true | ||
return_name_in_function_response: true | ||
# Without grammar uncomment the lines below | ||
# Warning: this is relying only on the capability of the | ||
# LLM model to generate the correct function call. | ||
json_regex_match: | ||
- "(?s)\\[TOOL\\_CALLS\\](.*)" | ||
replace_function_results: | ||
# Replace everything that is not JSON array or object | ||
- key: '(?s)^[^{\[]*' | ||
value: "" | ||
- key: '(?s)[^}\]]*$' | ||
value: "" | ||
- key: "(?s)\\[TOOL\\_CALLS\\]" | ||
value: "" | ||
- key: "(?s)\\[\\/TOOL\\_CALLS\\]" | ||
value: "" | ||
template: | ||
join_chat_messages_by_character: "" ## No newlines between messages | ||
chat: | | ||
{{.Input -}} | ||
chat_message: |- | ||
{{if eq .RoleName "user" -}} | ||
[INST] {{.Content }} [/INST] | ||
{{- else if .FunctionCall -}} | ||
[TOOL_CALLS] {{toJson .FunctionCall}} [/TOOL_CALLS] | ||
{{- else if eq .RoleName "tool" -}} | ||
[TOOL_RESULTS] {{.Content}} [/TOOL_RESULTS] | ||
{{- else -}} | ||
{{ .Content -}} | ||
{{ end -}} | ||
completion: | | ||
{{.Input}} | ||
function: |- | ||
[AVAILABLE_TOOLS] [{{range .Functions}}{"type": "function", "function": {"name": "{{.Name}}", "description": "{{.Description}}", "parameters": {{toJson .Parameters}} }}{{end}} ] [/AVAILABLE_TOOLS]{{.Input }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.