Replace 'decord' with 'av' in VideoClassificationPipeline (#29747)

* replace the 'decord' with 'av' in VideoClassificationPipeline

* fix the check of backend in VideoClassificationPipeline

* adjust the order of imports

* format 'video_classification.py'

* format 'video_classification.py' with ruff

---------

Co-authored-by: wanqiancheng <13541261013@163.com>
This commit is contained in:
yunxiangtang
2024-03-26 18:12:24 +08:00
committed by GitHub
parent b5a6d6eeab
commit b32bf85b58
6 changed files with 54 additions and 9 deletions

View File

@@ -57,6 +57,7 @@ from .utils import (
is_aqlm_available,
is_auto_awq_available,
is_auto_gptq_available,
is_av_available,
is_bitsandbytes_available,
is_bs4_available,
is_cv2_available,
@@ -1010,6 +1011,13 @@ def require_aqlm(test_case):
return unittest.skipUnless(is_aqlm_available(), "test requires aqlm")(test_case)
def require_av(test_case):
"""
Decorator marking a test that requires av
"""
return unittest.skipUnless(is_av_available(), "test requires av")(test_case)
def require_bitsandbytes(test_case):
"""
Decorator marking a test that requires the bitsandbytes library. Will be skipped when the library or its hard dependency torch is not installed.