From 48ac0f22dff6800c867e9206285cff1a9010f9f9 Mon Sep 17 00:00:00 2001 From: Viacheslav Soloviov Date: Thu, 20 Jun 2024 18:04:22 +0300 Subject: [PATCH] Fix lora weight fetch in isSameBatch, in viewer.html In the 'viewer.html' file, this update corrects the comparison of 'lora' weight by fetching it from the correct object. Previously, regardless of the object in context, the weight was being fetched inappropriately solely from object 'a'. This might have resulted in inaccurate comparisons when the source object should have been 'b'. --- viewer.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/viewer.html b/viewer.html index 56a9b1e..f587898 100755 --- a/viewer.html +++ b/viewer.html @@ -1527,10 +1527,10 @@ const [aLoRAKeys, bLoRAKeys] = [a, b].map((item) => Object.keys(item).filter((key) => key.startsWith("LoRA [")) ); - const [aLoRAs, bLoRAs] = [aLoRAKeys, bLoRAKeys].map((keys) => + const [aLoRAs, bLoRAs] = [{obj: a, keys: aLoRAKeys}, {obj: b, keys: bLoRAKeys}].map(({obj, keys}) => keys.map((key) => { const LoRAName = key.split("]")[0].replace("[", ""); - const LoRAWeight = a[key]; + const LoRAWeight = obj[key]; return { LoRAName, LoRAWeight }; }) );