[M2M100Tokenizer] fix _build_translation_inputs (#14382)

* add return_tensors paramter

* fix test

* Apply suggestions from code review

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* style

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
This commit is contained in:
Suraj Patil
2021-11-13 20:57:12 +05:30
committed by GitHub
parent 3165930402
commit 2e60276b38
2 changed files with 2 additions and 2 deletions

View File

@@ -226,7 +226,7 @@ class M2M100TokenizerIntegrationTest(unittest.TestCase):
@require_torch
def test_tokenizer_translation(self):
inputs = self.tokenizer._build_translation_inputs("A test", src_lang="en", tgt_lang="ar")
inputs = self.tokenizer._build_translation_inputs("A test", return_tensors="pt", src_lang="en", tgt_lang="ar")
self.assertEqual(
nested_simplify(inputs),