docs: fix two docstrings that reference names the code does not have - #14733
docs: fix two docstrings that reference names the code does not have#14733iridescentWen wants to merge 2 commits into
Conversation
- transformer_ltx2.py:1449 says `peturbation_mask`; the parameter is `perturbation_mask`, spelled correctly at :253, :273, :314, :316, :623. - pipeline_stable_diffusion_diffedit.py:885,:888 point at `source_image`, but generate_mask's image argument is `image`. Fixes huggingface#14732 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
thanks, if you have any more fixes similar to this, feel free to add it to this PR |
Each documents a name the signature no longer has: - optimization.py:161 num_periods -> num_cycles - autoencoder_kl_ltx2.py:43 dim -> channel_dim - z_image/before_denoise.py:100 vae_scale_factor -> vae_scale_factor_spatial Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Thanks — added three more in The three new ones are parameters that were renamed without the docstring following:
Each verified against the real parameter list via AST, and none of the three sits under a What I looked at and chose not to includeSince you asked for more of the same, it is worth saying which candidates I rejected and why — three
There is one more genuine cluster I have not put here because it is a different problem class and |
Fixes #14732
What's wrong
Two docstrings name something the function does not have, so following the docs leads nowhere.
models/transformers/transformer_ltx2.py`peturbation_mask`perturbation_mask— spelled correctly at:253,:273,:314,:316,:623; the class docstring at:233also reads "perturbation masking". Only this reference drops ther.pipelines/deprecated/.../pipeline_stable_diffusion_diffedit.py`source_image`image—generate_maskhas nosource_imageparameter.For the second one, the parameter list is:
The
source_prompt*names those two lines mention alongside it are real, which is what makes thewrong one misleading rather than obviously broken.
Docstrings only, no behavior change.
Validation
git diff --stat: 2 files, +3/-3.Self-review (per CONTRIBUTING)
Ran the
.ai/skills/self-reviewrubric against.ai/review-rules.md:# Copied from: checked per changed hunk —forward(transformer_ltx2.py:1366) andgenerate_mask(diffedit:845) carry no# Copied fromheader, so editing them directly iscorrect rather than fixing an upstream source and running
make fix-copies.utils/check_copies.pyis outside my sparse checkout, so this is the manual equivalent; CI'sconsistency check will confirm.
docs/page repeats either name.Deliberately excluded
The same AST pass surfaced two larger clusters that I am not touching, so they read as reviewed
rather than missed:
alpha_bar, 27 sites across the scheduler files. The docstrings say "Contains a functionalpha_bar" while the inner function isalpha_bar_fn. That is a conceptual description of whatthe helper does rather than a broken pointer, the sites are linked by
# Copied from, and 27 editsacross that many files is a different kind of change. Happy to send it if you consider it worth
fixing.
enhance_t2v/enhance_i2v/generate_enhanced_prompt, 15 sites. These name helpers that donot exist anywhere in
src/diffusers, so they may be intentional references to external examplecode. I did not want to guess.
The scan needed two rounds of narrowing before it was usable, which is worth stating so the two hits
above are not mistaken for a broad sweep: a module-local symbol table produced far too many hits
because docstrings legitimately reference sibling modules, and lines shaped
- `key`: descriptionenumerate an upstream API's keys rather than the function's own parameters. Both are now excluded.
🤖 Written with Claude Code. Both sites were read in context and the
corrected names were taken from the signature and from the surrounding correct spellings.