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