fix assert (#11935)

This commit is contained in:
Philip May
2021-05-31 10:02:10 +02:00
committed by GitHub
parent 04a9709c27
commit fb60c309c6

View File

@@ -102,10 +102,11 @@ class DebertaV2TokenizationTest(TokenizerTesterMixin, unittest.TestCase):
encoded_sentence = tokenizer.build_inputs_with_special_tokens(text) encoded_sentence = tokenizer.build_inputs_with_special_tokens(text)
encoded_pair = tokenizer.build_inputs_with_special_tokens(text, text_2) encoded_pair = tokenizer.build_inputs_with_special_tokens(text, text_2)
assert encoded_sentence == [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id] self.assertEqual([tokenizer.cls_token_id] + text + [tokenizer.sep_token_id], encoded_sentence)
assert encoded_pair == [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id] + text_2 + [ self.assertEqual(
tokenizer.sep_token_id [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id] + text_2 + [tokenizer.sep_token_id],
] encoded_pair,
)
def test_tokenizer_integration(self): def test_tokenizer_integration(self):
tokenizer_classes = [self.tokenizer_class] tokenizer_classes = [self.tokenizer_class]