Fix a bug while deleting characters

This commit is contained in:
oobabooga 2023-09-22 06:02:34 -07:00
parent ee7bf49804
commit 95976a9d4f

View File

@ -57,7 +57,7 @@ def create_event_handlers():
shared.gradio['delete_character_confirm'].click( shared.gradio['delete_character_confirm'].click(
chat.delete_character, gradio('character_menu'), None).then( chat.delete_character, gradio('character_menu'), None).then(
lambda: gr.update(visible=False), None, gradio('character_deleter')).then( lambda: gr.update(visible=False), None, gradio('character_deleter')).then(
lambda: gr.update(choices=utils.get_available_characters(), value="None"), None, gradio('character_menu')) lambda: gr.update(choices=(characters := utils.get_available_characters()), value=characters[0]), None, gradio('character_menu'))
shared.gradio['save_character_cancel'].click(lambda: gr.update(visible=False), None, gradio('character_saver')) 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')) shared.gradio['delete_character_cancel'].click(lambda: gr.update(visible=False), None, gradio('character_deleter'))