From af5c3329d727f21bb32ef952346e07ea96d8a0cc Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Tue, 1 Feb 2022 11:09:49 +0100 Subject: [PATCH] remove "inputs" in tf common test script (no longer required) (#15262) Co-authored-by: ydshieh --- tests/test_modeling_tf_common.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/test_modeling_tf_common.py b/tests/test_modeling_tf_common.py index dda3c244c5..b100ac3ff9 100644 --- a/tests/test_modeling_tf_common.py +++ b/tests/test_modeling_tf_common.py @@ -377,10 +377,6 @@ class TFModelTesterMixin: else: pt_inputs_dict[name] = torch.from_numpy(key.numpy()).to(torch.long) - # need to rename encoder-decoder "inputs" for PyTorch - if "inputs" in pt_inputs_dict and self.is_encoder_decoder: - pt_inputs_dict["input_ids"] = pt_inputs_dict.pop("inputs") - with torch.no_grad(): pto = pt_model(**pt_inputs_dict) tfo = tf_model(self._prepare_for_class(inputs_dict, model_class), training=False) @@ -422,9 +418,6 @@ class TFModelTesterMixin: pt_inputs_dict[name] = torch.from_numpy(key.numpy()).to(torch.float32) else: pt_inputs_dict[name] = torch.from_numpy(key.numpy()).to(torch.long) - # need to rename encoder-decoder "inputs" for PyTorch - if "inputs" in pt_inputs_dict and self.is_encoder_decoder: - pt_inputs_dict["input_ids"] = pt_inputs_dict.pop("inputs") with torch.no_grad(): pto = pt_model(**pt_inputs_dict)