From a210e61df1a32b8716841d4f26a19ceaaf40d5fa Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 4 Jul 2024 20:30:27 -0700 Subject: [PATCH] UI: Fix broken chat histories not showing (closes #6196) --- modules/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/chat.py b/modules/chat.py index 920c0f7b..6640776f 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -577,7 +577,7 @@ def find_all_histories_with_first_prompts(state): data = json.load(f) first_prompt = "" - if 'visible' in data and len(data['visible']) > 0: + if data and 'visible' in data and len(data['visible']) > 0: if data['internal'][0][0] == '<|BEGIN-VISIBLE-CHAT|>': if len(data['visible']) > 1: first_prompt = html.unescape(data['visible'][1][0])