From dfab7c1bf09b6fcdefcbc1b63610609312f5418c Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Wed, 12 Aug 2026 21:34:31 +0800 Subject: [PATCH] stop seq fix --- embd_res/klite.embd | 4 ++-- koboldcpp.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/embd_res/klite.embd b/embd_res/klite.embd index 62f771063..a5d03f444 100644 --- a/embd_res/klite.embd +++ b/embd_res/klite.embd @@ -20991,7 +20991,7 @@ Current version indicated by LITEVER below. let st = get_instruct_starttag(true); let et = get_instruct_endtag(true); let me = get_my_multiplayer_chatname(); - seqs = [st, et]; + seqs = [st]; //don't include the assistant tag, otherwise it breaks some think formats if(localsettings.separate_end_tags) { if(get_instruct_endtag_end(true)) @@ -21013,7 +21013,7 @@ Current version indicated by LITEVER below. //the model just gets too confused and is likely to repeat the tag. } } - //special case for GPT-OSS, never use it as a stop sequence or stuff gets messed + //special case for GPT-OSS and Muse Glimmer, never use it as a stop sequence or stuff gets messed seqs = seqs.filter(itm => !itm.includes("<|start|>assistant")); if(!localsettings.includedefaultstops) { diff --git a/koboldcpp.py b/koboldcpp.py index d5d5b84b6..6b038a33a 100644 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -4557,7 +4557,7 @@ ws ::= | " " | "\n" [ \t]{0,20} # openai allows either a string or a list as a stop sequence if genparams.get('stop',[]) is not None: if isinstance(genparams.get('stop',[]), list): - genparams["stop_sequence"] = genparams.get('stop', []) + genparams["stop_sequence"] = genparams.get('stop', genparams.get('stop_sequence', [])) else: genparams["stop_sequence"] = [genparams.get('stop')] @@ -4769,10 +4769,9 @@ ws ::= | " " | "\n" [ \t]{0,20} if len(audio_added)>0: genparams["audio"] = audio_added if len(genparams.get('stop_sequence', []))==0: #only set stop seq if it wont overwrite existing - genparams["stop_sequence"] = [user_message_start.strip(),assistant_message_start.strip()] + genparams["stop_sequence"] = [user_message_start.strip()] else: genparams["stop_sequence"].append(user_message_start.strip()) - genparams["stop_sequence"].append(assistant_message_start.strip()) if not used_tool_json and jinjatools and latest_turn_was_tool: genparams["stop_sequence"].append("(Made a function call") # qol prevent fake toolcalls genparams["trim_stop"] = True