Skip to content

[model] fix: Incorrect usage of the 'check_model_inputs' decorator#457

Open
HSYZhang wants to merge 2 commits intoByteDance-Seed:mainfrom
HSYZhang:fix_check_model_inputs_use_bug_in_model_forward
Open

[model] fix: Incorrect usage of the 'check_model_inputs' decorator#457
HSYZhang wants to merge 2 commits intoByteDance-Seed:mainfrom
HSYZhang:fix_check_model_inputs_use_bug_in_model_forward

Conversation

@HSYZhang
Copy link
Copy Markdown
Contributor

@HSYZhang HSYZhang commented Feb 5, 2026

What does this PR do?

Add concise overview of what this PR aims to achieve or accomplish. Reference related GitHub issues and PRs that

image from transformers.utils.generic import check_model_inputs image

This is a parameter-less decorator, and its usage in VeOmni is incorrect, like this:
image

@check_model_inputs() -> @check_model_inputs

Successfully executed after the fix:
image

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include misc, ci, config, docs, data, dist, omni, logging, model, optim, ckpt, release, task, perf, ops, parallel
    • If this PR involves multiple modules, separate them with , like [ci, data, model]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][parallel, model] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 5, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ HSYZhang
❌ zhanglong.443


zhanglong.443 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions Bot added the fix label Feb 5, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly fixes the usage of the @check_model_inputs decorator across multiple model files. The decorator was being called with parentheses (@check_model_inputs()) which is incorrect for a parameter-less decorator. The fix removes the parentheses, resolving the TypeError at runtime. The change is simple, accurate, and consistently applied. The PR is well-described and ready to merge.

@Luosuu
Copy link
Copy Markdown
Collaborator

Luosuu commented Feb 6, 2026

Hi @HSYZhang , thank you very much. What is your version of transformers?

@Luosuu
Copy link
Copy Markdown
Collaborator

Luosuu commented Feb 6, 2026

In v4.57.3 (the version VeOmni is using now):
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants