Skip to content

Commit

Permalink
ENH error message when choosing wrong bias (#946)
Browse files Browse the repository at this point in the history
Raise an error with a helpful error message when the user chooses an incorrect
option for the bias argument.

---------

Co-authored-by: datta0 <venkatadattasanimmaturi@gmail.com>
  • Loading branch information
Datta0 and datta0 authored Sep 20, 2023
1 parent 1396247 commit ba0477f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/peft/tuners/lora/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def _mark_only_adapters_as_trainable(self) -> None:
if isinstance(m, LoraLayer) and hasattr(m, "bias") and m.bias is not None:
m.bias.requires_grad = True
else:
raise NotImplementedError
raise NotImplementedError(f"Requested bias: {bias}, is not implemented.")

@staticmethod
def _create_new_module(lora_config, adapter_name, target, **kwargs):
Expand Down

0 comments on commit ba0477f

Please sign in to comment.