Fix chat history handling in instruct mode

This commit is contained in:
oobabooga 2023-05-08 16:41:21 -03:00
parent 79ac94cc2f
commit 68dcbc7ebd

View File

@ -319,12 +319,13 @@ def clear_chat_log(name1, name2, greeting, mode, style):
shared.history['visible'] = []
shared.history['internal'] = []
if greeting != '':
shared.history['internal'] += [['<|BEGIN-VISIBLE-CHAT|>', greeting]]
shared.history['visible'] += [['', apply_extensions("output", greeting)]]
if mode != 'instruct':
if greeting != '':
shared.history['internal'] += [['<|BEGIN-VISIBLE-CHAT|>', greeting]]
shared.history['visible'] += [['', apply_extensions("output", greeting)]]
save_history(mode)
# Save cleared logs
save_history(mode)
return chat_html_wrapper(shared.history['visible'], name1, name2, mode, style)