From 8fa182cfa77b39cb6b2911a81e07e3447ec4e097 Mon Sep 17 00:00:00 2001 From: Maya <48323879+mayaeary@users.noreply.github.com> Date: Fri, 7 Apr 2023 16:45:42 +0300 Subject: [PATCH] Fix regeneration of first message in instruct mode (#881) --- modules/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/chat.py b/modules/chat.py index e1867059..10146086 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -206,7 +206,7 @@ def cai_chatbot_wrapper(text, generate_state, name1, name2, context, mode, end_o def regenerate_wrapper(text, generate_state, name1, name2, context, mode, end_of_turn): - if (shared.character != 'None' and len(shared.history['visible']) == 1) or len(shared.history['internal']) == 0: + if (len(shared.history['visible']) == 1 and not shared.history['visible'][0][0]) or len(shared.history['internal']) == 0: yield chat_html_wrapper(shared.history['visible'], name1, name2, mode) else: last_visible = shared.history['visible'].pop()