From 3f7c3d6559a51a3b95667b3ff74d048ffb722484 Mon Sep 17 00:00:00 2001 From: Aleksey Smolenchuk Date: Sat, 11 Mar 2023 22:10:57 -0800 Subject: [PATCH] No need to set encoding on binary read --- modules/chat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/chat.py b/modules/chat.py index 8a221526..ab5dbc2d 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -321,7 +321,7 @@ def load_history(file, name1, name2): def load_default_history(name1, name2): if Path('logs/persistent.json').exists(): - load_history(open(Path('logs/persistent.json'), 'rb', encoding='utf-8').read(), name1, name2) + load_history(open(Path('logs/persistent.json'), 'rb').read(), name1, name2) else: shared.history['internal'] = [] shared.history['visible'] = [] @@ -355,7 +355,7 @@ def load_character(_character, name1, name2): name2 = shared.settings['name2_pygmalion'] if Path(f'logs/{shared.character}_persistent.json').exists(): - load_history(open(Path(f'logs/{shared.character}_persistent.json'), 'rb', encoding='utf-8').read(), name1, name2) + load_history(open(Path(f'logs/{shared.character}_persistent.json'), 'rb').read(), name1, name2) if shared.args.cai_chat: return name2, context, generate_chat_html(shared.history['visible'], name1, name2, shared.character)