mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-25 09:19:23 +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:
|
else:
|
||||||
renderer = chat_renderer
|
renderer = chat_renderer
|
||||||
if state['context'].strip() != '':
|
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)
|
insert_pos = len(messages)
|
||||||
for user_msg, assistant_msg in reversed(history):
|
for user_msg, assistant_msg in reversed(history):
|
||||||
|
Loading…
Reference in New Issue
Block a user