Remove "include newlines" checkbox from context formatting settings

a18dae8f69d245b468e5d760334cf60d1c31bf93

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

32 files changed, +2 -57Showing whitespace changes
default/content/presets/context/Adventure.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": false,7 "always_force_name2": false,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": true,9 "single_line": true,
11 "name": "Adventure"10 "name": "Adventure"
12}11}
default/content/presets/context/Alpaca-Roleplay.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Alpaca-Roleplay"10 "name": "Alpaca-Roleplay"
12}11}
default/content/presets/context/Alpaca-Single-Turn.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": false,7 "always_force_name2": false,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Alpaca-Single-Turn"10 "name": "Alpaca-Single-Turn"
12}11}
default/content/presets/context/Alpaca.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Alpaca"10 "name": "Alpaca"
12}11}
default/content/presets/context/ChatML-Names.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "ChatML-Names"10 "name": "ChatML-Names"
12}11}
default/content/presets/context/ChatML.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "ChatML"10 "name": "ChatML"
12}11}
default/content/presets/context/Command R.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Command R"10 "name": "Command R"
12}11}
default/content/presets/context/Default.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Default"10 "name": "Default"
12}11}
default/content/presets/context/DreamGen Role-Play V1 ChatML.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": false,7 "always_force_name2": false,
8 "trim_sentences": true,8 "trim_sentences": true,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "DreamGen Role-Play V1 ChatML"10 "name": "DreamGen Role-Play V1 ChatML"
12}11}
default/content/presets/context/DreamGen Role-Play V1 Llama3.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": false,7 "always_force_name2": false,
8 "trim_sentences": true,8 "trim_sentences": true,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "DreamGen Role-Play V1 Llama3"10 "name": "DreamGen Role-Play V1 Llama3"
12}11}
default/content/presets/context/Gemma 2.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Gemma 2"10 "name": "Gemma 2"
12}11}
default/content/presets/context/Libra-32B.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Libra-32B"10 "name": "Libra-32B"
12}11}
default/content/presets/context/Lightning 1.1.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Lightning 1.1"10 "name": "Lightning 1.1"
12}11}
default/content/presets/context/Llama 2 Chat.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Llama 2 Chat"10 "name": "Llama 2 Chat"
12}11}
default/content/presets/context/Llama 3 Instruct.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Llama 3 Instruct"10 "name": "Llama 3 Instruct"
12}11}
default/content/presets/context/Llama-3-Instruct-Names.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Llama-3-Instruct-Names"10 "name": "Llama-3-Instruct-Names"
12}11}
default/content/presets/context/Minimalist.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Minimalist"10 "name": "Minimalist"
12}11}
default/content/presets/context/Mistral V1.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Mistral V1"10 "name": "Mistral V1"
12}11}
default/content/presets/context/Mistral V2 & V3.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Mistral V2 & V3"10 "name": "Mistral V2 & V3"
12}11}
default/content/presets/context/Mistral V3-Tekken.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Mistral V3-Tekken"10 "name": "Mistral V3-Tekken"
12}11}
default/content/presets/context/NovelAI.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "NovelAI"10 "name": "NovelAI"
12}11}
default/content/presets/context/OldDefault.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "OldDefault"10 "name": "OldDefault"
12}11}
default/content/presets/context/Phi.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Phi"10 "name": "Phi"
12}11}
default/content/presets/context/Pygmalion.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Pygmalion"10 "name": "Pygmalion"
12}11}
default/content/presets/context/Story.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Story"10 "name": "Story"
12}11}
default/content/presets/context/Synthia.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "Synthia"10 "name": "Synthia"
12}11}
default/content/presets/context/simple-proxy-for-tavern.json+0 -1
@@ -6,7 +6,6 @@
6 "allow_jailbreak": false,6 "allow_jailbreak": false,
7 "always_force_name2": true,7 "always_force_name2": true,
8 "trim_sentences": false,8 "trim_sentences": false,
9 "include_newline": false,
10 "single_line": false,9 "single_line": false,
11 "name": "simple-proxy-for-tavern"10 "name": "simple-proxy-for-tavern"
12}11}
default/content/settings.json+0 -1
@@ -90,7 +90,6 @@
90 "pin_examples": false,90 "pin_examples": false,
91 "strip_examples": false,91 "strip_examples": false,
92 "trim_sentences": false,92 "trim_sentences": false,
93 "include_newline": false,
94 "always_force_name2": true,93 "always_force_name2": true,
95 "user_prompt_bias": "",94 "user_prompt_bias": "",
96 "show_user_prompt_bias": true,95 "show_user_prompt_bias": true,
public/index.html+0 -5
@@ -3251,11 +3251,6 @@
3251 Trim Incomplete Sentences3251 Trim Incomplete Sentences
3252 </small>3252 </small>
3253 </label>3253 </label>
3254 <!-- Add margin since this is a child of above -->
3255 <label class="checkbox_label indent20p" for="include_newline_checkbox">
3256 <input id="include_newline_checkbox" type="checkbox" />
3257 <small data-i18n="Include Newline">Include Newline</small>
3258 </label>
3259 <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.">3254 <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.">
3260 <input id="context_use_stop_strings" type="checkbox" />3255 <input id="context_use_stop_strings" type="checkbox" />
3261 <small data-i18n="Separators as Stop Strings">Separators as Stop Strings</small>3256 <small data-i18n="Separators as Stop Strings">Separators as Stop Strings</small>
public/script.js+1 -1
@@ -5480,7 +5480,7 @@ export function cleanUpMessage(getMessage, isImpersonate, isContinue, displayInc
5480 }5480 }
54815481
5482 if (!displayIncompleteSentences && power_user.trim_sentences) {5482 if (!displayIncompleteSentences && power_user.trim_sentences) {
5483 getMessage = trimToEndSentence(getMessage, power_user.include_newline);5483 getMessage = trimToEndSentence(getMessage);
5484 }5484 }
54855485
5486 if (power_user.trim_spaces) {5486 if (power_user.trim_spaces) {
public/scripts/power-user.js+0 -16
@@ -114,7 +114,6 @@ let power_user = {
114 pin_examples: false,114 pin_examples: false,
115 strip_examples: false,115 strip_examples: false,
116 trim_sentences: false,116 trim_sentences: false,
117 include_newline: false,
118 always_force_name2: false,117 always_force_name2: false,
119 user_prompt_bias: '',118 user_prompt_bias: '',
120 show_user_prompt_bias: true,119 show_user_prompt_bias: true,
@@ -317,7 +316,6 @@ const contextControls = [
317 // Existing power user settings316 // Existing power user settings
318 { id: 'always-force-name2-checkbox', property: 'always_force_name2', isCheckbox: true, isGlobalSetting: true, defaultValue: true },317 { id: 'always-force-name2-checkbox', property: 'always_force_name2', isCheckbox: true, isGlobalSetting: true, defaultValue: true },
319 { id: 'trim_sentences_checkbox', property: 'trim_sentences', isCheckbox: true, isGlobalSetting: true, defaultValue: false },318 { id: 'trim_sentences_checkbox', property: 'trim_sentences', isCheckbox: true, isGlobalSetting: true, defaultValue: false },
320 { id: 'include_newline_checkbox', property: 'include_newline', isCheckbox: true, isGlobalSetting: true, defaultValue: false },
321 { id: 'single_line', property: 'single_line', isCheckbox: true, isGlobalSetting: true, defaultValue: false },319 { id: 'single_line', property: 'single_line', isCheckbox: true, isGlobalSetting: true, defaultValue: false },
322];320];
323321
@@ -1487,7 +1485,6 @@ async function loadPowerUserSettings(settings, data) {
1487 $('#collapse-newlines-checkbox').prop('checked', power_user.collapse_newlines);1485 $('#collapse-newlines-checkbox').prop('checked', power_user.collapse_newlines);
1488 $('#always-force-name2-checkbox').prop('checked', power_user.always_force_name2);1486 $('#always-force-name2-checkbox').prop('checked', power_user.always_force_name2);
1489 $('#trim_sentences_checkbox').prop('checked', power_user.trim_sentences);1487 $('#trim_sentences_checkbox').prop('checked', power_user.trim_sentences);
1490 $('#include_newline_checkbox').prop('checked', power_user.include_newline);
1491 $('#render_formulas').prop('checked', power_user.render_formulas);1488 $('#render_formulas').prop('checked', power_user.render_formulas);
1492 $('#disable_group_trimming').prop('checked', power_user.disable_group_trimming);1489 $('#disable_group_trimming').prop('checked', power_user.disable_group_trimming);
1493 $('#markdown_escape_strings').val(power_user.markdown_escape_strings);1490 $('#markdown_escape_strings').val(power_user.markdown_escape_strings);
@@ -3069,19 +3066,6 @@ $(document).ready(() => {
3069 // if trim sentences is unchecked, include newline must be unchecked3066 // if trim sentences is unchecked, include newline must be unchecked
3070 $('#trim_sentences_checkbox').change(function () {3067 $('#trim_sentences_checkbox').change(function () {
3071 power_user.trim_sentences = !!$(this).prop('checked');3068 power_user.trim_sentences = !!$(this).prop('checked');
3072 if (!$(this).prop('checked')) {
3073 $('#include_newline_checkbox').prop('checked', false);
3074 power_user.include_newline = false;
3075 }
3076 saveSettingsDebounced();
3077 });
3078
3079 $('#include_newline_checkbox').change(function () {
3080 power_user.include_newline = !!$(this).prop('checked');
3081 if ($(this).prop('checked')) {
3082 $('#trim_sentences_checkbox').prop('checked', true);
3083 power_user.trim_sentences = true;
3084 }
3085 saveSettingsDebounced();3069 saveSettingsDebounced();
3086 });3070 });
30873071
public/scripts/utils.js+1 -7
@@ -607,12 +607,11 @@ export function sortByCssOrder(a, b) {
607/**607/**
608 * Trims a string to the end of a nearest sentence.608 * Trims a string to the end of a nearest sentence.
609 * @param {string} input The string to trim.609 * @param {string} input The string to trim.
610 * @param {boolean} include_newline Whether to include a newline character in the trimmed string.
611 * @returns {string} The trimmed string.610 * @returns {string} The trimmed string.
612 * @example611 * @example
613 * trimToEndSentence('Hello, world! I am from'); // 'Hello, world!'612 * trimToEndSentence('Hello, world! I am from'); // 'Hello, world!'
614 */613 */
615export function trimToEndSentence(input, include_newline = false) {614export function trimToEndSentence(input) {
616 if (!input) {615 if (!input) {
617 return '';616 return '';
618 }617 }
@@ -633,11 +632,6 @@ export function trimToEndSentence(input, include_newline = false) {
633 }632 }
634 break;633 break;
635 }634 }
636
637 if (include_newline && char === '\n') {
638 last = i;
639 break;
640 }
641 }635 }
642636
643 if (last === -1) {637 if (last === -1) {