From ff9b5861c8c7595d5a2dab03610b13cbc2c760e4 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 13 Aug 2023 21:10:47 -0700 Subject: [PATCH] Fix impersonate when some text is present (closes #3564) --- modules/chat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/chat.py b/modules/chat.py index e2bba18f..ffddb700 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -272,8 +272,8 @@ def impersonate_wrapper(text, start_with, state): yield text + '...' reply = None - for reply in generate_reply(prompt, state, stopping_strings=stopping_strings, is_chat=True): - yield reply.lstrip(' ') + for reply in generate_reply(prompt + text, state, stopping_strings=stopping_strings, is_chat=True): + yield (text + reply).lstrip(' ') if shared.stop_everything: return