Repository navigation
DOC: fix adapter_names parameter name in set_requires_grad docstrings - #3271
Merged
githubnemo merged 1 commit intoJun 23, 2026
Merged
Conversation
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)
Contributor
Author
|
Hi! Just submitted this fix — all checks should pass shortly. Happy to make any adjustments based on feedback. Thanks for reviewing! |
githubnemo
approved these changes
Jun 23, 2026
githubnemo
left a comment
Collaborator
There was a problem hiding this comment.
Thanks, once the CI is through we can merge this :)
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Collaborator
|
Failing tests are unrelated. |
BenjaminBossan
pushed a commit
to BenjaminBossan/peft
that referenced
this pull request
Jun 24, 2026
…huggingface#3271) 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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this fix?
The
set_requires_gradfunction and methods across 4 files document the parameter asadapter_name(singular) but the actual parameter name in every function signature isadapter_names(plural, acceptsstr | Sequence[str]).Also fixes an incorrect
modeldescription in the standaloneset_requires_gradintuners_utils.py— it was copy-pasted fromdelete_adapterand said "The model from which the adapter should be deleted" instead of correctly describing the gradient update operation.Files changed
src/peft/peft_model.py—PeftModel.set_requires_gradsrc/peft/tuners/tuners_utils.py—BaseTuner.set_requires_grad,BaseTunerLayer.set_requires_grad, standaloneset_requires_gradsrc/peft/utils/other.py—AuxiliaryTrainingWrapper.set_requires_grad