Skip to content

Commit 4930594

Browse files
committed
try disabling the gMask prefix for glm-4 completions
1 parent c64557a commit 4930594

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

gpttype_adapter.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,28 +3263,28 @@ generation_outputs gpttype_generate(const generation_inputs inputs)
32633263
}
32643264

32653265
//need to add a cursed hack to get coherency for GLM4, by ensuring injection for both sop and gmask
3266-
if (file_format == FileFormat::GGUF_GENERIC && file_format_meta.model_architecture == GGUFArch::ARCH_GLM4) {
3267-
std::string temp = gpttype_get_chat_template();
3268-
if (temp.find("[gMASK]<sop>") != std::string::npos) {
3269-
if (addedmemory == "") {
3270-
if (kcpp_data->prompt.rfind("[gMASK]", 0) == 0) { //check startswith
3271-
kcpp_data->prompt.erase(0, 7);
3272-
}
3273-
if (kcpp_data->prompt.rfind("<sop>", 0) == 0) { //check startswith
3274-
kcpp_data->prompt.erase(0, 5);
3275-
}
3276-
addedmemory = "[gMASK]<sop>";
3277-
} else {
3278-
if (addedmemory.rfind("[gMASK]", 0) == 0) { //check startswith
3279-
addedmemory.erase(0, 7);
3280-
}
3281-
if (addedmemory.rfind("<sop>", 0) == 0) { //check startswith
3282-
addedmemory.erase(0, 5);
3283-
}
3284-
addedmemory = "[gMASK]<sop>" + addedmemory;
3285-
}
3286-
}
3287-
}
3266+
// if (file_format == FileFormat::GGUF_GENERIC && file_format_meta.model_architecture == GGUFArch::ARCH_GLM4) {
3267+
// std::string temp = gpttype_get_chat_template();
3268+
// if (temp.find("[gMASK]<sop>") != std::string::npos) {
3269+
// if (addedmemory == "") {
3270+
// if (kcpp_data->prompt.rfind("[gMASK]", 0) == 0) { //check startswith
3271+
// kcpp_data->prompt.erase(0, 7);
3272+
// }
3273+
// if (kcpp_data->prompt.rfind("<sop>", 0) == 0) { //check startswith
3274+
// kcpp_data->prompt.erase(0, 5);
3275+
// }
3276+
// addedmemory = "[gMASK]<sop>";
3277+
// } else {
3278+
// if (addedmemory.rfind("[gMASK]", 0) == 0) { //check startswith
3279+
// addedmemory.erase(0, 7);
3280+
// }
3281+
// if (addedmemory.rfind("<sop>", 0) == 0) { //check startswith
3282+
// addedmemory.erase(0, 5);
3283+
// }
3284+
// addedmemory = "[gMASK]<sop>" + addedmemory;
3285+
// }
3286+
// }
3287+
// }
32883288

32893289
bool stream_sse = inputs.stream_sse;
32903290
bool allow_regular_prints = (!is_quiet && debugmode!=-1);

koboldcpp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4433,8 +4433,8 @@ def changed_gpu_choice_var(*args):
44334433
except Exception:
44344434
pass
44354435
else:
4436-
quick_gpuname_label.configure(text="")
4437-
gpuname_label.configure(text="")
4436+
quick_gpuname_label.configure(text="(dGPUs only, tensor split sets ratio)")
4437+
gpuname_label.configure(text="(dGPUs only, tensor split sets ratio)")
44384438

44394439
gpu_choice_var.trace("w", changed_gpu_choice_var)
44404440
gpulayers_var.trace("w", changed_gpulayers_estimate)

0 commit comments

Comments
 (0)