Skip to content

Commit

Permalink
Fix missing example_dialogue when uploading characters
Browse files Browse the repository at this point in the history
  • Loading branch information
oobabooga authored Aug 8, 2023
1 parent bbe4a29 commit 584dd33
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 584dd33

Please sign in to comment.