mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-04-28 03:30:20 +00:00
more template fixes for the gemma4 31b
This commit is contained in:
parent
1c834fcbd3
commit
a33eda3842
4 changed files with 9 additions and 6 deletions
|
|
@ -84,7 +84,8 @@
|
|||
"system_end": "<turn|>\n",
|
||||
"user_start": "<|turn>user\n",
|
||||
"user_end": "<turn|>\n",
|
||||
"assistant_start": "<|turn>model\n<|channel>thought\n<channel|>",
|
||||
"assistant_start": "<|turn>model\n",
|
||||
"assistant_gen": "<|turn>model\n<|channel>thought\n<channel|>",
|
||||
"assistant_end": "<turn|>\n"
|
||||
}
|
||||
}, {
|
||||
|
|
|
|||
|
|
@ -84,7 +84,8 @@
|
|||
"system_end": "<turn|>\n",
|
||||
"user_start": "<|turn>user\n",
|
||||
"user_end": "<turn|>\n",
|
||||
"assistant_start": "<|turn>model\n<|channel>thought\n<channel|>",
|
||||
"assistant_start": "<|turn>model\n",
|
||||
"assistant_gen": "<|turn>model\n<|channel>thought\n<channel|>",
|
||||
"assistant_end": "<turn|>\n"
|
||||
}
|
||||
}, {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
"system_end": "<turn|>\n",
|
||||
"user_start": "<|turn>user\n",
|
||||
"user_end": "<turn|>\n",
|
||||
"assistant_start": "<|turn>model\n<|channel>thought\n<channel|>",
|
||||
"assistant_start": "<|turn>model\n",
|
||||
"assistant_gen": "<|turn>model\n<|channel>thought\n<channel|>",
|
||||
"assistant_end": "<turn|>\n"
|
||||
}
|
||||
|
|
@ -3522,7 +3522,8 @@ ws ::= | " " | "\n" [ \t]{0,20}
|
|||
#tool calls only possible if forced, or if ending with assistant tag
|
||||
adapter_obj = {} if chatcompl_adapter is None else chatcompl_adapter
|
||||
assistant_message_start = adapter_obj.get("assistant_start", "\n### Response:\n")
|
||||
used_tool_json = determine_tool_json_to_use(genparams, genparams.get('prompt', ""), assistant_message_start, True)
|
||||
assistant_message_gen = adapter_obj.get("assistant_gen", assistant_message_start)
|
||||
used_tool_json = determine_tool_json_to_use(genparams, genparams.get('prompt', ""), assistant_message_gen, True)
|
||||
if used_tool_json and not genparams.get('grammar', ""):
|
||||
toolparamjson = None
|
||||
toolname = None
|
||||
|
|
@ -3542,8 +3543,7 @@ ws ::= | " " | "\n" [ \t]{0,20}
|
|||
except Exception:
|
||||
pass
|
||||
tool_json_formatting_instruction = f"\nPlease use the provided schema to fill the parameters to create a function call for {toolname}, in the following format: " + json.dumps([{"id": "call_001", "type": "function", "function": {"name": f"{toolname}", "arguments": {"first property key": "first property value", "second property key": "second property value"}}}], indent=0)
|
||||
genparams["prompt"] += f"\n\nJSON Schema:\n{used_tool_json}\n\n{tool_json_formatting_instruction}{assistant_message_start}"
|
||||
|
||||
genparams["prompt"] += f"\n\nJSON Schema:\n{used_tool_json}\n\n{tool_json_formatting_instruction}{assistant_message_gen}"
|
||||
|
||||
elif api_format==3 or api_format==4 or api_format==7:
|
||||
default_adapter = {} if chatcompl_adapter is None else chatcompl_adapter
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue