Merge branch 'staging' into sysprompt-divorce

This commit is contained in:
Cohee 2024-09-22 19:56:29 +03:00
commit 3812e3bdcb
31 changed files with 18 additions and 72 deletions

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": false,
"trim_sentences": false,
"include_newline": false,
"single_line": true,
"name": "Adventure"
}
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": false,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Alpaca-Single-Turn"
}
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Alpaca"
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "ChatML-Names"
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "ChatML"
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Command R"
}
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Default"
}
}

View File

@ -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"
}
}

View File

@ -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"
}
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Gemma 2"
}
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Libra-32B"
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Lightning 1.1"
}
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Llama 2 Chat"
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Llama 3 Instruct"
}
}

View File

@ -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"
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Minimalist"
}
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Mistral V1"
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Mistral V2 & V3"
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Mistral V3-Tekken"
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "NovelAI"
}
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "OldDefault"
}
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Phi"
}
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Pygmalion"
}
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Story"
}
}

View File

@ -6,7 +6,6 @@
"allow_jailbreak": false,
"always_force_name2": true,
"trim_sentences": false,
"include_newline": false,
"single_line": false,
"name": "Synthia"
}

View File

@ -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"
}
}

View File

@ -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,

View File

@ -3260,11 +3260,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>

View File

@ -5485,7 +5485,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) {

View File

@ -115,7 +115,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,
@ -321,7 +320,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 },
];
@ -1491,7 +1489,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);
@ -3053,19 +3050,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();
});

View File

@ -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) {