Fix AutoVideoProcessor class lookup when torchvision is unavailable#43989
Fix AutoVideoProcessor class lookup when torchvision is unavailable#43989Abhijeetsingh610 wants to merge 3 commits intohuggingface:mainfrom
Conversation
|
Hi, Does this PR also solve this issue: huggingface/diffusers#13140 (comment) ? Thanks |
|
Thanks for checking. Yes, this PR addresses the same root cause as huggingface/diffusers#13140. |
|
@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. |
|
@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. |
zucchini-nlp
left a comment
There was a problem hiding this comment.
I don't think this is the fix we want. Video processors were originally copied from image processor that have slow/fast versions. But since videos entirely rely on torchvision, we need to raise an error if it's not installed and not skip until the last error message
Same might apply for image processors, only in case when the model has a fast-only processor implemented (we have a couple models only). We need to check if torchvision is installed in L363 elif video_processor_class is None and not is_torchvision_available(): raise ValueError(informative and actioanable message)
|
[For maintainers] Suggested jobs to run (before merge) run-slow: auto |
What does this PR do?
Fixes a crash in
AutoVideoProcessorwhentorchvisionis unavailable.VIDEO_PROCESSOR_MAPPING_NAMEScan containNone, andvideo_processor_class_from_namewas doingif class_name in extractors, which raisesTypeErrorforNone.This PR:
Noneentries invideo_processor_class_from_nametests/models/auto/test_video_processing_auto.pyFixes #43986 #43986