Skip to content

Conversation

yonigozlan
Copy link
Member

As the title says, remove the nested logic import as they were causing some issues when used with modular.

Copy link
Member

@Cyrilvallez Cyrilvallez left a comment

Choose a reason for hiding this comment

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

Ha nice, I actually wanted to do it as well! Could we also remove the other protected imports, such as if is_torch_available etc? Fast image and video processors are protected by default for vision, torchvision and torch!

@yonigozlan
Copy link
Member Author

Ah great! this will simplify things a lot. I'll update this PR!

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

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

run-slow: aria, beit, bridgetower, chameleon, cohere2_vision, colpali, colqwen2, conditional_detr, convnext, deepseek_vl, deepseek_vl_hybrid, deformable_detr, depth_pro, detr, dinov3_vit, donut

@yonigozlan
Copy link
Member Author

Done @Cyrilvallez ! I also removed some imports in modular/modeling files

@yonigozlan yonigozlan merged commit a2ac4de into huggingface:main Sep 17, 2025
23 checks passed
ErfanBaghaei pushed a commit to ErfanBaghaei/transformers that referenced this pull request Sep 25, 2025
* remove nested import logic for torchvision

* remove unnecessary protected imports

* remove unnecessarry protected import in modular (and modeling)

* fix wrongly remove protected imports
vijayabhaskar-ev pushed a commit to vijayabhaskar-ev/transformers that referenced this pull request Oct 2, 2025
* remove nested import logic for torchvision

* remove unnecessary protected imports

* remove unnecessarry protected import in modular (and modeling)

* fix wrongly remove protected imports
yuchenxie4645 pushed a commit to yuchenxie4645/transformers that referenced this pull request Oct 4, 2025
* remove nested import logic for torchvision

* remove unnecessary protected imports

* remove unnecessarry protected import in modular (and modeling)

* fix wrongly remove protected imports
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