From dac6fe0ff49b35d5c59afcf33ae2b0db4be88a2e Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 23 Feb 2023 19:53:50 -0300 Subject: [PATCH] Reset the history if no default history exists on reload --- modules/chat.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/chat.py b/modules/chat.py index 540fbf3a..1ac0508e 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -303,6 +303,9 @@ def load_history(file, name1, name2): def load_default_history(name1, name2): if Path(f'logs/persistent.json').exists(): load_history(open(Path(f'logs/persistent.json'), 'rb').read(), name1, name2) + else: + shared.history['internal'] = [] + shared.history['visible'] = [] def load_character(_character, name1, name2): context = ""