UI: Fix broken chat histories not showing (closes #6196)

This commit is contained in:
oobabooga 2024-07-04 20:30:27 -07:00
parent e79e7b90dc
commit a210e61df1

View File

@ -577,7 +577,7 @@ def find_all_histories_with_first_prompts(state):
data = json.load(f) data = json.load(f)
first_prompt = "" 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 data['internal'][0][0] == '<|BEGIN-VISIBLE-CHAT|>':
if len(data['visible']) > 1: if len(data['visible']) > 1:
first_prompt = html.unescape(data['visible'][1][0]) first_prompt = html.unescape(data['visible'][1][0])