-
Notifications
You must be signed in to change notification settings - Fork 30.6k
Remove nested import logic for torchvision #40940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove nested import logic for torchvision #40940
Conversation
There was a problem hiding this 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
!
Ah great! this will simplify things a lot. I'll update this PR! |
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. |
…m/yonigozlan/transformers into remove-nested-torchvision-imports
[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 |
Done @Cyrilvallez ! I also removed some imports in modular/modeling files |
* remove nested import logic for torchvision * remove unnecessary protected imports * remove unnecessarry protected import in modular (and modeling) * fix wrongly remove protected imports
* remove nested import logic for torchvision * remove unnecessary protected imports * remove unnecessarry protected import in modular (and modeling) * fix wrongly remove protected imports
* remove nested import logic for torchvision * remove unnecessary protected imports * remove unnecessarry protected import in modular (and modeling) * fix wrongly remove protected imports
As the title says, remove the nested logic import as they were causing some issues when used with modular.