Skip to content

docs: fix docstring parameters that do not match signatures - #48904

Merged
stevhliu merged 1 commit into
huggingface:mainfrom
simpleqt:sq918/stopping-criteria-doc
Sep 18, 2026
Merged

stevhliu merged 1 commit into
huggingface:mainfrom
simpleqt:sq918/stopping-criteria-doc

Conversation

@simpleqt

@simpleqt simpleqt commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

CPU CI GPU run-slow

Docstring parameters that do not match signatures

Follows up on #48575/#48576 in the same lane.

Changes

  1. src/transformers/generation/stopping_criteria.py (MaxTimeCriteria, autodoc'd in internal/generation_utils.md): the prose and Args entry say initial_time, but the parameter is initial_timestamp (line 106).
  2. src/transformers/loss/loss_rt_detr.py (RTDetrLoss) and src/transformers/loss/loss_d_fine.py (DFineLoss): both docstrings documented seven constructor parameters (matcher, weight_dict, losses, alpha, gamma, eos_coef, num_classes) that don't exist — __init__(self, config) builds all of them internally from config. The documented matcher type (DetrHungarianMatcher) was also stale vs the instantiated RTDetrHungarianMatcher. Replaced each block with a single config entry.

AI disclosure

This PR is AI-assisted (ZCode agent, GLM), continuing my merged #48575/#48576 scope (docstring-vs-signature fixes); I am not aware of an existing open PR covering these files (checked via gh pr list --search on the touched paths). Each mismatch was verified by reading the signature immediately below the docstring, and the touched files byte-compile. I have personally reviewed every line.

- MaxTimeCriteria: the docstring prose and Args entry said
  'initial_time'; the parameter is 'initial_timestamp'.
- RTDetrLoss / DFineLoss: the Args blocks documented seven constructor
  parameters that do not exist (they are attributes built internally
  from config, and the matcher type was also stale); replaced with a
  single config entry.

Follows up on huggingface#48575/huggingface#48576 in the same docstring-vs-signature lane.
Copilot AI lite review requested due to automatic review settings September 17, 2026 17:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 35252705908
Result: success | Grafana metrics are not available yet.

@Rocketknight1

Copy link
Copy Markdown
Member

cc @stevhliu

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

lgtm thanks! in the future, you can bundle the changes in #48905 with this one to avoid making many small PRs :)

@stevhliu
stevhliu added this pull request to the merge queue Sep 18, 2026
@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.

Merged via the queue into huggingface:main with commit c9ad4a7 Sep 18, 2026
34 checks passed
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.

5 participants