mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-11 09:34:37 +00:00
fix occasional clip segfault, fix glm4 (+1 squashed commits)
Squashed commits: [bd71cd688] GLM4 fix wip
This commit is contained in:
parent
e659cadf48
commit
4d8a7a6594
5 changed files with 28 additions and 12 deletions
|
@ -1663,7 +1663,7 @@ struct clip_model_loader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool handle_older_qwen25vl(projector_type & proj_type)
|
bool should_upgrade_older_qwen25vl(projector_type proj_type)
|
||||||
{
|
{
|
||||||
bool check1 = false;
|
bool check1 = false;
|
||||||
bool check2 = false;
|
bool check2 = false;
|
||||||
|
@ -1672,7 +1672,6 @@ struct clip_model_loader {
|
||||||
if(proj_type==PROJECTOR_TYPE_QWEN2VL && check1 && check2)
|
if(proj_type==PROJECTOR_TYPE_QWEN2VL && check1 && check2)
|
||||||
{
|
{
|
||||||
printf("\nWARNING: OLD QWEN2.5VL PROJECTOR DETECTED! Trying to patch in support, but please obtain a new Qwen2.5VL Projector!\n\n");
|
printf("\nWARNING: OLD QWEN2.5VL PROJECTOR DETECTED! Trying to patch in support, but please obtain a new Qwen2.5VL Projector!\n\n");
|
||||||
proj_type = PROJECTOR_TYPE_QWEN25VL;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1717,7 +1716,11 @@ struct clip_model_loader {
|
||||||
|| ctx_clip.proj_type == PROJECTOR_TYPE_LDP
|
|| ctx_clip.proj_type == PROJECTOR_TYPE_LDP
|
||||||
|| ctx_clip.proj_type == PROJECTOR_TYPE_LDPV2;
|
|| ctx_clip.proj_type == PROJECTOR_TYPE_LDPV2;
|
||||||
|
|
||||||
q25vl_migrated = handle_older_qwen25vl(ctx_clip.proj_type);
|
q25vl_migrated = should_upgrade_older_qwen25vl(ctx_clip.proj_type);
|
||||||
|
if(q25vl_migrated)
|
||||||
|
{
|
||||||
|
ctx_clip.proj_type = PROJECTOR_TYPE_QWEN25VL;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
std::string mm_patch_merge_type;
|
std::string mm_patch_merge_type;
|
||||||
|
|
|
@ -1917,7 +1917,7 @@ ModelLoadResult gpttype_load_model(const load_model_inputs inputs, FileFormat in
|
||||||
add_bos_token = !inputs.no_bos_token;
|
add_bos_token = !inputs.no_bos_token;
|
||||||
if(!add_bos_token)
|
if(!add_bos_token)
|
||||||
{
|
{
|
||||||
printf("\n======\nBOS token prefix was disabled! Your output may be degraded!\n======\n");
|
printf("\n======\nBOS token prefix was disabled! Your output may be degraded unless model was designed for it!\n======\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
neox_ctx_v2.hparams.n_ctx = neox_ctx_v3.hparams.n_ctx
|
neox_ctx_v2.hparams.n_ctx = neox_ctx_v3.hparams.n_ctx
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
"search": ["[gMASK]<sop>"],
|
"search": ["[gMASK]<sop>"],
|
||||||
"name": "GLM-4",
|
"name": "GLM-4",
|
||||||
"adapter": {
|
"adapter": {
|
||||||
"chat_start": "[gMASK]<sop>",
|
"chat_start": "<sop>",
|
||||||
"system_start": "<|system|>\n",
|
"system_start": "<|system|>\n",
|
||||||
"system_end": "",
|
"system_end": "",
|
||||||
"user_start": "<|user|>\n",
|
"user_start": "<|user|>\n",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"system_start": "[gMASK]<sop><|system|>\n",
|
"system_start": "<|system|>\n",
|
||||||
"system_end": "",
|
"system_end": "",
|
||||||
"user_start": "<|user|>\n",
|
"user_start": "<|user|>\n",
|
||||||
"user_end": "",
|
"user_end": "",
|
||||||
|
|
13
klite.embd
13
klite.embd
|
@ -3450,6 +3450,16 @@ Current version indicated by LITEVER below.
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id":15,
|
"id":15,
|
||||||
|
"name":"GLM-4",
|
||||||
|
"user":"<|user|>\\n",
|
||||||
|
"user_end":"",
|
||||||
|
"assistant":"<|assistant|>",
|
||||||
|
"assistant_end":"",
|
||||||
|
"system":"<|system|>\\n",
|
||||||
|
"system_end":"",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":100,
|
||||||
"name":"KoboldCppAutomatic",
|
"name":"KoboldCppAutomatic",
|
||||||
"user":"{{[INPUT]}}",
|
"user":"{{[INPUT]}}",
|
||||||
"user_end":"",
|
"user_end":"",
|
||||||
|
@ -13736,6 +13746,8 @@ Current version indicated by LITEVER below.
|
||||||
newgen = ist + newgen + (addendtag?iet:"");
|
newgen = ist + newgen + (addendtag?iet:"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(addendtag)
|
||||||
|
{
|
||||||
if(localsettings.inject_jailbreak_instruct)
|
if(localsettings.inject_jailbreak_instruct)
|
||||||
{
|
{
|
||||||
newgen = newgen + localsettings.custom_jailbreak_text.replaceAll("\\n", "\n");
|
newgen = newgen + localsettings.custom_jailbreak_text.replaceAll("\\n", "\n");
|
||||||
|
@ -13745,6 +13757,7 @@ Current version indicated by LITEVER below.
|
||||||
newgen = newgen + localsettings.start_thinking_tag.replaceAll("\\n", "\n");
|
newgen = newgen + localsettings.start_thinking_tag.replaceAll("\\n", "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else //may be continuting existing instruction OR starting a brand new session. check if first action
|
else //may be continuting existing instruction OR starting a brand new session. check if first action
|
||||||
{
|
{
|
||||||
if (is_impersonate_user) {
|
if (is_impersonate_user) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue