Merge branch 'staging' into sysprompt-divorce
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": false, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": true, |
| 11 | 10 | "name": "Adventure" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": false, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Alpaca-Single-Turn" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Alpaca" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "ChatML-Names" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "ChatML" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Command R" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Default" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": false, |
| 8 | 8 | "trim_sentences": true, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "DreamGen Role-Play V1 ChatML" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": false, |
| 8 | 8 | "trim_sentences": true, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "DreamGen Role-Play V1 Llama3" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Gemma 2" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Libra-32B" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Lightning 1.1" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Llama 2 Chat" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Llama 3 Instruct" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Llama-3-Instruct-Names" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Minimalist" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Mistral V1" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Mistral V2 & V3" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Mistral V3-Tekken" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "NovelAI" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "OldDefault" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Phi" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Pygmalion" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Story" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Synthia" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "simple-proxy-for-tavern" |
| 12 | 11 | } |
| @@ -90,7 +90,6 @@ | ||
| 90 | 90 | "pin_examples": false, |
| 91 | 91 | "strip_examples": false, |
| 92 | 92 | "trim_sentences": false, |
| 93 | - "include_newline": false, | |
| 94 | 93 | "always_force_name2": true, |
| 95 | 94 | "user_prompt_bias": "", |
| 96 | 95 | "show_user_prompt_bias": true, |
| @@ -3260,11 +3260,6 @@ | ||
| 3260 | 3260 | Trim Incomplete Sentences |
| 3261 | 3261 | </small> |
| 3262 | 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 | 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 | 3264 | <input id="context_use_stop_strings" type="checkbox" /> |
| 3270 | 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 | 5487 | if (!displayIncompleteSentences && power_user.trim_sentences) { |
| 5488 | 5488 | getMessage = trimToEndSentence(getMessage, power_user.include_newline); |
| 5489 | 5489 | } |
| 5490 | 5490 | |
| 5491 | 5491 | if (power_user.trim_spaces) { |
| @@ -115,7 +115,6 @@ let power_user = { | ||
| 115 | 115 | pin_examples: false, |
| 116 | 116 | strip_examples: false, |
| 117 | 117 | trim_sentences: false, |
| 118 | - include_newline: false, | |
| 119 | 118 | always_force_name2: false, |
| 120 | 119 | user_prompt_bias: '', |
| 121 | 120 | show_user_prompt_bias: true, |
| @@ -321,7 +320,6 @@ const contextControls = [ | ||
| 321 | 320 | // Existing power user settings |
| 322 | 321 | { id: 'always-force-name2-checkbox', property: 'always_force_name2', isCheckbox: true, isGlobalSetting: true, defaultValue: true }, |
| 323 | 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 | 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 | 1489 | $('#collapse-newlines-checkbox').prop('checked', power_user.collapse_newlines); |
| 1492 | 1490 | $('#always-force-name2-checkbox').prop('checked', power_user.always_force_name2); |
| 1493 | 1491 | $('#trim_sentences_checkbox').prop('checked', power_user.trim_sentences); |
| 1494 | - $('#include_newline_checkbox').prop('checked', power_user.include_newline); | |
| 1495 | 1492 | $('#render_formulas').prop('checked', power_user.render_formulas); |
| 1496 | 1493 | $('#disable_group_trimming').prop('checked', power_user.disable_group_trimming); |
| 1497 | 1494 | $('#markdown_escape_strings').val(power_user.markdown_escape_strings); |
| @@ -3053,19 +3050,6 @@ $(document).ready(() => { | ||
| 3053 | 3050 | // if trim sentences is unchecked, include newline must be unchecked |
| 3054 | 3051 | $('#trim_sentences_checkbox').change(function () { |
| 3055 | 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 | 3053 | saveSettingsDebounced(); |
| 3070 | 3054 | }); |
| 3071 | 3055 | |
| @@ -607,12 +607,11 @@ export function sortByCssOrder(a, b) { | ||
| 607 | 607 | /** |
| 608 | 608 | * Trims a string to the end of a nearest sentence. |
| 609 | 609 | * @param {string} input The string to trim. |
| 610 | - * @param {boolean} include_newline Whether to include a newline character in the trimmed string. | |
| 611 | 610 | * @returns {string} The trimmed string. |
| 612 | 611 | * @example |
| 613 | 612 | * trimToEndSentence('Hello, world! I am from'); // 'Hello, world!' |
| 614 | 613 | */ |
| 615 | 614 | export function trimToEndSentence(input, include_newline = false) { |
| 616 | 615 | if (!input) { |
| 617 | 616 | return ''; |
| 618 | 617 | } |
| @@ -633,11 +632,6 @@ export function trimToEndSentence(input, include_newline = false) { | ||
| 633 | 632 | } |
| 634 | 633 | break; |
| 635 | 634 | } |
| 636 | - | |
| 637 | - if (include_newline && char === '\n') { | |
| 638 | - last = i; | |
| 639 | - break; | |
| 640 | - } | |
| 641 | 635 | } |
| 642 | 636 | |
| 643 | 637 | if (last === -1) { |