Merge branch 'staging' into sysprompt-divorce

3812e3bdcb0a09a13753f4710712a936ae6ed45b

Cohee <18619528+Cohee1207@users.noreply.github.com>

31 files changed, +2 -56Showing whitespace changes
default/content/presets/context/Adventure.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": false,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": true,
1110 "name": "Adventure"
1211}
default/content/presets/context/Alpaca-Single-Turn.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": false,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Alpaca-Single-Turn"
1211}
default/content/presets/context/Alpaca.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Alpaca"
1211}
default/content/presets/context/ChatML-Names.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "ChatML-Names"
1211}
default/content/presets/context/ChatML.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "ChatML"
1211}
default/content/presets/context/Command R.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Command R"
1211}
default/content/presets/context/Default.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Default"
1211}
default/content/presets/context/DreamGen Role-Play V1 ChatML.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": false,
88 "trim_sentences": true,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "DreamGen Role-Play V1 ChatML"
1211}
default/content/presets/context/DreamGen Role-Play V1 Llama3.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": false,
88 "trim_sentences": true,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "DreamGen Role-Play V1 Llama3"
1211}
default/content/presets/context/Gemma 2.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Gemma 2"
1211}
default/content/presets/context/Libra-32B.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Libra-32B"
1211}
default/content/presets/context/Lightning 1.1.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Lightning 1.1"
1211}
default/content/presets/context/Llama 2 Chat.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Llama 2 Chat"
1211}
default/content/presets/context/Llama 3 Instruct.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Llama 3 Instruct"
1211}
default/content/presets/context/Llama-3-Instruct-Names.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Llama-3-Instruct-Names"
1211}
default/content/presets/context/Minimalist.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Minimalist"
1211}
default/content/presets/context/Mistral V1.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Mistral V1"
1211}
default/content/presets/context/Mistral V2 & V3.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Mistral V2 & V3"
1211}
default/content/presets/context/Mistral V3-Tekken.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Mistral V3-Tekken"
1211}
default/content/presets/context/NovelAI.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "NovelAI"
1211}
default/content/presets/context/OldDefault.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "OldDefault"
1211}
default/content/presets/context/Phi.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Phi"
1211}
default/content/presets/context/Pygmalion.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Pygmalion"
1211}
default/content/presets/context/Story.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Story"
1211}
default/content/presets/context/Synthia.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "Synthia"
1211}
default/content/presets/context/simple-proxy-for-tavern.json+0 -1
@@ -6,7 +6,6 @@
66 "allow_jailbreak": false,
77 "always_force_name2": true,
88 "trim_sentences": false,
9- "include_newline": false,
109 "single_line": false,
1110 "name": "simple-proxy-for-tavern"
1211}
default/content/settings.json+0 -1
@@ -90,7 +90,6 @@
9090 "pin_examples": false,
9191 "strip_examples": false,
9292 "trim_sentences": false,
93- "include_newline": false,
9493 "always_force_name2": true,
9594 "user_prompt_bias": "",
9695 "show_user_prompt_bias": true,
public/index.html+0 -5
@@ -3260,11 +3260,6 @@
32603260 Trim Incomplete Sentences
32613261 </small>
32623262 </label>
3263- <!-- Add margin since this is a child of above -->
3264- <label class="checkbox_label indent20p" for="include_newline_checkbox">
3265- <input id="include_newline_checkbox" type="checkbox" />
3266- <small data-i18n="Include Newline">Include Newline</small>
3267- </label>
32683263 <label class="checkbox_label" title="Add Chat Start and Example Separator to a list of stopping strings." data-i18n="[title]Add Chat Start and Example Separator to a list of stopping strings.">
32693264 <input id="context_use_stop_strings" type="checkbox" />
32703265 <small data-i18n="Separators as Stop Strings">Separators as Stop Strings</small>
public/script.js+1 -1
@@ -5485,7 +5485,7 @@ export function cleanUpMessage(getMessage, isImpersonate, isContinue, displayInc
54855485 }
54865486
54875487 if (!displayIncompleteSentences && power_user.trim_sentences) {
54885488 getMessage = trimToEndSentence(getMessage, power_user.include_newline);
54895489 }
54905490
54915491 if (power_user.trim_spaces) {
public/scripts/power-user.js+0 -16
@@ -115,7 +115,6 @@ let power_user = {
115115 pin_examples: false,
116116 strip_examples: false,
117117 trim_sentences: false,
118- include_newline: false,
119118 always_force_name2: false,
120119 user_prompt_bias: '',
121120 show_user_prompt_bias: true,
@@ -321,7 +320,6 @@ const contextControls = [
321320 // Existing power user settings
322321 { id: 'always-force-name2-checkbox', property: 'always_force_name2', isCheckbox: true, isGlobalSetting: true, defaultValue: true },
323322 { id: 'trim_sentences_checkbox', property: 'trim_sentences', isCheckbox: true, isGlobalSetting: true, defaultValue: false },
324- { id: 'include_newline_checkbox', property: 'include_newline', isCheckbox: true, isGlobalSetting: true, defaultValue: false },
325323 { id: 'single_line', property: 'single_line', isCheckbox: true, isGlobalSetting: true, defaultValue: false },
326324];
327325
@@ -1491,7 +1489,6 @@ async function loadPowerUserSettings(settings, data) {
14911489 $('#collapse-newlines-checkbox').prop('checked', power_user.collapse_newlines);
14921490 $('#always-force-name2-checkbox').prop('checked', power_user.always_force_name2);
14931491 $('#trim_sentences_checkbox').prop('checked', power_user.trim_sentences);
1494- $('#include_newline_checkbox').prop('checked', power_user.include_newline);
14951492 $('#render_formulas').prop('checked', power_user.render_formulas);
14961493 $('#disable_group_trimming').prop('checked', power_user.disable_group_trimming);
14971494 $('#markdown_escape_strings').val(power_user.markdown_escape_strings);
@@ -3053,19 +3050,6 @@ $(document).ready(() => {
30533050 // if trim sentences is unchecked, include newline must be unchecked
30543051 $('#trim_sentences_checkbox').change(function () {
30553052 power_user.trim_sentences = !!$(this).prop('checked');
3056- if (!$(this).prop('checked')) {
3057- $('#include_newline_checkbox').prop('checked', false);
3058- power_user.include_newline = false;
3059- }
3060- saveSettingsDebounced();
3061- });
3062-
3063- $('#include_newline_checkbox').change(function () {
3064- power_user.include_newline = !!$(this).prop('checked');
3065- if ($(this).prop('checked')) {
3066- $('#trim_sentences_checkbox').prop('checked', true);
3067- power_user.trim_sentences = true;
3068- }
30693053 saveSettingsDebounced();
30703054 });
30713055
public/scripts/utils.js+1 -7
@@ -607,12 +607,11 @@ export function sortByCssOrder(a, b) {
607607/**
608608 * Trims a string to the end of a nearest sentence.
609609 * @param {string} input The string to trim.
610- * @param {boolean} include_newline Whether to include a newline character in the trimmed string.
611610 * @returns {string} The trimmed string.
612611 * @example
613612 * trimToEndSentence('Hello, world! I am from'); // 'Hello, world!'
614613 */
615614export function trimToEndSentence(input, include_newline = false) {
616615 if (!input) {
617616 return '';
618617 }
@@ -633,11 +632,6 @@ export function trimToEndSentence(input, include_newline = false) {
633632 }
634633 break;
635634 }
636-
637- if (include_newline && char === '\n') {
638- last = i;
639- break;
640- }
641635 }
642636
643637 if (last === -1) {