diff --git a/public/css/toggle-dependent.css b/public/css/toggle-dependent.css index 967aa55e6..59c2e9a28 100644 --- a/public/css/toggle-dependent.css +++ b/public/css/toggle-dependent.css @@ -493,3 +493,7 @@ label[for="trim_spaces"]:not(:has(input:checked)) small { #mistralai_other_models:empty { display: none; } + +#banned_tokens_block_ooba:not(:has(#send_banned_tokens_textgenerationwebui:checked)) #banned_tokens_controls_ooba { + filter: brightness(0.5); +} diff --git a/public/index.html b/public/index.html index d1a6db538..54a9c143f 100644 --- a/public/index.html +++ b/public/index.html @@ -1621,30 +1621,34 @@

-

+
+
+ Banned Tokens/Strings +
+
- Banned Tokens/Strings -
-

-
- Global list
-
- -
-
- Preset-specific list -
-
- +
+
+ Global list +
+
+ +
+
+ Preset-specific list +
+
+ +
- Logit Bias + Logit Bias
Add diff --git a/public/scripts/preset-manager.js b/public/scripts/preset-manager.js index 4a21efa9e..14991900f 100644 --- a/public/scripts/preset-manager.js +++ b/public/scripts/preset-manager.js @@ -588,6 +588,7 @@ class PresetManager { 'generic_model', 'include_reasoning', 'global_banned_tokens', + 'send_banned_tokens', ]; const settings = Object.assign({}, getSettingsByApiId(this.apiId)); diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js index 027fca9fb..828a9b03e 100644 --- a/public/scripts/textgen-settings.js +++ b/public/scripts/textgen-settings.js @@ -399,7 +399,7 @@ function getTokenizerForTokenIds() { * @returns {TokenBanResult} String with comma-separated banned token IDs */ function getCustomTokenBans() { - if (!settings.banned_tokens && !textgenerationwebui_banned_in_macros.length) { + if (!settings.send_banned_tokens || (!settings.banned_tokens && !textgenerationwebui_banned_in_macros.length)) { return { banned_tokens: '', banned_strings: [], @@ -616,9 +616,8 @@ function sortAphroditeItemsByOrder(orderArray) { } jQuery(function () { - - $('#bannedStringsKillSwitch_textgenerationwebui').on('change', function () { - const checked = $(this).prop('checked'); + $('#send_banned_tokens_textgenerationwebui').on('change', function () { + const checked = !!$(this).prop('checked'); if (checked) { enableBannedStringsKillSwitch(); } else { @@ -966,7 +965,7 @@ function setSettingByName(setting, value, trigger) { $(`#${setting}_textgenerationwebui`).prop('checked', val); if ('send_banned_tokens' === setting) { - $('#send_banned_tokens_textgenerationwebui').trigger('change'); + $(`#${setting}_textgenerationwebui`).trigger('change'); } } else if (isText) { diff --git a/public/style.css b/public/style.css index 1aac652f2..5ae78dc1c 100644 --- a/public/style.css +++ b/public/style.css @@ -2876,7 +2876,7 @@ select option:not(:checked) { #instruct_enabled_label .menu_button:not(.toggleEnabled), #sysprompt_enabled_label .menu_button:not(.toggleEnabled), -#bannedStringsKillSwitch_label .menu_button:not(.toggleEnabled) { +#send_banned_tokens_label .menu_button:not(.toggleEnabled) { color: Red; }