From acbcc12e7b19cc9f540d32b8d601ceefde77b7a1 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Thu, 29 May 2025 14:11:21 -0700 Subject: [PATCH] Clean up --- modules/chat.py | 7 ++----- modules/ui_chat.py | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/chat.py b/modules/chat.py index 6b3ff4fc..e526a9a0 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -1493,7 +1493,7 @@ def handle_edit_message_click(state): if message_index >= len(history['internal']): html_output = redraw_html(history, state['name1'], state['name2'], state['mode'], state['chat_style'], state['character_menu']) - return [history, html_output, gr.update()] # No unique_id change + return [history, html_output] role_idx = 0 if role == "user" else 1 @@ -1521,13 +1521,10 @@ def handle_edit_message_click(state): add_message_version(history, role, message_index, is_current=True) - # Since we are not branching, unique_id does not change. - past_chats_update = gr.update() - save_history(history, state['unique_id'], state['character_menu'], state['mode']) html_output = redraw_html(history, state['name1'], state['name2'], state['mode'], state['chat_style'], state['character_menu']) - return [history, html_output, past_chats_update] + return [history, html_output] def handle_navigate_version_click(state): diff --git a/modules/ui_chat.py b/modules/ui_chat.py index df3d3929..d79aa523 100644 --- a/modules/ui_chat.py +++ b/modules/ui_chat.py @@ -314,7 +314,7 @@ def create_event_handlers(): shared.gradio['edit_message'].click( ui.gather_interface_values, gradio(shared.input_elements), gradio('interface_state')).then( - chat.handle_edit_message_click, gradio('interface_state'), gradio('history', 'display', 'unique_id'), show_progress=False) + chat.handle_edit_message_click, gradio('interface_state'), gradio('history', 'display'), show_progress=False) # Save/delete a character shared.gradio['save_character'].click(chat.handle_save_character_click, gradio('name2'), gradio('save_character_filename', 'character_saver'), show_progress=False)