Unverified Commit 8e67573a authored by Patrick von Platen's avatar Patrick von Platen Committed by GitHub
Browse files

[EncoderDecoder Tests] Improve tests (#4046)



* Hoist bert model tester for patric

* indent

* make tests work

* Update tests/test_modeling_bert.py
Co-authored-by: default avatarJulien Chaumond <chaumond@gmail.com>
Co-authored-by: default avatarsshleifer <sshleifer@gmail.com>
Co-authored-by: default avatarJulien Chaumond <chaumond@gmail.com>
parent 6af3306a
This diff is collapsed.
...@@ -21,7 +21,7 @@ from transformers import is_torch_available ...@@ -21,7 +21,7 @@ from transformers import is_torch_available
# TODO(PVP): this line reruns all the tests in BertModelTest; not sure whether this can be prevented # TODO(PVP): this line reruns all the tests in BertModelTest; not sure whether this can be prevented
# for now only run module with pytest tests/test_modeling_encoder_decoder.py::EncoderDecoderModelTest # for now only run module with pytest tests/test_modeling_encoder_decoder.py::EncoderDecoderModelTest
from .test_modeling_bert import BertModelTest from .test_modeling_bert import BertModelTester
from .utils import require_torch, slow, torch_device from .utils import require_torch, slow, torch_device
...@@ -34,7 +34,7 @@ if is_torch_available(): ...@@ -34,7 +34,7 @@ if is_torch_available():
@require_torch @require_torch
class EncoderDecoderModelTest(unittest.TestCase): class EncoderDecoderModelTest(unittest.TestCase):
def prepare_config_and_inputs_bert(self): def prepare_config_and_inputs_bert(self):
bert_model_tester = BertModelTest.BertModelTester(self) bert_model_tester = BertModelTester(self)
encoder_config_and_inputs = bert_model_tester.prepare_config_and_inputs() encoder_config_and_inputs = bert_model_tester.prepare_config_and_inputs()
decoder_config_and_inputs = bert_model_tester.prepare_config_and_inputs_for_decoder() decoder_config_and_inputs = bert_model_tester.prepare_config_and_inputs_for_decoder()
( (
......
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