DOC: fix adapter_names parameter name in set_requires_grad docstrings#3271
Open
kratos0718 wants to merge 1 commit into
Open
DOC: fix adapter_names parameter name in set_requires_grad docstrings#3271kratos0718 wants to merge 1 commit into
kratos0718 wants to merge 1 commit into
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)
Author
|
Hi! Just submitted this fix — all checks should pass shortly. Happy to make any adjustments based on feedback. Thanks for reviewing! |
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