Skip to content

Fix AutoVideoProcessor class lookup when torchvision is unavailable#43989

Open
Abhijeetsingh610 wants to merge 2 commits intohuggingface:mainfrom
Abhijeetsingh610:fix1-43986-video-processor-none-mapping
Open

Fix AutoVideoProcessor class lookup when torchvision is unavailable#43989
Abhijeetsingh610 wants to merge 2 commits intohuggingface:mainfrom
Abhijeetsingh610:fix1-43986-video-processor-none-mapping

Conversation

@Abhijeetsingh610
Copy link

@Abhijeetsingh610 Abhijeetsingh610 commented Feb 13, 2026

What does this PR do?

Fixes a crash in AutoVideoProcessor when torchvision is unavailable.

VIDEO_PROCESSOR_MAPPING_NAMES can contain None, and video_processor_class_from_name was doing if class_name in extractors, which raises TypeError for None.

This PR:

  • skips None entries in video_processor_class_from_name
  • adds a regression test in tests/models/auto/test_video_processing_auto.py

Fixes #43986 #43986

@github-actions
Copy link
Contributor

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

run-slow: auto

@christopher5106
Copy link

Hi,

Does this PR also solve this issue: huggingface/diffusers#13140 (comment)

?

Thanks

@Abhijeetsingh610
Copy link
Author

Thanks for checking. Yes, this PR addresses the same root cause as huggingface/diffusers#13140.
In that issue, the crash happens in transformers.models.auto.video_processing_auto.video_processor_class_from_name when a mapping entry is None (typically when torchvision is unavailable) and code checks class_name in extractors.
This PR adds a None guard for that lookup and includes a regression test.
So once this is merged and released in transformers, that diffusers issue should be resolved when using the updated transformers version.

@Frojdholm
Copy link

@christopher5106 note that the root cause for the crash is you not having torchvision installed.

If your model requires a video processor it will not work since this will not create one. If the video processor is optional this might solve your issue.

@christopher5106
Copy link

@Frojdholm the bug appears on an image model, Qwen-Image and Qwen-Image-Edit. In that case, there is no video in inputs and outputs.

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.

Confusing crash when loading a video model through AutoProcessor without torchvision installed

4 participants