From fcf5512364bcd2488d605a4a391cb9aedd852927 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Wed, 13 Dec 2023 10:19:39 -0800 Subject: [PATCH] Jinja templates: fix a potential small bug --- modules/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/chat.py b/modules/chat.py index 8756adb3..d1686292 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -827,7 +827,7 @@ def jinja_template_from_old_format(params, verbose=False): result = result.replace('<|PRE-USER|>', pre_user) result = result.replace('<|POST-USER|>', post_user) result = result.replace('<|PRE-ASSISTANT|>', pre_assistant) - result = result.replace('<|PRE-ASSISTANT-GENERATE|>', pre_assistant.strip()) + result = result.replace('<|PRE-ASSISTANT-GENERATE|>', pre_assistant.rstrip(' ')) result = result.replace('<|POST-ASSISTANT|>', post_assistant) result = result.strip()