From 6e411b06b9b823af79a1874439a4221836846359 Mon Sep 17 00:00:00 2001 From: P3il4 <42489293+P3il4@users.noreply.github.com> Date: Thu, 28 Mar 2024 03:32:57 +0300 Subject: [PATCH 1/3] Fix prompt cache after API error --- public/script.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/script.js b/public/script.js index 36539cc9a..97e30e42f 100644 --- a/public/script.js +++ b/public/script.js @@ -3973,6 +3973,8 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu toastr.error(exception.error.message, 'Error', { timeOut: 10000, extendedTimeOut: 20000 }); } + generatedPromptCache = ''; + unblockGeneration(); console.log(exception); streamingProcessor = null; From 3e49c9d02c6e9a0537a941c6f6c21ef554e10b89 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Thu, 28 Mar 2024 14:47:24 +0200 Subject: [PATCH 2/3] &rcub => } --- public/scripts/templates/macros.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/templates/macros.html b/public/scripts/templates/macros.html index 34b768ac1..a2e1ff009 100644 --- a/public/scripts/templates/macros.html +++ b/public/scripts/templates/macros.html @@ -33,7 +33,7 @@
  • {{time_UTC±#}} – the current time in the specified UTC time zone offset, e.g. UTC-4 or UTC+2
  • {{idle_duration}} – the time since the last user message was sent
  • {{bias "text here"}} – sets a behavioral bias for the AI until the next user input. Quotes around the text are important.
  • -
  • {{roll:(formula)}} – rolls a dice. (ex: >{{roll:1d6}&rcub will roll a 6-sided dice and return a number between 1 and 6)
  • +
  • {{roll:(formula)}} – rolls a dice. (ex: >{{roll:1d6}} will roll a 6-sided dice and return a number between 1 and 6)
  • {{random:(args)}} – returns a random item from the list. (ex: {{random:1,2,3,4}} will return 1 of the 4 numbers at random. Works with text lists too.
  • {{random::(arg1)::(arg2)}} – alternative syntax for random that allows to use commas in the list items.
  • {{banned "text here"}} – dynamically add text in the quotes to banned words sequences, if Text Generation WebUI backend used. Do nothing for others backends. Can be used anywhere (Character description, WI, AN, etc.) Quotes around the text are important.
  • From 7c99d87238b2c40d7b2e30d8e9756aa4622c1bbb Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Thu, 28 Mar 2024 20:22:14 +0200 Subject: [PATCH 3/3] Also clear prompt cache on streaming stop --- public/script.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/public/script.js b/public/script.js index 97e30e42f..f999f9a82 100644 --- a/public/script.js +++ b/public/script.js @@ -2733,9 +2733,7 @@ class StreamingProcessor { const continueMsg = this.type === 'continue' ? this.messageAlreadyGenerated : undefined; saveLogprobsForActiveMessage(this.messageLogprobs.filter(Boolean), continueMsg); await saveChatConditional(); - activateSendButtons(); - showSwipeButtons(); - setGenerationProgress(0); + unblockGeneration(); generatedPromptCache = ''; //console.log("Generated text size:", text.length, text) @@ -2778,11 +2776,8 @@ class StreamingProcessor { this.isStopped = true; this.hideMessageButtons(this.messageId); - $('#send_textarea').removeAttr('disabled'); - is_send_press = false; - activateSendButtons(); - setGenerationProgress(0); - showSwipeButtons(); + generatedPromptCache = ''; + unblockGeneration(); } setFirstSwipe(messageId) {