Update tiny models for pipeline testing. (#24364)

* fix

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
Yih-Dar
2023-06-20 14:43:10 +02:00
committed by GitHub
parent 56efbf4301
commit c23d131eab
15 changed files with 110 additions and 29 deletions

View File

@@ -16,7 +16,7 @@ import unittest
import numpy as np
from transformers import MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING
from transformers import MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING, TF_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING
from transformers.pipelines import AudioClassificationPipeline, pipeline
from transformers.testing_utils import (
is_pipeline_test,
@@ -31,9 +31,9 @@ from .test_pipelines_common import ANY
@is_pipeline_test
@require_torch
class AudioClassificationPipelineTests(unittest.TestCase):
model_mapping = MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING
tf_model_mapping = TF_MODEL_FOR_AUDIO_CLASSIFICATION_MAPPING
def get_test_pipeline(self, model, tokenizer, processor):
audio_classifier = AudioClassificationPipeline(model=model, feature_extractor=processor)

View File

@@ -18,7 +18,12 @@ from typing import Dict
import numpy as np
from transformers import MODEL_FOR_MASK_GENERATION_MAPPING, is_vision_available, pipeline
from transformers import (
MODEL_FOR_MASK_GENERATION_MAPPING,
TF_MODEL_FOR_MASK_GENERATION_MAPPING,
is_vision_available,
pipeline,
)
from transformers.pipelines import MaskGenerationPipeline
from transformers.testing_utils import (
is_pipeline_test,
@@ -58,6 +63,9 @@ class MaskGenerationPipelineTests(unittest.TestCase):
model_mapping = dict(
(list(MODEL_FOR_MASK_GENERATION_MAPPING.items()) if MODEL_FOR_MASK_GENERATION_MAPPING else [])
)
tf_model_mapping = dict(
(list(TF_MODEL_FOR_MASK_GENERATION_MAPPING.items()) if TF_MODEL_FOR_MASK_GENERATION_MAPPING else [])
)
def get_test_pipeline(self, model, tokenizer, processor):
image_segmenter = MaskGenerationPipeline(model=model, image_processor=processor)
@@ -66,7 +74,7 @@ class MaskGenerationPipelineTests(unittest.TestCase):
"./tests/fixtures/tests_samples/COCO/000000039769.png",
]
# TODO: Fix me @Arthur
# TODO: Implement me @Arthur
def run_pipeline_test(self, mask_generator, examples):
pass