From 38a7fd685d4ed669fde78e54c9423a38588202b6 Mon Sep 17 00:00:00 2001 From: Remowylliams Date: Sun, 5 Oct 2025 09:34:47 -0500 Subject: [PATCH] chat.py fixes Instruct mode History --- modules/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/chat.py b/modules/chat.py index ad2f4001..70c55b74 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -1194,7 +1194,7 @@ def find_all_histories_with_first_prompts(state): if re.match(r'^[0-9]{8}-[0-9]{2}-[0-9]{2}-[0-9]{2}$', filename): first_prompt = "" if data and 'visible' in data and len(data['visible']) > 0: - if data['internal'][0][0] == '<|BEGIN-VISIBLE-CHAT|>': + if len(data['internal']) > 1 and data['internal'][0][0] == '<|BEGIN-VISIBLE-CHAT|>': if len(data['visible']) > 1: first_prompt = html.unescape(data['visible'][1][0]) elif i == 0: