From 0ad7c1807e3e9ca4344b5b732448513c77c2be5a Mon Sep 17 00:00:00 2001 From: daniel-z-kaplan <48258016+daniel-z-kaplan@users.noreply.github.com> Date: Wed, 18 Oct 2023 23:55:34 -0400 Subject: [PATCH] Update utils.py fixed error with stride --- megatron/model/encoders/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/megatron/model/encoders/utils.py b/megatron/model/encoders/utils.py index 15ce3f4c8..ae1320bc2 100644 --- a/megatron/model/encoders/utils.py +++ b/megatron/model/encoders/utils.py @@ -20,10 +20,10 @@ def add_lora(model): elif isinstance(child, nn.Conv2d): weight = child.weight bias = child.bias - new = LoraConv2d(child.in_channels, child.out_channels, child.kernel_size[0], r = 128, dtype = torch.float32) + new = LoraConv2d(child.in_channels, child.out_channels, child.kernel_size[0], r = 128, dtype = torch.float32, stride = child.stride) new.weight = weight new.bias = bias - new.stride = child.stride + # new.stride = child.stride new.padding = child.padding new.dilation = child.dilation setattr(model, child_name, new)