no history for instruct
Describe the bug
when choosing instruct in the chat window there is no history for the instruct mode saved. the log files are empty
Is there an existing issue for this?
- [X] I have searched the existing issues
Reproduction
run a model in instruct and click new chat and try to return to the old one
Screenshot
No response
Logs
no errors
System Info
Windows 11, Nvidia rtx 4090
I'm seeing this problem on Linux as well. But I think I understand why we are getting the failure:
File "/home/rwylliams/ai_goodies/text-generation-webui/modules/chat.py", line 563, in find_all_histories_with_first_prompts if data['internal'][0][0] == '<|BEGIN-VISIBLE-CHAT|>': ~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range
This asks to return the value of BEGIN-VISIBLE-CHAT from the internal collection.
Instruct isn't storing this in the log, as a result you won't get an index and hence list index out of range. This is causing the Past Chats list to not be updated and making Instruct Past chats unavailable via the list.
Chat mode logs put this value in it's logs so doesn't crash out of the function used to update the Past chat list.
Seems like it would be a pretty easy bug fix.
Cheers
I may have found a fix for the problem.
in modules/chat.py:581
if data['internal'][0][0] == '<|BEGIN-VISIBLE-CHAT|>:
add a check for internal having contents:
if len(data['internal']) > 1 and data['internal'][0][0] == '<|BEGIN-VISIBLE-CHAT|>':
And it should work as expected.
Cheers
Hello, this has not been fixed. The problem line is now found modules/chat.py:607 The author of this file is assuming there will always be 'internal' text in the json history file. But there is none for the instruct. As a result when it tries to access data['interna'][0][0] the program crashes out leaving the history column unchanged. all it takes is to apply my change and it's fixed.