Unverified Commit 25245ec2 authored by amyeroberts's avatar amyeroberts Committed by GitHub
Browse files

Rename test_model_common_attributes -> test_model_get_set_embeddings (#31321)

* Rename to test_model_common_attributes
The method name is misleading - it is testing being able to get and set embeddings, not common attributes to all models

* Explicitly skip
parent c1be42f6
......@@ -53,7 +53,7 @@ NOT_DEVICE_TESTS = {
"test_torch_save_load",
"test_initialization",
"test_forward_signature",
"test_model_common_attributes",
"test_model_get_set_embeddings",
"test_model_main_input_name",
"test_correct_missing_keys",
"test_tie_model_weights",
......
......@@ -171,7 +171,7 @@ class AlignVisionModelTest(ModelTesterMixin, unittest.TestCase):
pass
@unittest.skip(reason="AlignVisionModel does not support input and output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
def test_forward_signature(self):
......@@ -489,7 +489,7 @@ class AlignModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase):
pass
@unittest.skip(reason="AlignModel does not have input/output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
# override as the `temperature` parameter initilization is different for ALIGN
......
......@@ -153,7 +153,7 @@ class AltCLIPVisionModelTest(ModelTesterMixin, unittest.TestCase):
def test_inputs_embeds(self):
pass
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
for model_class in self.all_model_classes:
......@@ -459,7 +459,7 @@ class AltCLIPModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase)
pass
@unittest.skip(reason="CLIPModel does not have input/output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
# override as the `logit_scale` parameter initilization is different for AltCLIP
......
......@@ -185,7 +185,7 @@ class ASTModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase):
def test_inputs_embeds(self):
pass
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
for model_class in self.all_model_classes:
......
......@@ -212,7 +212,6 @@ class AutoformerModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCa
test_missing_keys = False
test_torchscript = False
test_inputs_embeds = False
test_model_common_attributes = False
def setUp(self):
self.model_tester = AutoformerModelTester(self)
......@@ -403,6 +402,10 @@ class AutoformerModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCa
def test_retain_grad_hidden_states_attentions(self):
super().test_retain_grad_hidden_states_attentions()
@unittest.skip(reason="Model does not have input embeddings")
def test_model_get_set_embeddings(self):
pass
def prepare_batch(filename="train-batch.pt"):
file = hf_hub_download(repo_id="hf-internal-testing/tourism-monthly-batch", filename=filename, repo_type="dataset")
......
......@@ -809,7 +809,7 @@ class BarkFineModelTest(ModelTesterMixin, unittest.TestCase):
expected_arg_names = ["codebook_idx", "input_ids"]
self.assertListEqual(arg_names[:2], expected_arg_names)
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
# one embedding layer per codebook
config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
......
......@@ -270,7 +270,7 @@ class BeitModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase):
def test_feed_forward_chunking(self):
pass
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
for model_class in self.all_model_classes:
......
......@@ -196,7 +196,7 @@ class BitModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase):
pass
@unittest.skip(reason="Bit does not support input and output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
def test_model(self):
......
......@@ -168,7 +168,7 @@ class BlipVisionModelTest(ModelTesterMixin, unittest.TestCase):
def test_inputs_embeds(self):
pass
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
for model_class in self.all_model_classes:
......@@ -462,7 +462,7 @@ class BlipModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase):
pass
@unittest.skip(reason="BlipModel does not have input/output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
# override as the `logit_scale` parameter initilization is different for Blip
......@@ -867,7 +867,7 @@ class BlipVQAModelTest(ModelTesterMixin, unittest.TestCase):
pass
@unittest.skip(reason="BlipModel does not have input/output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
......@@ -901,7 +901,7 @@ class BlipTextRetrievalModelTest(ModelTesterMixin, unittest.TestCase):
pass
@unittest.skip(reason="BlipModel does not have input/output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
def test_forward_signature(self):
......@@ -1129,7 +1129,7 @@ class BlipTextImageModelTest(ModelTesterMixin, unittest.TestCase):
pass
@unittest.skip(reason="BlipModel does not have input/output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
def test_forward_signature(self):
......
......@@ -162,7 +162,7 @@ class Blip2VisionModelTest(ModelTesterMixin, unittest.TestCase):
def test_inputs_embeds(self):
pass
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
for model_class in self.all_model_classes:
......@@ -463,7 +463,7 @@ class Blip2ForConditionalGenerationDecoderOnlyTest(ModelTesterMixin, GenerationT
pass
@unittest.skip(reason="Blip2Model does not have input/output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
@unittest.skip(reason="There's no base Blip2Model")
......@@ -722,7 +722,7 @@ class Blip2ModelTest(ModelTesterMixin, PipelineTesterMixin, GenerationTesterMixi
pass
@unittest.skip(reason="Blip2Model does not have input/output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
@unittest.skip(reason="There's no base Blip2Model")
......
......@@ -499,7 +499,7 @@ class BridgeTowerModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestC
)
@unittest.skip(reason="""Bridge Tower does not have input/output embeddings. So this test is not applicable.""")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
@unittest.skip(reason="""Bridge Tower does not have input/output embeddings. Thus this test is not applicable.""")
......
......@@ -506,7 +506,7 @@ class CanineModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase):
pass
@unittest.skip("CANINE does not have a get_input_embeddings() method.")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
@unittest.skip(
......
......@@ -441,7 +441,7 @@ class ChineseCLIPVisionModelTest(ModelTesterMixin, unittest.TestCase):
def test_inputs_embeds(self):
pass
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
for model_class in self.all_model_classes:
......@@ -589,7 +589,7 @@ class ChineseCLIPModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestC
pass
@unittest.skip(reason="ChineseCLIPModel does not have input/output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
# override as the `logit_scale` parameter initilization is different for CHINESE_CLIP
......
......@@ -177,7 +177,7 @@ class ClapAudioModelTest(ModelTesterMixin, unittest.TestCase):
def test_inputs_embeds(self):
pass
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
for model_class in self.all_model_classes:
......@@ -533,7 +533,7 @@ class ClapModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase):
pass
@unittest.skip(reason="ClapModel does not have input/output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
# override as the `logit_scale` parameter initilization is different for CLAP
......
......@@ -191,7 +191,7 @@ class CLIPVisionModelTest(ModelTesterMixin, unittest.TestCase):
def test_inputs_embeds(self):
pass
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
for model_class in self.all_model_classes:
......@@ -506,7 +506,7 @@ class CLIPModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase):
pass
@unittest.skip(reason="CLIPModel does not have input/output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
# override as the `logit_scale` parameter initilization is different for CLIP
......@@ -783,7 +783,7 @@ class CLIPForImageClassificationModelTest(ModelTesterMixin, PipelineTesterMixin,
pass
@unittest.skip(reason="CLIPForImageClassification does not support inputs_embeds")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
@unittest.skip(reason="CLIPForImageClassification does not support gradient checkpointing yet")
......
......@@ -169,7 +169,7 @@ class CLIPSegVisionModelTest(ModelTesterMixin, unittest.TestCase):
def test_inputs_embeds(self):
pass
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
for model_class in self.all_model_classes:
......@@ -490,7 +490,7 @@ class CLIPSegModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase)
pass
@unittest.skip(reason="CLIPSegModel does not have input/output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
@unittest.skip(
......
......@@ -489,7 +489,7 @@ class ClvpModelForConditionalGenerationTest(ModelTesterMixin, unittest.TestCase)
pass
@unittest.skip(reason="ClvpModelForConditionalGeneration does not have get_input_embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
# override as the `logit_scale` parameter initilization is different for Clvp
......
......@@ -251,7 +251,7 @@ class ConditionalDetrModelTest(ModelTesterMixin, GenerationTesterMixin, Pipeline
pass
@unittest.skip(reason="Conditional DETR does not have a get_input_embeddings method")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
@unittest.skip(reason="Conditional DETR is not a generative model")
......
......@@ -202,7 +202,7 @@ class ConvNextModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCase
pass
@unittest.skip(reason="ConvNext does not support input and output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
@unittest.skip(reason="ConvNext does not use feedforward chunking")
......
......@@ -210,7 +210,7 @@ class ConvNextV2ModelTest(ModelTesterMixin, PipelineTesterMixin, unittest.TestCa
pass
@unittest.skip(reason="ConvNextV2 does not support input and output embeddings")
def test_model_common_attributes(self):
def test_model_get_set_embeddings(self):
pass
@unittest.skip(reason="ConvNextV2 does not use feedforward chunking")
......
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