Skip to content

Commit

Permalink
fsmt slow test uses lists (#8031)
Browse files Browse the repository at this point in the history
  • Loading branch information
sshleifer authored Oct 26, 2020
1 parent 101186b commit f20aec1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_tokenization_fsmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ def test_match_encode_decode(self):
# for src_text, _ in targets: print(f"""[\n"{src_text}",\n {model.encode(src_text).tolist()}\n],""")

for src_text, tgt_input_ids in targets:
input_ids = tokenizer_enc.encode(src_text, return_tensors="pt")[0].tolist()
self.assertListEqual(input_ids, tgt_input_ids)
encoded_ids = tokenizer_enc.encode(src_text, return_tensors=None)
self.assertListEqual(encoded_ids, tgt_input_ids)

# and decode backward, using the reversed languages model
decoded_text = tokenizer_dec.decode(input_ids, skip_special_tokens=True)
decoded_text = tokenizer_dec.decode(encoded_ids, skip_special_tokens=True)
self.assertEqual(decoded_text, src_text)

@unittest.skip("FSMTConfig.__init__ requires non-optional args")
Expand Down

0 comments on commit f20aec1

Please sign in to comment.