try disabling the gMask prefix for glm-4 completions

This commit is contained in:
Concedo 2025-05-21 16:47:08 +08:00
parent c64557a851
commit 49305942ab
2 changed files with 24 additions and 24 deletions

View file

@ -3263,28 +3263,28 @@ generation_outputs gpttype_generate(const generation_inputs inputs)
} }
//need to add a cursed hack to get coherency for GLM4, by ensuring injection for both sop and gmask //need to add a cursed hack to get coherency for GLM4, by ensuring injection for both sop and gmask
if (file_format == FileFormat::GGUF_GENERIC && file_format_meta.model_architecture == GGUFArch::ARCH_GLM4) { // if (file_format == FileFormat::GGUF_GENERIC && file_format_meta.model_architecture == GGUFArch::ARCH_GLM4) {
std::string temp = gpttype_get_chat_template(); // std::string temp = gpttype_get_chat_template();
if (temp.find("[gMASK]<sop>") != std::string::npos) { // if (temp.find("[gMASK]<sop>") != std::string::npos) {
if (addedmemory == "") { // if (addedmemory == "") {
if (kcpp_data->prompt.rfind("[gMASK]", 0) == 0) { //check startswith // if (kcpp_data->prompt.rfind("[gMASK]", 0) == 0) { //check startswith
kcpp_data->prompt.erase(0, 7); // kcpp_data->prompt.erase(0, 7);
} // }
if (kcpp_data->prompt.rfind("<sop>", 0) == 0) { //check startswith // if (kcpp_data->prompt.rfind("<sop>", 0) == 0) { //check startswith
kcpp_data->prompt.erase(0, 5); // kcpp_data->prompt.erase(0, 5);
} // }
addedmemory = "[gMASK]<sop>"; // addedmemory = "[gMASK]<sop>";
} else { // } else {
if (addedmemory.rfind("[gMASK]", 0) == 0) { //check startswith // if (addedmemory.rfind("[gMASK]", 0) == 0) { //check startswith
addedmemory.erase(0, 7); // addedmemory.erase(0, 7);
} // }
if (addedmemory.rfind("<sop>", 0) == 0) { //check startswith // if (addedmemory.rfind("<sop>", 0) == 0) { //check startswith
addedmemory.erase(0, 5); // addedmemory.erase(0, 5);
} // }
addedmemory = "[gMASK]<sop>" + addedmemory; // addedmemory = "[gMASK]<sop>" + addedmemory;
} // }
} // }
} // }
bool stream_sse = inputs.stream_sse; bool stream_sse = inputs.stream_sse;
bool allow_regular_prints = (!is_quiet && debugmode!=-1); bool allow_regular_prints = (!is_quiet && debugmode!=-1);

View file

@ -4433,8 +4433,8 @@ def show_gui():
except Exception: except Exception:
pass pass
else: else:
quick_gpuname_label.configure(text="") quick_gpuname_label.configure(text="(dGPUs only, tensor split sets ratio)")
gpuname_label.configure(text="") gpuname_label.configure(text="(dGPUs only, tensor split sets ratio)")
gpu_choice_var.trace("w", changed_gpu_choice_var) gpu_choice_var.trace("w", changed_gpu_choice_var)
gpulayers_var.trace("w", changed_gpulayers_estimate) gpulayers_var.trace("w", changed_gpulayers_estimate)