From a43ef6ec72f322804d6e4ad712705e127ad96ee9 Mon Sep 17 00:00:00 2001 From: Sourab Mangrulkar <13534540+pacman100@users.noreply.github.com> Date: Wed, 8 Mar 2023 00:53:08 +0530 Subject: [PATCH] fixing ds conv1D issue thanks to @dumpmemory --- src/peft/tuners/lora.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/peft/tuners/lora.py b/src/peft/tuners/lora.py index ed10675..301bfd4 100644 --- a/src/peft/tuners/lora.py +++ b/src/peft/tuners/lora.py @@ -164,7 +164,9 @@ class LoraModel(torch.nn.Module): elif self.peft_config.enable_lora is not None: kwargs.update({"enable_lora": self.peft_config.enable_lora}) if isinstance(target, Conv1D): - in_features, out_features = target.weight.shape + in_features, out_features = ( + target.weight.ds_shape if hasattr(target.weight, "ds_shape") else target.weight.shape + ) else: in_features, out_features = target.in_features, target.out_features if kwargs["fan_in_fan_out"]: