Skip to content

Commit

Permalink
Revert "fsmt slow test uses lists (huggingface#8031)"
Browse files Browse the repository at this point in the history
This reverts commit b79010f.
  • Loading branch information
fabiocapsouza authored Nov 15, 2020
1 parent c65fc02 commit 1f626e2
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:
encoded_ids = tokenizer_enc.encode(src_text, return_tensors=None)
self.assertListEqual(encoded_ids, tgt_input_ids)
input_ids = tokenizer_enc.encode(src_text, return_tensors="pt")[0].tolist()
self.assertListEqual(input_ids, tgt_input_ids)

# and decode backward, using the reversed languages model
decoded_text = tokenizer_dec.decode(encoded_ids, skip_special_tokens=True)
decoded_text = tokenizer_dec.decode(input_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 1f626e2

Please sign in to comment.