Fix the character pfp not appearing when switching from instruct to chat modes

This commit is contained in:
oobabooga 2025-06-16 18:45:44 -07:00
parent be3d371290
commit 66e991841a

View file

@ -1849,6 +1849,11 @@ def handle_character_picture_change(picture):
def handle_mode_change(state):
history, loaded_unique_id = load_latest_history(state)
histories = find_all_histories_with_first_prompts(state)
# Ensure character picture cache exists
if state['mode'] in ['chat', 'chat-instruct'] and state['character_menu'] and state['character_menu'] != 'None':
generate_pfp_cache(state['character_menu'])
html = redraw_html(history, state['name1'], state['name2'], state['mode'], state['chat_style'], state['character_menu'])
convert_to_markdown.cache_clear()