diff --git a/modules/chat.py b/modules/chat.py index 827b6050..1a16a689 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -1175,6 +1175,9 @@ def save_last_chat_state(character, mode, unique_id): def load_history(unique_id, character, mode): p = get_history_file_path(unique_id, character, mode) + if not p.exists(): + return {'internal': [], 'visible': [], 'metadata': {}} + f = json.loads(open(p, 'rb').read()) if 'internal' in f and 'visible' in f: history = f