Skip to content

qa: more lazy loading#45599

Draft
tarekziade wants to merge 5 commits intomainfrom
tarekziade-more-lazy-loading
Draft

qa: more lazy loading#45599
tarekziade wants to merge 5 commits intomainfrom
tarekziade-more-lazy-loading

Conversation

@tarekziade
Copy link
Copy Markdown
Collaborator

What does this PR do?

Per #44273 there are a few spots where we can do more lazy loading to speed up import transformers without complexifying the code too much

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

@tarekziade
Copy link
Copy Markdown
Collaborator Author

The public API of transformers.utils forces me to be very agressive on hub.py -- I am not sure if it's worth the added complexity.

The current patch reduces to 270 imports / and 0.5 seconds on my M5

@LysandreJik WDYT?

I feel like doing this can be quite fragile/painful to maintain..

@tarekziade tarekziade marked this pull request as draft April 23, 2026 09:17
@tarekziade tarekziade requested a review from LysandreJik April 23, 2026 09:17
@github-actions
Copy link
Copy Markdown
Contributor

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=45599&sha=3c10a2

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.

2 participants