From 6c3fd5b685427df0d4272aae32d4daf5bb743b55 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Sat, 27 Apr 2024 18:01:13 +0800 Subject: [PATCH] updated lite (+2 squashed commit) Squashed commit: [d10a731e] update lite [2554b8e6] update docs --- kcpp_docs.embd | 7 ++ klite.embd | 179 ++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 153 insertions(+), 33 deletions(-) diff --git a/kcpp_docs.embd b/kcpp_docs.embd index 08a5b85f0..83a6708d6 100644 --- a/kcpp_docs.embd +++ b/kcpp_docs.embd @@ -203,6 +203,13 @@ "description": "KoboldCpp ONLY. If true, prints special tokens as text for GGUF models", "type": "boolean" }, + "banned_tokens": { + "description": "An array of string sequences to remove from model vocab. All matching tokens with matching substrings are removed.", + "items": { + "type": "string" + }, + "type": "array" + }, "logit_bias": { "default": {}, "description": "KoboldCpp ONLY. An dictionary of key-value pairs, which indicate the token IDs (int) and logit bias (float) to apply for that token. Up to 16 value can be provided.", diff --git a/klite.embd b/klite.embd index 3f33826ef..6edb9e3ad 100644 --- a/klite.embd +++ b/klite.embd @@ -3651,6 +3651,7 @@ Current version: 136 var personal_notes = ""; var logitbiasdict = {}; var regexreplace_data = []; + var placeholder_tags_data = []; const num_regex_rows = 4; var localsettings = { @@ -5103,6 +5104,7 @@ Current version: 136 new_save_storyobj.personal_notes = personal_notes; new_save_storyobj.logitbiasdict = JSON.parse(JSON.stringify(logitbiasdict)); new_save_storyobj.regexreplace_data = JSON.parse(JSON.stringify(regexreplace_data)); + new_save_storyobj.placeholder_tags_data = JSON.parse(JSON.stringify(placeholder_tags_data)); if (export_settings) { new_save_storyobj.savedsettings = JSON.parse(JSON.stringify(localsettings)); @@ -5276,6 +5278,7 @@ Current version: 136 let old_tokenbans = tokenbans; let old_notes = personal_notes; let old_regexreplace_data = regexreplace_data; + let old_placeholder_tags_data = placeholder_tags_data; //determine if oldui file or newui file format restart_new_game(false); @@ -5363,6 +5366,10 @@ Current version: 136 if (storyobj.regexreplace_data) { regexreplace_data = storyobj.regexreplace_data; } + if(storyobj.placeholder_tags_data) + { + placeholder_tags_data = storyobj.placeholder_tags_data; + } } else { //v2 load if(storyobj.prompt!="") @@ -5424,6 +5431,7 @@ Current version: 136 extrastopseq = old_extrastopseq; regexreplace_data = old_regexreplace_data; tokenbans = old_tokenbans; + placeholder_tags_data = old_placeholder_tags_data; } if (storyobj.savedsettings && storyobj.savedsettings != "") @@ -6756,7 +6764,7 @@ Current version: 136 function expand_tokens_section(targetid) { - let tablist = ["expandregexreplace","expandtokenbans","expandlogitbias"]; + let tablist = ["expandregexreplace","expandtokenbans","expandlogitbias","expandplaceholdertags"]; for(let i=0;i + Placeholder ?The placeholder to match against + Replacement ?The text to substitude on display. Actual context is unchanged. + `; + let regextable = document.getElementById("placeholder_replace_table"); + + let hardcoded1 = ["{{user}}","{{char}}","\\n{{[INPUT]}}\\n","\\n{{[OUTPUT]}}\\n"]; + let hardcoded2 = [localsettings.chatname,localsettings.chatopponent,localsettings.instruct_starttag,localsettings.instruct_endtag]; + + for(let i=0;i + ${hardcoded1[i]} + + + `; + } + + for(let i=0;i + + + + `; + } + + regextable.innerHTML = regextablehtml; + + document.getElementById("placeholder_tags2").checked = localsettings.placeholder_tags; + + for(let i=0;i" + match.substring(0,match.length-2).trim() + "

"; }); - // input = input.replaceAll(othernamesregex2, function(match) { - // return "{{botplaceholder}}

" + match.substring(0,match.length-2).trim() + "

"; - // }); } else { input = input.replaceAll(othernamesregex, "{{botplaceholder}}"); - //input = input.replaceAll(othernamesregex2, "{{botplaceholder}}"); } you = "{{userplaceholder}}"; @@ -15193,7 +15293,8 @@ Current version: 136 - + Language +
@@ -15450,8 +15551,8 @@ Current version: 136
Enter OpenAI-formatted logit bias dictionary. Each key is the integer token IDs and their values are the biases (-100.0 to 100.0). Leave blank to disable.
Input is a JSON object, reference here.
- - + +
@@ -15478,14 +15579,26 @@ Current version: 136 +
Placeholder Tags ?Configure automatic substitutions for placeholders in text. + +
+ + +