"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "67d074874d285e616393c65a0e670088e1b6b74a"
Commit 2085f209 authored by matt's avatar matt
Browse files

Fix a sneaky reference to compute_loss in the tests

parent 979ca24e
...@@ -1064,7 +1064,7 @@ class TFModelTesterMixin: ...@@ -1064,7 +1064,7 @@ class TFModelTesterMixin:
config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() config, inputs_dict = 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:
model = model_class(config) model = model_class(config)
if getattr(model, "compute_loss", None): if getattr(model, "hf_compute_loss", None):
# The number of elements in the loss should be the same as the number of elements in the label # The number of elements in the loss should be the same as the number of elements in the label
prepared_for_class = self._prepare_for_class(inputs_dict.copy(), model_class, return_labels=True) prepared_for_class = self._prepare_for_class(inputs_dict.copy(), model_class, return_labels=True)
added_label = prepared_for_class[ added_label = prepared_for_class[
......
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