Skip to content

[docs] Follow ups for consistent forward docstrings#13779

Merged
sayakpaul merged 7 commits into
mainfrom
follow-ups-consistent-forward-docstrings
May 29, 2026
Merged

[docs] Follow ups for consistent forward docstrings#13779
sayakpaul merged 7 commits into
mainfrom
follow-ups-consistent-forward-docstrings

Conversation

@sayakpaul
Copy link
Copy Markdown
Member

What does this PR do?

Follow ups from #13758 that added utilities in our CI to enforce some consistency in the forward() and call() methods of XXXModel and XXXPipeline classes, respectively. This PR:

  • allows the docstring checker to remove unused args in docstrings
  • checks for missing return types and reports them

I didn't implement placeholders because they tend to go unnoticed over time.

There will be some failures in our current CI because some classes don't document return types properly. We will fix those in a PR basing off of this branch. @stevhliu could you look into that?

@github-actions github-actions Bot added the size/L PR with diff > 200 LOC label May 21, 2026
@sayakpaul sayakpaul marked this pull request as draft May 21, 2026 03:57
@sayakpaul sayakpaul requested review from stevhliu and yiyixuxu May 21, 2026 03:59
stevhliu and others added 2 commits May 29, 2026 07:27
…13830)

Adds a Returns: section to the 43 model forward() and pipeline __call__()
methods flagged by utils/check_forward_call_docstrings.py, which requires a
Returns: section whenever the method has a non-None return annotation.

Descriptions reflect the actual return statements (Output dataclass when
return_dict=True, plain tuple otherwise; bare tensors / lists where
applicable) and reuse each file's existing doc-builder link form. Also
reformats a malformed single-line Returns: in pipeline_aura_flow.py that the
check could not detect.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@sayakpaul sayakpaul marked this pull request as ready for review May 29, 2026 01:58
@sayakpaul
Copy link
Copy Markdown
Member Author

Ready for review!

@yiyixuxu @stevhliu

@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.

Copy link
Copy Markdown
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

lgtm, thanks! 🫡

@sayakpaul
Copy link
Copy Markdown
Member Author

@bot /style

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

Style bot fixed some files and pushed the changes.

@sayakpaul sayakpaul merged commit e87b2a7 into main May 29, 2026
19 of 20 checks passed
@sayakpaul sayakpaul deleted the follow-ups-consistent-forward-docstrings branch May 29, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

models pipelines size/L PR with diff > 200 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants