Skip to content

Commit 47745d5

Browse files
FIX Use correct attribute name for HQQ in merge (#1791)
Without this fix, test_hqq_lora_model_outputs currently fails.
1 parent 1fec231 commit 47745d5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/peft/tuners/lora/model.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,10 @@ def _replace_module(self, parent, child_name, new_module, child):
236236
child = child.base_layer
237237

238238
if not hasattr(new_module, "base_layer"):
239-
new_module.weight = child.weight
239+
if hasattr(new_module, "W_q"): # HQQ
240+
new_module.W_q = child.W_q
241+
else:
242+
new_module.weight = child.weight
240243
if hasattr(child, "bias"):
241244
new_module.bias = child.bias
242245

0 commit comments

Comments
 (0)