Update tiny models and pipeline tests (#23446)

* fix

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
Yih-Dar
2023-05-18 17:29:04 +02:00
committed by GitHub
parent 2406dbdcfa
commit ffad4f1373
9 changed files with 187 additions and 12 deletions

View File

@@ -21,6 +21,7 @@ from transformers.testing_utils import is_torch_available, require_torch, tooslo
from ...generation.test_utils import torch_device
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin
if is_torch_available():
@@ -133,8 +134,11 @@ class CpmAntModelTester:
@require_torch
class CpmAntModelTest(ModelTesterMixin, unittest.TestCase):
class CpmAntModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase):
all_model_classes = (CpmAntModel, CpmAntForCausalLM) if is_torch_available() else ()
pipeline_model_mapping = (
{"feature-extraction": CpmAntModel, "text-generation": CpmAntForCausalLM} if is_torch_available() else {}
)
test_pruning = False
test_missing_keys = False