mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-10-03 11:35:46 +00:00
chat : Fix Muse Glimmer tool-call first parser error (#29242)
* Fix Muse Glimmer tool-call first parser error * Add test to verify * Condense patterns * remove test for trigger patterns
This commit is contained in:
parent
0ee9435b8f
commit
7ab4ee7baa
2 changed files with 9 additions and 1 deletions
|
|
@ -130,7 +130,7 @@ common_chat_params common_chat_params_init_muse_glimmer(const common_chat_templa
|
|||
});
|
||||
data.grammar_triggers = {
|
||||
{ COMMON_GRAMMAR_TRIGGER_TYPE_PATTERN,
|
||||
"<\\|start\\|>assistant( to=(?!self<\\|message\\|>)(?!user<\\|message\\|>)[^<]*?<\\|message\\|>)" },
|
||||
"(?:^|<\\|start\\|>assistant)( to=(?!self<\\|message\\|>)(?!user<\\|message\\|>)[^<]*?<\\|message\\|>)" },
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6357,6 +6357,14 @@ static void test_template_output_peg_parsers(bool detailed_debug) {
|
|||
.expect(message_assist)
|
||||
.run();
|
||||
|
||||
// A tool call as the first message of the turn: "<|start|>assistant" is the
|
||||
// generation prompt, so the output starts at " to=".
|
||||
tst.test(" to=special_function<|message|>" + call_markup)
|
||||
.tools({ special_function_tool })
|
||||
.reasoning_format(COMMON_REASONING_FORMAT_AUTO)
|
||||
.expect(message_assist_call)
|
||||
.run();
|
||||
|
||||
// "Inform then act": the model answers the user and calls a tool in ONE generation,
|
||||
// closing the answer with <|eom|>. The answer must stop there rather than swallow it.
|
||||
tst.test(" to=user<|message|>Hello, world!\nWhat's up?<|eom|>"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue