(self)
| 627 | |
| 628 | |
| 629 | def test_encode(self): |
| 630 | model_name = 'gpt2' |
| 631 | model_args = ModelArguments(model_name_or_path=model_name) |
| 632 | model = HFDecoderModel(model_args) |
| 633 | self.assertEqual(model.encode(test_encode_input), test_encode_output) |
| 634 | |
| 635 | batch_encode_input = [test_encode_input] * 2 |
| 636 | batch_encode_output = [test_encode_output] * 2 |
| 637 | self.assertEqual(model.encode(batch_encode_input)['input_ids'], batch_encode_output) |
| 638 | |
| 639 | |
| 640 | def test_decode(self): |
nothing calls this directly
no test coverage detected