From eb6112d5a27257ebf65813f8596ca47af5290a34 Mon Sep 17 00:00:00 2001 From: FartyPants Date: Mon, 3 Jul 2023 23:13:38 -0400 Subject: [PATCH] Update server.py - clear LORA after reload (#2952) --- server.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index 804eab5..0dae7ff 100644 --- a/server.py +++ b/server.py @@ -273,17 +273,20 @@ def create_model_menus(): load.click( ui.gather_interface_values, gradio(shared.input_elements), gradio('interface_state')).then( update_model_parameters, gradio('interface_state'), None).then( - partial(load_model_wrapper, autoload=True), gradio('model_menu', 'loader'), gradio('model_status'), show_progress=False) + partial(load_model_wrapper, autoload=True), gradio('model_menu', 'loader'), gradio('model_status'), show_progress=False).then( + lambda: shared.lora_names, None, gradio('lora_menu')) unload.click( unload_model, None, None).then( - lambda: "Model unloaded", None, gradio('model_status')) + lambda: "Model unloaded", None, gradio('model_status')).then( + lambda: shared.lora_names, None, gradio('lora_menu')) reload.click( unload_model, None, None).then( ui.gather_interface_values, gradio(shared.input_elements), gradio('interface_state')).then( update_model_parameters, gradio('interface_state'), None).then( - partial(load_model_wrapper, autoload=True), gradio('model_menu', 'loader'), gradio('model_status'), show_progress=False) + partial(load_model_wrapper, autoload=True), gradio('model_menu', 'loader'), gradio('model_status'), show_progress=False).then( + lambda: shared.lora_names, None, gradio('lora_menu')) save_settings.click( ui.gather_interface_values, gradio(shared.input_elements), gradio('interface_state')).then(