mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user