Skip to content

Fix multi token decode merging - #47762

Merged
IlyasMoutawwakil merged 1 commit into
mainfrom
fix-exporters
Aug 4, 2026
Merged

Fix multi token decode merging#47762
IlyasMoutawwakil merged 1 commit into
mainfrom
fix-exporters

Conversation

@IlyasMoutawwakil

@IlyasMoutawwakil IlyasMoutawwakil commented Aug 4, 2026

Copy link
Copy Markdown
Member

CI

What does this PR do?

Some testing models have use_cache=False and we didn't account for that in the merging process, and in other cases some models just can't support multi token decode (only support decoding one token).

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.

@IlyasMoutawwakil
IlyasMoutawwakil requested a review from vasqu August 4, 2026 08:43
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

CI recap

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

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

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

Small comments but otherwise LGTM

# Concatenation assumes single-token decode steps. When `use_cache` is off the steps re-run the whole
# growing sequence (query length > 1) — each is already a valid multi-token forward, so take the last.
def query_length(call: dict) -> int | None:
for key in ("input_ids", "inputs_embeds"):

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.

input_features, input_values for audio potentially?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

those are only passed to the encoder i believe (prefill), not during decoding

@IlyasMoutawwakil
IlyasMoutawwakil added this pull request to the merge queue Aug 4, 2026
Merged via the queue into main with commit cf8572d Aug 4, 2026
115 checks passed
@IlyasMoutawwakil
IlyasMoutawwakil deleted the fix-exporters branch August 4, 2026 10:39
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