mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
Refresh the character dropdown when saving/deleting a character
This commit is contained in:
parent
890b4abdad
commit
3e0a9f9cdb
@ -508,7 +508,6 @@ def load_character(character, name1, name2, instruct=False):
|
||||
context = shared.settings['context']
|
||||
name2 = shared.settings['name2']
|
||||
greeting = shared.settings['greeting']
|
||||
turn_template = shared.settings['turn_template']
|
||||
|
||||
return name1, name2, picture, greeting, context, turn_template.replace("\n", r"\n")
|
||||
|
||||
|
@ -54,12 +54,13 @@ def create_event_handlers():
|
||||
|
||||
shared.gradio['save_character_confirm'].click(
|
||||
chat.save_character, gradio('name2', 'greeting', 'context', 'character_picture', 'save_character_filename'), None).then(
|
||||
lambda: gr.update(visible=False), None, gradio('character_saver'))
|
||||
lambda: gr.update(visible=False), None, gradio('character_saver')).then(
|
||||
lambda x: gr.update(choices=utils.get_available_characters(), value=x), gradio('save_character_filename'), gradio('character_menu'))
|
||||
|
||||
shared.gradio['delete_character_confirm'].click(
|
||||
chat.delete_character, gradio('character_menu'), None).then(
|
||||
lambda: gr.update(visible=False), None, gradio('character_deleter')).then(
|
||||
lambda: gr.update(choices=utils.get_available_characters()), None, gradio('character_menu'))
|
||||
lambda: gr.update(choices=utils.get_available_characters(), value="None"), None, gradio('character_menu'))
|
||||
|
||||
shared.gradio['save_character_cancel'].click(lambda: gr.update(visible=False), None, gradio('character_saver'))
|
||||
shared.gradio['delete_character_cancel'].click(lambda: gr.update(visible=False), None, gradio('character_deleter'))
|
||||
|
Loading…
Reference in New Issue
Block a user