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

@@ -21,7 +21,7 @@ from transformers.pipelines import VideoClassificationPipeline, pipeline
from transformers.testing_utils import (
is_pipeline_test,
nested_simplify,
require_decord,
require_av,
require_tf,
require_torch,
require_torch_or_tf,
@@ -34,7 +34,7 @@ from .test_pipelines_common import ANY
@is_pipeline_test
@require_torch_or_tf
@require_vision
@require_decord
@require_av
class VideoClassificationPipelineTests(unittest.TestCase):
model_mapping = MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING