SIGN IN SIGN UP

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

158577 0 0 Python

fix: protect torch imports in processing files and fix import guards

- Guard import torch in processing_cohere_asr.py with is_torch_available()
- Add @requires(backends=("torch",)) to CohereAsrProcessor
- Fix is_vision_available() to use actual import test instead of find_spec
- Fix is_torchvision_available() and is_timm_available() to require vision
- Fix is_pytesseract_available() to require vision
- Fix is_mistral_common_available() to require vision
- Add setdefault for image_processing_backends in __init__.py
- Guard import torchvision in sam3/modeling_sam3.py and processing_sam3_video.py
- Add @requires(backends=("torch", "torchvision")) to Sam3PreTrainedModel
- Add @requires(backends=("torch", "torchvision")) to Sam3VideoProcessor
- Add CI checks for torch-only and PIL-only import scenarios

Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
A
Arthur committed
16d437e43adffaef9cd60070563f2afe6a5703a4
Parent: 97b7727