[Pipeline] skip feature extraction test if in IMAGE_PROCESSOR_MAPPING (#20790)

skip feature extraction test if in `IMAGE_PROCESSOR_MAPPING`
This commit is contained in:
Younes Belkada
2022-12-16 12:46:58 +01:00
committed by GitHub
parent 1543cee7c8
commit 4341f4e224

View File

@@ -18,6 +18,7 @@ import numpy as np
from transformers import ( from transformers import (
FEATURE_EXTRACTOR_MAPPING, FEATURE_EXTRACTOR_MAPPING,
IMAGE_PROCESSOR_MAPPING,
MODEL_MAPPING, MODEL_MAPPING,
TF_MODEL_MAPPING, TF_MODEL_MAPPING,
FeatureExtractionPipeline, FeatureExtractionPipeline,
@@ -178,7 +179,11 @@ class FeatureExtractionPipelineTests(unittest.TestCase, metaclass=PipelineTestCa
if tokenizer is None: if tokenizer is None:
self.skipTest("No tokenizer") self.skipTest("No tokenizer")
return return
elif type(model.config) in FEATURE_EXTRACTOR_MAPPING or isinstance(model.config, LxmertConfig): elif (
type(model.config) in FEATURE_EXTRACTOR_MAPPING
or isinstance(model.config, LxmertConfig)
or type(model.config) in IMAGE_PROCESSOR_MAPPING
):
self.skipTest("This is a bimodal model, we need to find a more consistent way to switch on those models.") self.skipTest("This is a bimodal model, we need to find a more consistent way to switch on those models.")
return return
elif model.config.is_encoder_decoder: elif model.config.is_encoder_decoder: