From f31281a8de3ad81c06f03c360f3f1f80dc697c63 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 25 Jun 2023 02:13:26 -0300 Subject: [PATCH] Fix loading instruction templates containing literal '\n' --- modules/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/chat.py b/modules/chat.py index 6d57dbf..328ba83 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -540,7 +540,7 @@ def load_character(character, name1, name2, instruct=False): # Create .json log files since they don't already exist save_history('instruct' if instruct else 'chat') - return name1, name2, picture, greeting, context, repr(turn_template)[1:-1] + return name1, name2, picture, greeting, context, turn_template.replace("\n", r"\n") @functools.cache