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