mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-04-28 11:40:43 +00:00
Henk's Gemma4 31B Magic (#2096)
This commit is contained in:
parent
59f863746d
commit
4e30294cb1
1 changed files with 20 additions and 0 deletions
|
|
@ -3847,6 +3847,26 @@ generation_outputs gpttype_generate(const generation_inputs inputs)
|
|||
}
|
||||
}
|
||||
|
||||
// Round two, gemma4 boogalo
|
||||
// If it breaks your stuff you can blame me again (Or thank me because you can actually use gemma 31B stable now). - Henk
|
||||
// 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) {
|
||||
const std::string channel_open = "<|channel>";
|
||||
const std::string channel_close = "<channel|>";
|
||||
const std::string channel_prefix = channel_open + channel_close;
|
||||
|
||||
const bool has_open = kcpp_data->prompt.find(channel_open) != std::string::npos;
|
||||
const bool has_close = kcpp_data->prompt.find(channel_close) != std::string::npos;
|
||||
|
||||
// If neither opening nor closing tag is present anywhere, prepend both
|
||||
if (!has_open && !has_close) {
|
||||
kcpp_data->prompt = channel_prefix + kcpp_data->prompt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool stream_sse = inputs.stream_sse;
|
||||
bool allow_regular_prints = (!is_quiet && debugmode!=-1);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue