Skip to content

Commit

Permalink
Merge pull request #12584 from AUTOMATIC1111/full-module-with-bias
Browse files Browse the repository at this point in the history
Add ex_bias into full module
  • Loading branch information
AUTOMATIC1111 committed Aug 15, 2023
2 parents f01682e + aa57a89 commit 8b181c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion extensions-builtin/Lora/network_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ def __init__(self, net: network.Network, weights: network.NetworkWeights):
super().__init__(net, weights)

self.weight = weights.w.get("diff")
self.ex_bias = weights.w.get("diff_b")

def calc_updown(self, orig_weight):
output_shape = self.weight.shape
updown = self.weight.to(orig_weight.device, dtype=orig_weight.dtype)
if self.ex_bias is not None:
ex_bias = self.ex_bias.to(orig_weight.device, dtype=orig_weight.dtype)
else:
ex_bias = None

return self.finalize_updown(updown, orig_weight, output_shape)
return self.finalize_updown(updown, orig_weight, output_shape, ex_bias)

0 comments on commit 8b181c8

Please sign in to comment.