Unverified Commit 7eaae83f authored by Sayak Paul's avatar Sayak Paul Committed by GitHub
Browse files

[LoRA] fix: torch.compile() for lora conv (#5298)

fix: torch.compile() for lora conv
parent 872ae1dd
...@@ -164,7 +164,10 @@ class LoRACompatibleConv(nn.Conv2d): ...@@ -164,7 +164,10 @@ class LoRACompatibleConv(nn.Conv2d):
hidden_states, self.weight, self.bias, self.stride, self.padding, self.dilation, self.groups hidden_states, self.weight, self.bias, self.stride, self.padding, self.dilation, self.groups
) )
else: else:
return super().forward(hidden_states) + (scale * self.lora_layer(hidden_states)) original_outputs = F.conv2d(
hidden_states, self.weight, self.bias, self.stride, self.padding, self.dilation, self.groups
)
return original_outputs + (scale * self.lora_layer(hidden_states))
class LoRACompatibleLinear(nn.Linear): class LoRACompatibleLinear(nn.Linear):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment