Skip to content

Fix case where _LazyAutoMapping.register is passed a str key - #47148

Merged
ArthurZucker merged 1 commit into
huggingface:mainfrom
hmellor:fix-auto-mapping
Jul 8, 2026
Merged

Fix case where _LazyAutoMapping.register is passed a str key#47148
ArthurZucker merged 1 commit into
huggingface:mainfrom
hmellor:fix-auto-mapping

Conversation

@hmellor

@hmellor hmellor commented Jul 7, 2026

Copy link
Copy Markdown
Member

CI

Downstream users of the auto classes register classes using str keys (i.e. model type). #46876 added an early exit that causes all downstream usage like this to fail with AttributeError: 'str' object has no attribute '__module__'.

This PR adds a getattr so that downstream usage of _LazyAutoMapping.register is not broken.

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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

run-slow: auto

@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 Jul 7, 2026

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 28893516277:1
Result: failure | Jobs: 15 | Tests: 172,739 | Failures: 1 | Duration: 22h 19m

@hmellor
hmellor requested a review from vasqu July 8, 2026 07:40

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

lgtm

@ArthurZucker
ArthurZucker merged commit 73cde7c into huggingface:main Jul 8, 2026
101 of 104 checks passed
hmellor added a commit that referenced this pull request Jul 8, 2026
)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@hmellor
hmellor deleted the fix-auto-mapping branch July 8, 2026 09:31
stevhliu pushed a commit to stevhliu/transformers that referenced this pull request Jul 30, 2026
…gingface#47148)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
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