mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-24 13:37:01 +02: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:
@@ -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|>"
|
||||
|
||||
Reference in New Issue
Block a user