Skip to content

Sync function docstrings with their signatures#3329

Merged
BenjaminBossan merged 1 commit into
huggingface:mainfrom
DaoyuanLi2816:fix/docstring-signature-sync
Jun 29, 2026
Merged

Sync function docstrings with their signatures#3329
BenjaminBossan merged 1 commit into
huggingface:mainfrom
DaoyuanLi2816:fix/docstring-signature-sync

Conversation

@DaoyuanLi2816

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes function docstrings that drifted from their actual signatures (no functional changes).

1. Wrong parameter name (adapter_nameadapter_names). set_requires_grad (in AuxiliaryTrainingWrapper, BaseTuner, BaseTunerLayer, PeftModel, and the module-level helper) and BaseTunerLayer.set_adapter all take a parameter named adapter_names (plural), but their Args: sections documented adapter_name. Following the docs (set_requires_grad(adapter_name=...)) raises TypeError. Renamed the docstring entry to match the signature.

2. Spurious Args: model on delegating methods. PeftModel.get_layer_status(self) and PeftModel.get_model_status(self) take no model argument — they delegate to the module-level get_layer_status(model) / get_model_status(model) functions. Their docstrings had an Args: model (...) block (copied from those functions) describing a parameter the methods don't accept. Removed it from the two methods; the module-level functions (which do take model) keep their Args unchanged.

Before submitting

@DaoyuanLi2816 DaoyuanLi2816 force-pushed the fix/docstring-signature-sync branch from c1f6ba5 to 1b794b9 Compare June 27, 2026 19:50
@DaoyuanLi2816

Copy link
Copy Markdown
Contributor Author

Gentle ping on this one, @BenjaminBossan. It's the function-docstring/signature half of the same audit as #3319 and #3328 (both merged), covering peft_model.py and tuners_utils.py. It still merges cleanly — happy to rebase or adjust anything whenever you have a chance to take a look. Thanks!

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

@BenjaminBossan BenjaminBossan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the docstrings, LGTM.

@BenjaminBossan BenjaminBossan merged commit 314e988 into huggingface:main Jun 29, 2026
10 checks passed
@DaoyuanLi2816 DaoyuanLi2816 deleted the fix/docstring-signature-sync branch July 1, 2026 21:36
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.

3 participants