Check models used for common tests are small (#24824)
* First models * Conditional DETR * Treat DETR models, skip others * Skip LayoutLMv2 as well * Fix last tests
This commit is contained in:
@@ -2705,6 +2705,18 @@ class ModelTesterMixin:
|
||||
else:
|
||||
new_model_without_prefix(input_ids)
|
||||
|
||||
def test_model_is_small(self):
|
||||
# Just a consistency check to make sure we are not running tests on 80M parameter models.
|
||||
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
|
||||
# print(config)
|
||||
|
||||
for model_class in self.all_model_classes:
|
||||
model = model_class(config)
|
||||
num_params = model.num_parameters()
|
||||
assert (
|
||||
num_params < 1000000
|
||||
), f"{model_class} is too big for the common tests ({num_params})! It should have 200k max."
|
||||
|
||||
|
||||
global_rng = random.Random()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user