From 9b0e95abeb9e156a68665186a8651f2051cb2653 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Mon, 5 Jun 2023 11:56:03 -0300 Subject: [PATCH] Fix "regenerate" when "Start reply with" is set --- modules/chat.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/chat.py b/modules/chat.py index f3388737..63042f1f 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -325,6 +325,10 @@ def generate_chat_reply(text, history, state, regenerate=False, _continue=False, # Same as above but returns HTML for the UI def generate_chat_reply_wrapper(text, start_with, state, regenerate=False, _continue=False): if start_with != '' and _continue == False: + if regenerate == True: + text = remove_last_message() + regenerate = False + _continue = True send_dummy_message(text) send_dummy_reply(start_with)