Skip to content

DOC: fix adapter_names parameter name in set_requires_grad docstrings#3271

Open
kratos0718 wants to merge 1 commit into
huggingface:mainfrom
kratos0718:fix/set-requires-grad-docstring
Open

DOC: fix adapter_names parameter name in set_requires_grad docstrings#3271
kratos0718 wants to merge 1 commit into
huggingface:mainfrom
kratos0718:fix/set-requires-grad-docstring

Conversation

@kratos0718

Copy link
Copy Markdown

What does this fix?

The set_requires_grad function and methods across 4 files document the parameter as adapter_name (singular) but the actual parameter name in every function signature is adapter_names (plural, accepts str | Sequence[str]).

Also fixes an incorrect model description in the standalone set_requires_grad in tuners_utils.py — it was copy-pasted from delete_adapter and said "The model from which the adapter should be deleted" instead of correctly describing the gradient update operation.

Files changed

  • src/peft/peft_model.pyPeftModel.set_requires_grad
  • src/peft/tuners/tuners_utils.pyBaseTuner.set_requires_grad, BaseTunerLayer.set_requires_grad, standalone set_requires_grad
  • src/peft/utils/other.pyAuxiliaryTrainingWrapper.set_requires_grad

The `set_requires_grad` function and methods across 4 files documented
the parameter as `adapter_name` (singular) but the actual parameter name
is `adapter_names` (plural, accepts str or Sequence[str]).

Also fixes an incorrect description for the `model` parameter in the
standalone `set_requires_grad` function in tuners_utils.py, which was
copy-pasted from `delete_adapter` and said "The model from which the
adapter should be deleted" instead of describing the gradient update.

Affected locations:
- src/peft/peft_model.py (PeftModel.set_requires_grad)
- src/peft/tuners/tuners_utils.py (BaseTuner.set_requires_grad,
  BaseTunerLayer.set_requires_grad, standalone set_requires_grad)
- src/peft/utils/other.py (AuxiliaryTrainingWrapper.set_requires_grad)
@kratos0718

Copy link
Copy Markdown
Author

Hi! Just submitted this fix — all checks should pass shortly. Happy to make any adjustments based on feedback. Thanks for reviewing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant