Merge branch 'staging' into sysprompt-divorce
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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 | } |
| @@ -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, |
| @@ -3260,11 +3260,6 @@ | |||
| 3260 | Trim Incomplete Sentences | 3260 | Trim Incomplete Sentences |
| 3261 | </small> | 3261 | </small> |
| 3262 | </label> | 3262 | </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> | ||
| 3268 | <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."> | 3263 | <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."> |
| 3269 | <input id="context_use_stop_strings" type="checkbox" /> | 3264 | <input id="context_use_stop_strings" type="checkbox" /> |
| 3270 | <small data-i18n="Separators as Stop Strings">Separators as Stop Strings</small> | 3265 | <small data-i18n="Separators as Stop Strings">Separators as Stop Strings</small> |
| @@ -5485,7 +5485,7 @@ export function cleanUpMessage(getMessage, isImpersonate, isContinue, displayInc | |||
| 5485 | } | 5485 | } |
| 5486 | 5486 | ||
| 5487 | if (!displayIncompleteSentences && power_user.trim_sentences) { | 5487 | if (!displayIncompleteSentences && power_user.trim_sentences) { |
| 5488 | getMessage = trimToEndSentence(getMessage, power_user.include_newline); | 5488 | getMessage = trimToEndSentence(getMessage); |
| 5489 | } | 5489 | } |
| 5490 | 5490 | ||
| 5491 | if (power_user.trim_spaces) { | 5491 | if (power_user.trim_spaces) { |
| @@ -115,7 +115,6 @@ let power_user = { | |||
| 115 | pin_examples: false, | 115 | pin_examples: false, |
| 116 | strip_examples: false, | 116 | strip_examples: false, |
| 117 | trim_sentences: false, | 117 | trim_sentences: false, |
| 118 | include_newline: false, | ||
| 119 | always_force_name2: false, | 118 | always_force_name2: false, |
| 120 | user_prompt_bias: '', | 119 | user_prompt_bias: '', |
| 121 | show_user_prompt_bias: true, | 120 | show_user_prompt_bias: true, |
| @@ -321,7 +320,6 @@ const contextControls = [ | |||
| 321 | // Existing power user settings | 320 | // Existing power user settings |
| 322 | { id: 'always-force-name2-checkbox', property: 'always_force_name2', isCheckbox: true, isGlobalSetting: true, defaultValue: true }, | 321 | { id: 'always-force-name2-checkbox', property: 'always_force_name2', isCheckbox: true, isGlobalSetting: true, defaultValue: true }, |
| 323 | { id: 'trim_sentences_checkbox', property: 'trim_sentences', isCheckbox: true, isGlobalSetting: true, defaultValue: false }, | 322 | { 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 }, | ||
| 325 | { id: 'single_line', property: 'single_line', isCheckbox: true, isGlobalSetting: true, defaultValue: false }, | 323 | { id: 'single_line', property: 'single_line', isCheckbox: true, isGlobalSetting: true, defaultValue: false }, |
| 326 | ]; | 324 | ]; |
| 327 | 325 | ||
| @@ -1491,7 +1489,6 @@ async function loadPowerUserSettings(settings, data) { | |||
| 1491 | $('#collapse-newlines-checkbox').prop('checked', power_user.collapse_newlines); | 1489 | $('#collapse-newlines-checkbox').prop('checked', power_user.collapse_newlines); |
| 1492 | $('#always-force-name2-checkbox').prop('checked', power_user.always_force_name2); | 1490 | $('#always-force-name2-checkbox').prop('checked', power_user.always_force_name2); |
| 1493 | $('#trim_sentences_checkbox').prop('checked', power_user.trim_sentences); | 1491 | $('#trim_sentences_checkbox').prop('checked', power_user.trim_sentences); |
| 1494 | $('#include_newline_checkbox').prop('checked', power_user.include_newline); | ||
| 1495 | $('#render_formulas').prop('checked', power_user.render_formulas); | 1492 | $('#render_formulas').prop('checked', power_user.render_formulas); |
| 1496 | $('#disable_group_trimming').prop('checked', power_user.disable_group_trimming); | 1493 | $('#disable_group_trimming').prop('checked', power_user.disable_group_trimming); |
| 1497 | $('#markdown_escape_strings').val(power_user.markdown_escape_strings); | 1494 | $('#markdown_escape_strings').val(power_user.markdown_escape_strings); |
| @@ -3053,19 +3050,6 @@ $(document).ready(() => { | |||
| 3053 | // if trim sentences is unchecked, include newline must be unchecked | 3050 | // if trim sentences is unchecked, include newline must be unchecked |
| 3054 | $('#trim_sentences_checkbox').change(function () { | 3051 | $('#trim_sentences_checkbox').change(function () { |
| 3055 | power_user.trim_sentences = !!$(this).prop('checked'); | 3052 | 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 | } | ||
| 3069 | saveSettingsDebounced(); | 3053 | saveSettingsDebounced(); |
| 3070 | }); | 3054 | }); |
| 3071 | 3055 | ||
| @@ -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 | * @example | 611 | * @example |
| 613 | * trimToEndSentence('Hello, world! I am from'); // 'Hello, world!' | 612 | * trimToEndSentence('Hello, world! I am from'); // 'Hello, world!' |
| 614 | */ | 613 | */ |
| 615 | export function trimToEndSentence(input, include_newline = false) { | 614 | export 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 | } |
| 642 | 636 | ||
| 643 | if (last === -1) { | 637 | if (last === -1) { |