Skip to content

fix: resolving errors in the hf decorator function - #983

Merged
ko3n1g merged 2 commits into
NVIDIA-NeMo:mainfrom
dongs0104:main
Dec 20, 2025
Merged

ko3n1g merged 2 commits into
NVIDIA-NeMo:mainfrom
dongs0104:main

Conversation

@dongs0104

Copy link
Copy Markdown
Contributor

What does this PR do ?

Add a one line overview of what this PR aims to accomplish.

Changelog

  • Add specific line by line info of high level changes in this PR.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?

If you haven't finished some of the above items you can still open "Draft" PR.

Additional Information

  • Related to # (issue)

@copy-pr-bot

copy-pr-bot Bot commented Dec 18, 2025

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@akoumpa

akoumpa commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

/ok to test 5c571b6

@hemildesai

Copy link
Copy Markdown
Contributor

Hi @dongs0104, the signature for this function changed in transformers==4.57.3 thus needing to call it as @check_model_inputs() in the decorator. I noticed that transformers version prior to 4.57.3 need it to be called as @check_model_inputs. Maybe we can dynamically get the decorator based on the transformers version, what do you think?

@dongs0104

dongs0104 commented Dec 19, 2025 •

Copy link
Copy Markdown
Contributor Author

Hello @hemildesai , This seems related to huggingface/transformers#40994

In pyproject.toml, the dependency currently defined as transformers<=4.57.3 should be pinned more explicitly—e.g. transformers>=4.57.2,<=4.57.3 or transformers==4.57.3.

@hemildesai

hemildesai commented Dec 19, 2025 •

Copy link
Copy Markdown
Contributor

Hello @hemildesai , This seems related to huggingface/transformers#40994

In pyproject.toml, the dependency currently defined as transformers<=4.57.3 should be pinned more explicitly—e.g. transformers>=4.57.2,<=4.57.3 or transformers==4.57.3.

In order to support different versions, I was thinking something like

check_model_inputs_decorator = check_model_inputs() if transformers_version >= 4.57.3 else check_model_inputs

@check_model_inputs_decorator
...

What do you think?

@hemildesai

Copy link
Copy Markdown
Contributor

Hi @dongs0104, since we need this fix for a downstream release, I can push the change directly to this PR. Hope that's ok.

dongs0104 and others added 2 commits December 19, 2025 19:58
Signed-off-by: Hemil Desai <hemild@nvidia.com>
Signed-off-by: Hemil Desai <hemild@nvidia.com>
@hemildesai

Copy link
Copy Markdown
Contributor

/ok to test 35ffe65

@ko3n1g
ko3n1g merged commit 1d42deb into NVIDIA-NeMo:main Dec 20, 2025
51 of 52 checks passed
linnanwang pushed a commit that referenced this pull request Apr 24, 2026
Signed-off-by: Hemil Desai <hemild@nvidia.com>
Co-authored-by: Hemil Desai <hemild@nvidia.com>
kashif pushed a commit to kashif/Automodel that referenced this pull request May 25, 2026
Signed-off-by: Hemil Desai <hemild@nvidia.com>
Co-authored-by: Hemil Desai <hemild@nvidia.com>

This branch was previously deployed

2 inactive deployments
nemo-ci — 35ffe65b Deployed Dec 20, 2025 by copy-pr-bot[bot] via L2_Datasets #2955
test — 35ffe65b Deployed Dec 19, 2025 by copy-pr-bot[bot] via cicd-wait-in-queue #2955
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants