mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-06-07 14:17:09 -04:00
Clean up
This commit is contained in:
parent
dce02732a4
commit
acbcc12e7b
2 changed files with 3 additions and 6 deletions
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue