[generate] do_sample default back to False (#3298)

* change do_samples back

* None better default as boolean

* adapt do_sample to True in test example

* make style
This commit is contained in:
Patrick von Platen
2020-03-17 15:52:37 +01:00
committed by GitHub
parent 2187c49f5c
commit e8f44af5bf
6 changed files with 30 additions and 22 deletions

View File

@@ -285,7 +285,12 @@ class BartHeadTests(unittest.TestCase):
max_length = 5
new_input_ids = lm_model.generate(
input_ids.clone(), num_return_sequences=1, num_beams=2, no_repeat_ngram_size=3, max_length=max_length
input_ids.clone(),
do_sample=True,
num_return_sequences=1,
num_beams=2,
no_repeat_ngram_size=3,
max_length=max_length,
)
self.assertEqual(new_input_ids.shape, (input_ids.shape[0], max_length - 1))
# TODO(SS): uneven length batches, empty inputs