From c4733000d715e422d76f3bf58c12f596df03fc0d Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Fri, 18 Aug 2023 09:25:51 -0700 Subject: [PATCH] Return the visible history with "Remove last" --- modules/chat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/chat.py b/modules/chat.py index d81d254f..ce10e393 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -308,8 +308,8 @@ def generate_chat_reply_wrapper(text, state, regenerate=False, _continue=False): def remove_last_message(history): if len(history['visible']) > 0 and history['internal'][-1][0] != '<|BEGIN-VISIBLE-CHAT|>': - last = history['internal'].pop() - history['visible'].pop() + last = history['visible'].pop() + history['internal'].pop() else: last = ['', '']