mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-30 06:00:15 +01:00
Replace character name placeholders in chat context (closes #5007)
This commit is contained in:
parent
e83e6cedbe
commit
d8279dc710
@ -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…
Reference in New Issue
Block a user