Replace character name placeholders in chat context (closes #5007)
This commit is contained in:
parent
e83e6cedbe
commit
d8279dc710
1 changed files with 2 additions and 1 deletions
|
@ -95,7 +95,8 @@ def generate_chat_prompt(user_input, state, **kwargs):
|
|||
else:
|
||||
renderer = chat_renderer
|
||||
if state['context'].strip() != '':
|
||||
messages.append({"role": "system", "content": state['context']})
|
||||
context = replace_character_names(state['context'], state['name1'], state['name2'])
|
||||
messages.append({"role": "system", "content": context})
|
||||
|
||||
insert_pos = len(messages)
|
||||
for user_msg, assistant_msg in reversed(history):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue