From 3a5886f53a20dc61f6d8ca2cafe480db7dd314d1 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 20 Apr 2024 20:20:51 +0300 Subject: [PATCH] Change generation type from regenerate to normal if the non-streaming generation fails to produce any text --- public/script.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index dc0e60862..7eeb576ce 100644 --- a/public/script.js +++ b/public/script.js @@ -4129,8 +4129,12 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu // regenerate with character speech reenforced // to make sure we leave on swipe type while also adding the name2 appendage await delay(1000); + // A message was already deleted on regeneration, so instead treat is as a normal gen + if (type === 'regenerate') { + type = 'normal'; + } // The first await is for waiting for the generate to start. The second one is waiting for it to finish - const result = await await Generate(type, { automatic_trigger, force_name2: true, quiet_prompt, skipWIAN, force_chid, maxLoops: maxLoops - 1 }); + const result = await await Generate(type, { automatic_trigger, force_name2: true, quiet_prompt, quietToLoud, skipWIAN, force_chid, signal, quietImage, quietName, maxLoops: maxLoops - 1 }); return result; }