diff --git a/modules/chat.py b/modules/chat.py index dad3d8b3..d83e9490 100644 --- a/modules/chat.py +++ b/modules/chat.py @@ -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") diff --git a/modules/ui_file_saving.py b/modules/ui_file_saving.py index 4ccc3126..b4674426 100644 --- a/modules/ui_file_saving.py +++ b/modules/ui_file_saving.py @@ -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'))