mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-04 13:20:12 +06:00
Fix pipelines tests (#34049)
* Fix wrong skip annotation * Remove error raise
This commit is contained in:
parent
a84c413773
commit
66e08dba71
@ -214,8 +214,6 @@ class PipelineTesterMixin:
|
|||||||
image_processor_names.append(cls_name)
|
image_processor_names.append(cls_name)
|
||||||
elif "FeatureExtractor" in cls_name:
|
elif "FeatureExtractor" in cls_name:
|
||||||
feature_extractor_names.append(cls_name)
|
feature_extractor_names.append(cls_name)
|
||||||
else:
|
|
||||||
raise ValueError(f"Unknown processor class: {cls_name}")
|
|
||||||
|
|
||||||
# Processor classes are not in tiny models JSON file, so extract them from the mapping
|
# Processor classes are not in tiny models JSON file, so extract them from the mapping
|
||||||
# processors are mapped to instance, e.g. "XxxProcessor"
|
# processors are mapped to instance, e.g. "XxxProcessor"
|
||||||
@ -242,12 +240,12 @@ class PipelineTesterMixin:
|
|||||||
commit=commit,
|
commit=commit,
|
||||||
torch_dtype=torch_dtype,
|
torch_dtype=torch_dtype,
|
||||||
)
|
)
|
||||||
|
at_least_one_model_is_tested = True
|
||||||
|
|
||||||
if task in task_to_pipeline_and_spec_mapping:
|
if task in task_to_pipeline_and_spec_mapping:
|
||||||
pipeline, hub_spec = task_to_pipeline_and_spec_mapping[task]
|
pipeline, hub_spec = task_to_pipeline_and_spec_mapping[task]
|
||||||
compare_pipeline_args_to_hub_spec(pipeline, hub_spec)
|
compare_pipeline_args_to_hub_spec(pipeline, hub_spec)
|
||||||
|
|
||||||
at_least_one_model_is_tested = True
|
|
||||||
|
|
||||||
if not at_least_one_model_is_tested:
|
if not at_least_one_model_is_tested:
|
||||||
self.skipTest(
|
self.skipTest(
|
||||||
f"{self.__class__.__name__}::test_pipeline_{task.replace('-', '_')}_{torch_dtype} is skipped: Could not find any "
|
f"{self.__class__.__name__}::test_pipeline_{task.replace('-', '_')}_{torch_dtype} is skipped: Could not find any "
|
||||||
|
Loading…
Reference in New Issue
Block a user