handle updated gemma templates

This commit is contained in:
Concedo 2026-04-14 00:29:58 +08:00
parent 3f810dc8c7
commit ae60ea0009
3 changed files with 3 additions and 3 deletions

View file

@ -3860,7 +3860,7 @@ generation_outputs gpttype_generate(const generation_inputs inputs)
// For the record, the GLM4 one didn't break anyone and everyone forgot GLM4 needed this :D
if (file_format == FileFormat::GGUF_GENERIC && (file_format_meta.model_architecture == llm_arch::LLM_ARCH_GEMMA4)) {
std::string temp = gpttype_get_chat_template();
if (temp.find("<|channel>thought") != std::string::npos) {
if (temp.find("<|channel>thought\\n<channel|>") != std::string::npos) {
const std::string channel_open = "<|channel>";
const std::string channel_close = "<channel|>";
const std::string channel_prefix = channel_open + channel_close;

View file

@ -77,7 +77,7 @@
"assistant_end": "<end_of_turn>\n"
}
}, {
"search": ["<|turn>model","<|think|>","<|channel>thought"],
"search": ["<|turn>model","<|think|>","<|channel>thought\\n<channel|>"],
"name": "Google Gemma 4 (26B and 31B)",
"adapter": {
"system_start": "<|turn>system\n",

View file

@ -77,7 +77,7 @@
"assistant_end": "<end_of_turn>\n"
}
}, {
"search": ["<|turn>model","<|think|>","<|channel>thought"],
"search": ["<|turn>model","<|think|>","<|channel>thought\\n<channel|>"],
"name": "Google Gemma 4 (26B and 31B)",
"adapter": {
"system_start": "<|turn>system\n",