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.
This commit is contained in:
CalamitousFelicitousness
2026-05-09 15:55:51 +01:00
parent 4aca63e841
commit db4a345a1b
+1
View File
@@ -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)