From e861e68e3848d720fd8e3cb5dee9fe9f54c88657 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 28 Feb 2023 00:50:46 -0300 Subject: [PATCH] Move the chat example dialogue to the prompt --- modules/chat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/chat.py b/modules/chat.py index 3cb0aa50..1392038d 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -220,7 +220,7 @@ def clear_chat_log(name1, name2): for i in range(len(shared.history['internal'])): if '<|BEGIN-VISIBLE-CHAT|>' in shared.history['internal'][i][0]: shared.history['visible'] = [['', apply_extensions(shared.history['internal'][i][1], "output")]] - shared.history['internal'] = shared.history['internal'][:i+1] + shared.history['internal'] = [shared.history['internal'][i]] found = True break if not found: @@ -331,7 +331,7 @@ def load_character(_character, name1, name2): context += f"Scenario: {data['world_scenario']}\n" context = f"{context.strip()}\n\n" if 'example_dialogue' in data and data['example_dialogue'] != '': - shared.history['internal'] = tokenize_dialogue(data['example_dialogue'], name1, name2) + context += f"{data['example_dialogue'].strip()}\n" if 'char_greeting' in data and len(data['char_greeting'].strip()) > 0: shared.history['internal'] += [['<|BEGIN-VISIBLE-CHAT|>', data['char_greeting']]] shared.history['visible'] += [['', apply_extensions(data['char_greeting'], "output")]]