Skip to content

Commit

Permalink
remove "if bias exist" check
Browse files Browse the repository at this point in the history
  • Loading branch information
KohakuBlueleaf committed Aug 14, 2023
1 parent e7c03cc commit f70ded8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extensions-builtin/Lora/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def network_apply_weights(self: Union[torch.nn.Conv2d, torch.nn.Linear, torch.nn
self.network_weights_backup = weights_backup

bias_backup = getattr(self, "network_bias_backup", None)
if bias_backup is None and getattr(self, 'bias', None) is not None:
if bias_backup is None:
if isinstance(self, torch.nn.MultiheadAttention) and self.out_proj.bias is not None:
bias_backup = self.out_proj.bias.to(devices.cpu, copy=True)
elif getattr(self, 'bias', None) is not None:
Expand Down

0 comments on commit f70ded8

Please sign in to comment.