From db4a345a1b5d5a31881217490d7d848ec5faf134 Mon Sep 17 00:00:00 2001 From: CalamitousFelicitousness Date: Sat, 9 May 2026 15:55:51 +0100 Subject: [PATCH] fix(lora): set GLora dim so alpha scaling is applied Without self.dim, NetworkModule.calc_scale returns 1.0 even when alpha is present, silently dropping the trained scaling. Use w1b.shape[0] as the rank, matching the network_lora and network_hada conventions. --- modules/lora/network_glora.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/lora/network_glora.py b/modules/lora/network_glora.py index ffcb25986..3f00327c3 100644 --- a/modules/lora/network_glora.py +++ b/modules/lora/network_glora.py @@ -19,6 +19,7 @@ class NetworkModuleGLora(network.NetworkModule): # pylint: disable=abstract-meth self.w1b = weights.w["b1.weight"] self.w2a = weights.w["a2.weight"] self.w2b = weights.w["b2.weight"] + self.dim = self.w1b.shape[0] def calc_updown(self, target): # pylint: disable=arguments-differ w1a = self.w1a.to(target.device, dtype=target.dtype)