From 584dd334242df56cca4a53664c5d1e3b57094e74 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Mon, 7 Aug 2023 23:44:59 -0300 Subject: [PATCH] Fix missing example_dialogue when uploading characters --- modules/chat.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/chat.py b/modules/chat.py index a445c6a..5667d43 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -510,9 +510,6 @@ def load_character(character, name1, name2, instruct=False): context = build_pygmalion_style_context(data) greeting_field = 'char_greeting' - if 'example_dialogue' in data: - context += f"{data['example_dialogue'].strip()}\n" - if greeting_field in data: greeting = data[greeting_field] @@ -573,6 +570,9 @@ def build_pygmalion_style_context(data): if 'world_scenario' in data and data['world_scenario'] != '': context += f"Scenario: {data['world_scenario']}\n" + if 'example_dialogue' in data and data['example_dialogue'] != '': + context += f"{data['example_dialogue'].strip()}\n" + context = f"{context.strip()}\n" return context