Skip to content

Fix: Remove redundant @can_return_tuple conflicting with @capture_out… - #47733

Merged
guarin merged 4 commits into
huggingface:mainfrom
guarin:fix-redundant-can-return-tuple
Aug 4, 2026
Merged

Fix: Remove redundant @can_return_tuple conflicting with @capture_out…#47733
guarin merged 4 commits into
huggingface:mainfrom
guarin:fix-redundant-can-return-tuple

Conversation

@guarin

@guarin guarin commented Aug 3, 2026

Copy link
Copy Markdown
Member

CI

What does this PR do?

Fixes all forward calls that combine @can_return_tuple with @capture_outputs. The two are not compatible because they both pop return_dict from the kwargs which results in only the outermost decorator seeing the true value. @can_return_tuple is redundant in this case because @capture_outputs already handles tuples.

This PR comes a new mlinter rule that checks for this issue: huggingface/transformers-mlinter#14

Code Agent Policy

The Transformers repo is currently being overwhelmed by a large number of PRs and issue comments written by
code agents. These often are low-quality, or fix extremely minor issues that occur rarely or never in practice.
As a result, we're instituting a rule that first-time contributors should not use code agents to submit PRs or issues.
We'd also ask autonomous "OpenClaw"-like agents not to open any PRs or issues.

Issues/PRs from first-time contributors that violate this rule will probably just be closed without review, and we
might block you, especially if you open more than one or appear to be deliberately ignoring this. We especially do not
want new contributors to jump in on random issues to contribute an agent-written fix. This creates lots of noise
for reviewers and other users and will almost certainly get you blocked.

For more information, please read CONTRIBUTING.md.

  • (First-time contributors only): I confirm that this PR description and code is not written by an LLM or code agent

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline and the
    Pull Request checks?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes according to the guidelines?
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@vasqu @molbap

@guarin

guarin commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

run-slow: lasr, llama4, mllama, nemotron_asr_streaming, parakeet, pe_audio, pe_audio_video, pe_video

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Workflow Run ⚙️

This comment contains run-slow, running the specified jobs:

models: ["models/lasr", "models/llama4", "models/mllama", "models/nemotron_asr_streaming", "models/parakeet", "models/pe_audio", "models/pe_audio_video", "models/pe_video"]
quantizations: []

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

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

CI Results

Workflow Run ⚙️

Commit Info

Context Commit Description
RUN af8df988 workflow commit (merge commit)
PR 3761318a branch commit (from PR)
main b317ff31 base commit (on main)

✅ No failing test specific to this PR 🎉 👏 !

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

Yep thanks!

Comment thread src/transformers/models/pe_audio/modeling_pe_audio.py
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: lasr, llama4, mllama, nemotron_asr_streaming, parakeet, pe_audio, pe_audio_video, pe_video

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 30829894960:1
Result: success | Jobs: 5 | Tests: 1,308 | Failures: 0 | Duration: 8m 23s

@guarin
guarin added this pull request to the merge queue Aug 4, 2026
Merged via the queue into huggingface:main with commit 66799f4 Aug 4, 2026
112 checks passed
@guarin
guarin deleted the fix-redundant-can-return-tuple branch August 4, 2026 09:55
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