Skip to content

Commit

Permalink
fix: use system message in chat-instruct mode (#4648)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbtucker authored Nov 18, 2023
1 parent 47d9e26 commit baab894
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ def generate_chat_prompt(user_input, state, **kwargs):
if state['mode'] == 'chat-instruct':
wrapper = ''
command = state['chat-instruct_command'].replace('<|character|>', state['name2'] if not impersonate else state['name1'])
wrapper += state['context_instruct']
context_instruct = state['context_instruct']
if state['custom_system_message'].strip() != '':
context_instruct = context_instruct.replace('<|system-message|>', state['custom_system_message'])
else:
context_instruct = context_instruct.replace('<|system-message|>', state['system_message'])
wrapper += context_instruct
wrapper += all_substrings['instruct']['user_turn'].replace('<|user-message|>', command)
wrapper += all_substrings['instruct']['bot_turn_stripped']
if impersonate:
Expand Down

0 comments on commit baab894

Please sign in to comment.