Skip to content

Comments

Fix AutoModel typing Import Error#13178

Merged
DN6 merged 1 commit intomainfrom
automodel-fix-import-errors
Feb 24, 2026
Merged

Fix AutoModel typing Import Error#13178
DN6 merged 1 commit intomainfrom
automodel-fix-import-errors

Conversation

@dg845
Copy link
Collaborator

@dg845 dg845 commented Feb 24, 2026

What does this PR do?

#13123 introduced an error where we use a Python <3.9 style type hint with Optional[...] and Union[...] without importing them from typing. This PR fixes this by converting the type hint to a Python >=3.9 style type hint, which does not need those imports.

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.

@DN6
@sayakpaul

@dg845 dg845 requested review from DN6 and sayakpaul February 24, 2026 00:04
@HuggingFaceDocBuilderDev

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.

Copy link
Collaborator

@DN6 DN6 left a comment

Choose a reason for hiding this comment

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

Thanks for catching!

@DN6 DN6 merged commit 7ab2011 into main Feb 24, 2026
12 checks passed
@dg845 dg845 deleted the automodel-fix-import-errors branch February 24, 2026 02:47
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