Fix typos in tests (#36547)

Signed-off-by: co63oc <co63oc@users.noreply.github.com>
This commit is contained in:
co63oc
2025-03-06 07:04:06 +08:00
committed by GitHub
parent 752ef3fd4e
commit 996f512d52
99 changed files with 282 additions and 282 deletions

View File

@@ -1490,7 +1490,7 @@ class ModelTesterMixin:
if model.config.is_encoder_decoder:
signature = inspect.signature(model.forward)
arg_names = [*signature.parameters.keys()]
if "decoder_head_mask" in arg_names: # necessary diferentiation because of T5 model
if "decoder_head_mask" in arg_names: # necessary differentiation because of T5 model
inputs["decoder_head_mask"] = head_mask
if "cross_attn_head_mask" in arg_names:
inputs["cross_attn_head_mask"] = head_mask
@@ -1852,7 +1852,7 @@ class ModelTesterMixin:
cloned_embeddings = model_embed.weight.clone()
# Check that resizing the position embeddings with a larger max_position_embeddings increases
# the model's postion embeddings size
# the model's position embeddings size
model.resize_position_embeddings(max_position_embeddings + 10)
self.assertEqual(model.config.max_position_embeddings, max_position_embeddings + 10)
@@ -3998,7 +3998,7 @@ class ModelTesterMixin:
config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
model = model_class(config)
if not self._is_composite:
self.skipTest("This model is not a composte model!")
self.skipTest("This model is not a composite model!")
with tempfile.TemporaryDirectory() as tmpdirname:
model.save_pretrained(tmpdirname)
@@ -4411,9 +4411,9 @@ class ModelTesterMixin:
exported_outputs = exported_model.module().forward(**inputs_dict)
# Check if outputs are close:
# is_tested is a boolean flag idicating if we comapre any outputs,
# is_tested is a boolean flag indicating if we compare any outputs,
# e.g. there might be a situation when outputs are empty list, then is_tested will be False.
# In case of outputs are different the error will be rasied in `recursively_check` function.
# In case of outputs are different the error will be raised in `recursively_check` function.
is_tested = recursively_check(eager_outputs, exported_outputs)
self.assertTrue(is_tested, msg=f"No outputs were compared for {model_class.__name__}")