Skip to content

Commit

Permalink
add turn-on keys
Browse files Browse the repository at this point in the history
  • Loading branch information
wj-Mcat committed Dec 26, 2022
1 parent 9ffc3ab commit b417b75
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/transformers/test_modeling_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class ModelTesterMixin:
test_resize_position_embeddings = False
test_mismatched_shapes = True
test_missing_keys = True

test_model_compatibility_keys = False

use_test_inputs_embeds = False
use_test_model_name_list = True
is_encoder_decoder = False
Expand Down Expand Up @@ -526,6 +529,10 @@ def random_choice_pretrained_config_field(self) -> Optional[str]:
return random.choice(fields)

def test_for_missed_attribute(self):
if not self.test_model_compatibility_keys:
self.skipTest(f"Do not test model_compatibility_keys on {self.base_model_class}")
return

config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
for model_class in self.all_model_classes:
if not model_class.constructed_from_pretrained_config():
Expand Down

0 comments on commit b417b75

Please sign in to comment.