Skip to content

Commit

Permalink
FIX Use correct attribute name for HQQ in merge (#1791)
Browse files Browse the repository at this point in the history
Without this fix, test_hqq_lora_model_outputs currently fails.
  • Loading branch information
BenjaminBossan authored May 22, 2024
1 parent 1fec231 commit 47745d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/peft/tuners/lora/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ def _replace_module(self, parent, child_name, new_module, child):
child = child.base_layer

if not hasattr(new_module, "base_layer"):
new_module.weight = child.weight
if hasattr(new_module, "W_q"): # HQQ
new_module.W_q = child.W_q
else:
new_module.weight = child.weight
if hasattr(child, "bias"):
new_module.bias = child.bias

Expand Down

0 comments on commit 47745d5

Please sign in to comment.