From 894f34678e63e6abc47bca57a84b6841420c9184 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Fri, 18 Aug 2023 17:08:19 +0530 Subject: [PATCH] Some more fixes for multi-lora use-these-settings --- ui/media/js/dnd.js | 8 -------- ui/media/js/multi-model-selector.js | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/media/js/dnd.js b/ui/media/js/dnd.js index 7af94905..7baa27b3 100644 --- a/ui/media/js/dnd.js +++ b/ui/media/js/dnd.js @@ -292,10 +292,6 @@ const TASK_MAPPING = { use_lora_model: { name: "LoRA model", setUI: (use_lora_model) => { - if (!use_lora_model) { - return - } - let modelPaths = [] use_lora_model.forEach((m) => { if (m.includes("models\\lora\\")) { @@ -333,10 +329,6 @@ const TASK_MAPPING = { lora_alpha: { name: "LoRA Strength", setUI: (lora_alpha) => { - if (!lora_alpha) { - return - } - loraModelField.modelWeights = lora_alpha }, readUI: () => { diff --git a/ui/media/js/multi-model-selector.js b/ui/media/js/multi-model-selector.js index 6dc4e795..472ed81a 100644 --- a/ui/media/js/multi-model-selector.js +++ b/ui/media/js/multi-model-selector.js @@ -204,6 +204,10 @@ class MultiModelSelector { set modelNames(newModelNames) { this.resizeEntryList(newModelNames.length) + if (newModelNames.length === 0) { + this.getModelElements()[0].name.value = "" + } + // assign to the corresponding elements let currElements = this.getModelElements() for (let i = 0; i < newModelNames.length; i++) { @@ -220,6 +224,10 @@ class MultiModelSelector { set modelWeights(newModelWeights) { this.resizeEntryList(newModelWeights.length) + if (newModelWeights.length === 0) { + this.getModelElements()[0].weight.value = this.defaultWeight + } + // assign to the corresponding elements let currElements = this.getModelElements() for (let i = 0; i < newModelWeights.length; i++) {