mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-12 10:00:36 +01:00
Remove "include newlines" checkbox from context formatting settings
This commit is contained in:
parent
93bf87b035
commit
a18dae8f69
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": false,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": true,
|
||||
"name": "Adventure"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Alpaca-Roleplay"
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": false,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Alpaca-Single-Turn"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Alpaca"
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "ChatML-Names"
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "ChatML"
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Command R"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Default"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": false,
|
||||
"trim_sentences": true,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "DreamGen Role-Play V1 ChatML"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": false,
|
||||
"trim_sentences": true,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "DreamGen Role-Play V1 Llama3"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Gemma 2"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Libra-32B"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Lightning 1.1"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Llama 2 Chat"
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Llama 3 Instruct"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Llama-3-Instruct-Names"
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Minimalist"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Mistral V1"
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Mistral V2 & V3"
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Mistral V3-Tekken"
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "NovelAI"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "OldDefault"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Phi"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Pygmalion"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Story"
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "Synthia"
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
"allow_jailbreak": false,
|
||||
"always_force_name2": true,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"single_line": false,
|
||||
"name": "simple-proxy-for-tavern"
|
||||
}
|
||||
}
|
||||
|
@ -90,7 +90,6 @@
|
||||
"pin_examples": false,
|
||||
"strip_examples": false,
|
||||
"trim_sentences": false,
|
||||
"include_newline": false,
|
||||
"always_force_name2": true,
|
||||
"user_prompt_bias": "",
|
||||
"show_user_prompt_bias": true,
|
||||
|
@ -3251,11 +3251,6 @@
|
||||
Trim Incomplete Sentences
|
||||
</small>
|
||||
</label>
|
||||
<!-- Add margin since this is a child of above -->
|
||||
<label class="checkbox_label indent20p" for="include_newline_checkbox">
|
||||
<input id="include_newline_checkbox" type="checkbox" />
|
||||
<small data-i18n="Include Newline">Include Newline</small>
|
||||
</label>
|
||||
<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.">
|
||||
<input id="context_use_stop_strings" type="checkbox" />
|
||||
<small data-i18n="Separators as Stop Strings">Separators as Stop Strings</small>
|
||||
|
@ -5480,7 +5480,7 @@ export function cleanUpMessage(getMessage, isImpersonate, isContinue, displayInc
|
||||
}
|
||||
|
||||
if (!displayIncompleteSentences && power_user.trim_sentences) {
|
||||
getMessage = trimToEndSentence(getMessage, power_user.include_newline);
|
||||
getMessage = trimToEndSentence(getMessage);
|
||||
}
|
||||
|
||||
if (power_user.trim_spaces) {
|
||||
|
@ -114,7 +114,6 @@ let power_user = {
|
||||
pin_examples: false,
|
||||
strip_examples: false,
|
||||
trim_sentences: false,
|
||||
include_newline: false,
|
||||
always_force_name2: false,
|
||||
user_prompt_bias: '',
|
||||
show_user_prompt_bias: true,
|
||||
@ -317,7 +316,6 @@ const contextControls = [
|
||||
// Existing power user settings
|
||||
{ id: 'always-force-name2-checkbox', property: 'always_force_name2', isCheckbox: true, isGlobalSetting: true, defaultValue: true },
|
||||
{ id: 'trim_sentences_checkbox', property: 'trim_sentences', isCheckbox: true, isGlobalSetting: true, defaultValue: false },
|
||||
{ id: 'include_newline_checkbox', property: 'include_newline', isCheckbox: true, isGlobalSetting: true, defaultValue: false },
|
||||
{ id: 'single_line', property: 'single_line', isCheckbox: true, isGlobalSetting: true, defaultValue: false },
|
||||
];
|
||||
|
||||
@ -1487,7 +1485,6 @@ async function loadPowerUserSettings(settings, data) {
|
||||
$('#collapse-newlines-checkbox').prop('checked', power_user.collapse_newlines);
|
||||
$('#always-force-name2-checkbox').prop('checked', power_user.always_force_name2);
|
||||
$('#trim_sentences_checkbox').prop('checked', power_user.trim_sentences);
|
||||
$('#include_newline_checkbox').prop('checked', power_user.include_newline);
|
||||
$('#render_formulas').prop('checked', power_user.render_formulas);
|
||||
$('#disable_group_trimming').prop('checked', power_user.disable_group_trimming);
|
||||
$('#markdown_escape_strings').val(power_user.markdown_escape_strings);
|
||||
@ -3069,19 +3066,6 @@ $(document).ready(() => {
|
||||
// if trim sentences is unchecked, include newline must be unchecked
|
||||
$('#trim_sentences_checkbox').change(function () {
|
||||
power_user.trim_sentences = !!$(this).prop('checked');
|
||||
if (!$(this).prop('checked')) {
|
||||
$('#include_newline_checkbox').prop('checked', false);
|
||||
power_user.include_newline = false;
|
||||
}
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
|
||||
$('#include_newline_checkbox').change(function () {
|
||||
power_user.include_newline = !!$(this).prop('checked');
|
||||
if ($(this).prop('checked')) {
|
||||
$('#trim_sentences_checkbox').prop('checked', true);
|
||||
power_user.trim_sentences = true;
|
||||
}
|
||||
saveSettingsDebounced();
|
||||
});
|
||||
|
||||
|
@ -607,12 +607,11 @@ export function sortByCssOrder(a, b) {
|
||||
/**
|
||||
* Trims a string to the end of a nearest sentence.
|
||||
* @param {string} input The string to trim.
|
||||
* @param {boolean} include_newline Whether to include a newline character in the trimmed string.
|
||||
* @returns {string} The trimmed string.
|
||||
* @example
|
||||
* trimToEndSentence('Hello, world! I am from'); // 'Hello, world!'
|
||||
*/
|
||||
export function trimToEndSentence(input, include_newline = false) {
|
||||
export function trimToEndSentence(input) {
|
||||
if (!input) {
|
||||
return '';
|
||||
}
|
||||
@ -633,11 +632,6 @@ export function trimToEndSentence(input, include_newline = false) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (include_newline && char === '\n') {
|
||||
last = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (last === -1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user