mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-02-11 02:04:20 +01:00
Handle edge case in chat history loading (closes #7155)
This commit is contained in:
parent
d746484521
commit
f08bb9a201
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue