mirror of
https://github.com/wassname/peft.git
synced 2026-10-30 13:21:29 +08:00
Update lora.py
This commit is contained in:
1 parent
173dc3dedf
commit
1a8928c5a4
1 file changed
+3
-1
@@ -494,6 +494,8 @@ if is_bnb_available():
|
||||
|
||||
def forward(self, x: torch.Tensor):
|
||||
result = super().forward(x)
|
||||
if self.r > 0:
|
||||
if self.disable_adapters:
|
||||
return result
|
||||
elif self.r > 0:
|
||||
result += self.lora_B(self.lora_A(self.lora_dropout(x))) * self.scaling
|
||||
return result
|
||||
Reference in new issue
Block a user