[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:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user