🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
Fix release full (#45029)
* first part of the fix
* fix torch imports
* revert
* fix: make from transformers import * work without torch
- `is_torchvision_available`, `is_timm_available`, `is_torchaudio_available`,
`is_torchao_available`, `is_accelerate_available` now return False when
torch is not installed, since all these packages require torch
- Add `@requires(backends=("torch",))` to `PI0Processor` (was missing,
causing the lazy module to crash on import without torch)
- Fix wrong availability guards: `is_vision_available` → `is_torchvision_available`
in pixtral processor, `is_torch_available` in smolvlm processor
- Wrap bare `import torch` / torchvision imports in `processing_sam3_video.py`
- Quote `torch.Tensor` in return type annotation of `tokenization_mistral_common.py`
- Wrap 66 `image_processing_pil_*.py` imports from torch-dependent counterparts
in try/except with ImagesKwargs fallbacks; quote `torch.Tensor` annotations
- Restore explicit `from transformers import *` check in CircleCI
`check_repository_consistency` job
Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
* up
* style of this
* revert: remove src/models changes, keep only core import fixes
The PIL image processor changes are too fragile (break on make fix-repo).
Keep only the core fixes:
- is_torchvision/timm/torchaudio/torchao/accelerate_available() check torch
- CircleCI explicit import check
- tokenization_mistral_common.py torch.Tensor annotation
- processing_sam3_video.py conditional torch imports
- processing_pixtral.py/processing_smolvlm.py availability guard fixes
- PI0Processor @requires decorator
Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
* nit
* the mega quidproquo
* use rquires(backend
* more pil fixes
* fixes
* temp update
* up?
* is this it?
* style?
* revert a bunch of ai shit
* pi0 requires this
* revert some stuffs
* upd
* the fix
* yups
* ah
* up
* up
* fix
* yes?
* update
* up
* nits
* up
* up
* order
---------
Co-authored-by: Claude Sonnet 4.6 (1M context) <[email protected]> A
Arthur committed
97b7727e1129bcaebe42ce57ce37fa1a48847a89
Parent: 78bdaf0
Committed by GitHub <[email protected]>
on 3/27/2026, 12:11:22 AM