mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-10 09:00:36 +01:00
Don't auto-swipe on aborted stream
This commit is contained in:
parent
2030c2c711
commit
ef3cb73477
@ -3143,7 +3143,8 @@ class StreamingProcessor {
|
|||||||
|
|
||||||
//console.log("Generated text size:", text.length, text)
|
//console.log("Generated text size:", text.length, text)
|
||||||
|
|
||||||
if (power_user.auto_swipe) {
|
const isAborted = this.abortController.signal.aborted;
|
||||||
|
if (power_user.auto_swipe && !isAborted) {
|
||||||
function containsBlacklistedWords(str, blacklist, threshold) {
|
function containsBlacklistedWords(str, blacklist, threshold) {
|
||||||
const regex = new RegExp(`\\b(${blacklist.join('|')})\\b`, 'gi');
|
const regex = new RegExp(`\\b(${blacklist.join('|')})\\b`, 'gi');
|
||||||
const matches = str.match(regex) || [];
|
const matches = str.match(regex) || [];
|
||||||
@ -4590,7 +4591,8 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
|
|||||||
playMessageSound();
|
playMessageSound();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (power_user.auto_swipe) {
|
const isAborted = abortController && abortController.signal.aborted;
|
||||||
|
if (power_user.auto_swipe && !isAborted) {
|
||||||
console.debug('checking for autoswipeblacklist on non-streaming message');
|
console.debug('checking for autoswipeblacklist on non-streaming message');
|
||||||
function containsBlacklistedWords(getMessage, blacklist, threshold) {
|
function containsBlacklistedWords(getMessage, blacklist, threshold) {
|
||||||
console.debug('checking blacklisted words');
|
console.debug('checking blacklisted words');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user