Update tiny model summary file for recent models (#22637)
* Update tiny model summary file for recent models --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -19,7 +19,7 @@ import inspect
|
||||
import unittest
|
||||
|
||||
from transformers import EfficientNetConfig
|
||||
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
|
||||
from transformers.testing_utils import is_pipeline_test, require_torch, require_vision, slow, torch_device
|
||||
from transformers.utils import cached_property, is_torch_available, is_vision_available
|
||||
|
||||
from ...test_configuration_common import ConfigTester
|
||||
@@ -229,6 +229,12 @@ class EfficientNetModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.Test
|
||||
model = EfficientNetModel.from_pretrained(model_name)
|
||||
self.assertIsNotNone(model)
|
||||
|
||||
@is_pipeline_test
|
||||
@require_vision
|
||||
@slow
|
||||
def test_pipeline_image_classification(self):
|
||||
super().test_pipeline_image_classification()
|
||||
|
||||
|
||||
# We will verify our results on an image of cute cats
|
||||
def prepare_img():
|
||||
|
||||
@@ -31,6 +31,7 @@ from transformers.testing_utils import require_torch, slow, tooslow, torch_devic
|
||||
from ...generation.test_utils import GenerationTesterMixin
|
||||
from ...test_configuration_common import ConfigTester
|
||||
from ...test_modeling_common import ModelTesterMixin, ids_tensor
|
||||
from ...test_pipeline_mixin import PipelineTesterMixin
|
||||
|
||||
|
||||
class GPTSanJapaneseTester:
|
||||
@@ -127,8 +128,19 @@ class GPTSanJapaneseTester:
|
||||
|
||||
|
||||
@require_torch
|
||||
class GPTSanJapaneseTest(ModelTesterMixin, unittest.TestCase):
|
||||
class GPTSanJapaneseTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase):
|
||||
all_model_classes = (GPTSanJapaneseModel,) if is_torch_available() else ()
|
||||
pipeline_model_mapping = (
|
||||
{
|
||||
"conversational": GPTSanJapaneseForConditionalGeneration,
|
||||
"feature-extraction": GPTSanJapaneseForConditionalGeneration,
|
||||
"summarization": GPTSanJapaneseForConditionalGeneration,
|
||||
"text2text-generation": GPTSanJapaneseForConditionalGeneration,
|
||||
"translation": GPTSanJapaneseForConditionalGeneration,
|
||||
}
|
||||
if is_torch_available()
|
||||
else {}
|
||||
)
|
||||
fx_compatible = False
|
||||
is_encoder_decoder = False
|
||||
test_pruning = False
|
||||
@@ -140,6 +152,19 @@ class GPTSanJapaneseTest(ModelTesterMixin, unittest.TestCase):
|
||||
# The small GPTSAN_JAPANESE model needs higher percentages for CPU/MP tests
|
||||
model_split_percents = [0.8, 0.9]
|
||||
|
||||
# TODO: Fix the failed tests when this model gets more usage
|
||||
def is_pipeline_test_to_skip(
|
||||
self, pipeline_test_casse_name, config_class, model_architecture, tokenizer_name, processor_name
|
||||
):
|
||||
if pipeline_test_casse_name == "SummarizationPipelineTests":
|
||||
# TODO: fix `_reorder_cache` is not implemented for this model
|
||||
return True
|
||||
elif pipeline_test_casse_name == "Text2TextGenerationPipelineTests":
|
||||
# TODO: check this.
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def setUp(self):
|
||||
self.model_tester = GPTSanJapaneseTester(self)
|
||||
self.config_tester = ConfigTester(self, config_class=GPTSanJapaneseConfig, d_model=37)
|
||||
|
||||
@@ -299,7 +299,10 @@ class WhisperModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMi
|
||||
def is_pipeline_test_to_skip(
|
||||
self, pipeline_test_casse_name, config_class, model_architecture, tokenizer_name, processor_name
|
||||
):
|
||||
if pipeline_test_casse_name == "AutomaticSpeechRecognitionPipelineTests":
|
||||
if pipeline_test_casse_name in [
|
||||
"AutomaticSpeechRecognitionPipelineTests",
|
||||
"AudioClassificationPipelineTests",
|
||||
]:
|
||||
# RuntimeError: The size of tensor a (1500) must match the size of tensor b (30) at non-singleton
|
||||
# dimension 1
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user