Skip to content

Add check_model_inits.py - #47656

Merged
guarin merged 4 commits into
huggingface:mainfrom
guarin:add-check-model-inits
Aug 7, 2026
Merged

Add check_model_inits.py#47656
guarin merged 4 commits into
huggingface:mainfrom
guarin:add-check-model-inits

Conversation

@guarin

@guarin guarin commented Jul 30, 2026

Copy link
Copy Markdown
Member

CI

What does this PR do?

Automatically checks and generates src/transformers/models/__init__.py through check_model_inits.py.

The file used to be checked by check_inits.py but those checks are skipped since ~1y (#36827).

I created a new file instead of modifying check_inits.py to keep it clean and not mess with the old one. Happy to merge/overwrite if that is preferred.

If this PR looks good I think we can also auto-generate most models/<model>/__init__.py files as they follow a pretty standard schema. Draft PR for follow-up is here: guarin#2

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.

@Cyrilvallez

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

@Cyrilvallez Cyrilvallez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very nice! Let's simply overwrite the old one though, no need to keep it inside the lib! Allowed me to open #47764 with the inexistent models lol

@guarin

guarin commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

Thanks for the review, updated! Always nice to get rid of some old unused code 馃槆

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

CI recap

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

@Cyrilvallez Cyrilvallez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perfect thanks a lot, very welcome qol improvement

@guarin
guarin added this pull request to the merge queue Aug 7, 2026
Merged via the queue into huggingface:main with commit 5f121dc Aug 7, 2026
111 checks passed
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