Skip to content

docs: remove phantom parameters from docstrings - #48576

Merged
vasqu merged 1 commit into
huggingface:mainfrom
simpleqt:docs/remove-phantom-params
Sep 7, 2026
Merged

vasqu merged 1 commit into
huggingface:mainfrom
simpleqt:docs/remove-phantom-params

Conversation

@simpleqt

@simpleqt simpleqt commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

CPU CI GPU run-slow

Docstring-only fixes removing documented parameters that the functions do not accept:

  1. src/transformers/utils/quantization_config.py to_json_file: documented use_diff (bool, …) — this override takes only json_file_path and always writes the full dict (the docstring was copied from PretrainedConfig.to_json_file, which does accept use_diff). Removed the stale entry.
  2. src/transformers/masking_utils.py: create_causal_mask, create_sliding_window_causal_mask and create_chunked_causal_mask each documented cache_position (torch.Tensor): Deprecated and unused — the parameter was removed from all three signatures but the docstring lines were left behind. Removed all three.

Docstrings only — no code change.

- utils/quantization_config.py to_json_file documented a use_diff
  parameter that the override does not accept (copied from
  PretrainedConfig.to_json_file)
- masking_utils.py: three functions documented a cache_position
  parameter marked 'Deprecated and unused' that is not in any of their
  signatures (left behind when the parameter was removed)
Copilot AI lite review requested due to automatic review settings September 6, 2026 18:23

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

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

CI recap

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

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ha indeed, thanks!

@vasqu
vasqu enabled auto-merge September 7, 2026 13:20
@vasqu
vasqu added this pull request to the merge queue Sep 7, 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 345e787 Sep 7, 2026
33 checks passed
sbucaille pushed a commit to sbucaille/transformers that referenced this pull request Sep 16, 2026
- utils/quantization_config.py to_json_file documented a use_diff
  parameter that the override does not accept (copied from
  PretrainedConfig.to_json_file)
- masking_utils.py: three functions documented a cache_position
  parameter marked 'Deprecated and unused' that is not in any of their
  signatures (left behind when the parameter was removed)
pull Bot pushed a commit to sandeepyadav1478/transformers that referenced this pull request Sep 18, 2026
…ace#48904)

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

4 participants