chat.py fixes Instruct mode History

This commit is contained in:
Remowylliams 2025-10-05 09:34:47 -05:00 committed by GitHub
parent 8c9df34696
commit 38a7fd685d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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): if re.match(r'^[0-9]{8}-[0-9]{2}-[0-9]{2}-[0-9]{2}$', filename):
first_prompt = "" first_prompt = ""
if data and '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['internal']) > 1 and 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])
elif i == 0: elif i == 0: