Fix bug when only global bans are defined
| @@ -399,7 +399,7 @@ function getTokenizerForTokenIds() { | |||
| 399 | * @returns {TokenBanResult} String with comma-separated banned token IDs | 399 | * @returns {TokenBanResult} String with comma-separated banned token IDs |
| 400 | */ | 400 | */ |
| 401 | function getCustomTokenBans() { | 401 | function getCustomTokenBans() { |
| 402 | if (!settings.send_banned_tokens || (!settings.banned_tokens && !textgenerationwebui_banned_in_macros.length)) { | 402 | if (!settings.send_banned_tokens || (!settings.banned_tokens && !settings.global_banned_tokens && !textgenerationwebui_banned_in_macros.length)) { |
| 403 | return { | 403 | return { |
| 404 | banned_tokens: '', | 404 | banned_tokens: '', |
| 405 | banned_strings: [], | 405 | banned_strings: [], |
| @@ -460,7 +460,7 @@ function getCustomTokenBans() { | |||
| 460 | 460 | ||
| 461 | async function enableBannedStringsKillSwitch() { | 461 | async function enableBannedStringsKillSwitch() { |
| 462 | $('#send_banned_tokens_textgenerationwebui').prop('checked', true); | 462 | $('#send_banned_tokens_textgenerationwebui').prop('checked', true); |
| 463 | $('#send_banned_tokens_label').find('.menu_button').addClass('toggleEnabled').prop('title', t`Banned tokens/strings are being sent into the request.`); | 463 | $('#send_banned_tokens_label').find('.menu_button').addClass('toggleEnabled').prop('title', t`Banned tokens/strings are being sent in the request.`); |
| 464 | settings.send_banned_tokens = true; | 464 | settings.send_banned_tokens = true; |
| 465 | saveSettingsDebounced(); | 465 | saveSettingsDebounced(); |
| 466 | return ''; | 466 | return ''; |
| @@ -468,7 +468,7 @@ async function enableBannedStringsKillSwitch() { | |||
| 468 | 468 | ||
| 469 | async function disableBannedStringsKillSwitch() { | 469 | async function disableBannedStringsKillSwitch() { |
| 470 | $('#send_banned_tokens_textgenerationwebui').prop('checked', false); | 470 | $('#send_banned_tokens_textgenerationwebui').prop('checked', false); |
| 471 | $('#send_banned_tokens_label').find('.menu_button').removeClass('toggleEnabled').prop('title', t`Banned tokens/strings are NOT being sent into the request.`); | 471 | $('#send_banned_tokens_label').find('.menu_button').removeClass('toggleEnabled').prop('title', t`Banned tokens/strings are NOT being sent in the request.`); |
| 472 | settings.send_banned_tokens = false; | 472 | settings.send_banned_tokens = false; |
| 473 | saveSettingsDebounced(); | 473 | saveSettingsDebounced(); |
| 474 | return ''; | 474 | return ''; |