Fix regeneration of first message in instruct mode (#881)

This commit is contained in:
Maya 2023-04-07 16:45:42 +03:00 committed by GitHub
parent 862aad637b
commit 8fa182cfa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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): 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) yield chat_html_wrapper(shared.history['visible'], name1, name2, mode)
else: else:
last_visible = shared.history['visible'].pop() last_visible = shared.history['visible'].pop()