Unverified Commit 80e3b363 authored by Sylvain Gugger's avatar Sylvain Gugger
Browse files

Really fix quality due to ruff release

parent ef28df05
...@@ -56,8 +56,10 @@ if is_torch_available(): ...@@ -56,8 +56,10 @@ if is_torch_available():
@is_pipeline_test @is_pipeline_test
class AutomaticSpeechRecognitionPipelineTests(unittest.TestCase): class AutomaticSpeechRecognitionPipelineTests(unittest.TestCase):
model_mapping = dict((list(MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING.items()) if MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING else []) model_mapping = dict(
+ (MODEL_FOR_CTC_MAPPING.items() if MODEL_FOR_CTC_MAPPING else [])) (list(MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING.items()) if MODEL_FOR_SPEECH_SEQ_2_SEQ_MAPPING else [])
+ (MODEL_FOR_CTC_MAPPING.items() if MODEL_FOR_CTC_MAPPING else [])
)
def get_test_pipeline(self, model, tokenizer, processor): def get_test_pipeline(self, model, tokenizer, processor):
if tokenizer is None: if tokenizer is None:
......
...@@ -80,11 +80,11 @@ def mask_to_test_readable_only_shape(mask: Image) -> Dict: ...@@ -80,11 +80,11 @@ def mask_to_test_readable_only_shape(mask: Image) -> Dict:
@require_timm @require_timm
@require_torch @require_torch
class ImageSegmentationPipelineTests(unittest.TestCase): class ImageSegmentationPipelineTests(unittest.TestCase):
model_mapping = dict(( model_mapping = dict(
list(MODEL_FOR_IMAGE_SEGMENTATION_MAPPING.items()) if MODEL_FOR_IMAGE_SEGMENTATION_MAPPING else [] (list(MODEL_FOR_IMAGE_SEGMENTATION_MAPPING.items()) if MODEL_FOR_IMAGE_SEGMENTATION_MAPPING else [])
)
+ (MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING.items() if MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING else []) + (MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING.items() if MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING else [])
+ (MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING.items() if MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING else [])) + (MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING.items() if MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING else [])
)
def get_test_pipeline(self, model, tokenizer, processor): def get_test_pipeline(self, model, tokenizer, processor):
image_segmenter = ImageSegmentationPipeline(model=model, image_processor=processor) image_segmenter = ImageSegmentationPipeline(model=model, image_processor=processor)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment