🚨🚨 Generate: standardize beam search behavior across frameworks (#21368)
This commit is contained in:
@@ -426,7 +426,7 @@ class FlaxBartModelTest(FlaxModelTesterMixin, unittest.TestCase, FlaxGenerationT
|
||||
)
|
||||
|
||||
input_ids = tokenizer(input_str, return_tensors="np").input_ids
|
||||
sequences = model.generate(input_ids, num_beams=2, max_length=20).sequences
|
||||
sequences = model.generate(input_ids, num_beams=2, min_length=None, max_length=20).sequences
|
||||
|
||||
output_str = tokenizer.batch_decode(sequences)[0]
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ class FlaxGPT2ModelTest(FlaxModelTesterMixin, FlaxGenerationTesterMixin, unittes
|
||||
output_string = tokenizer.batch_decode(output_sequences, skip_special_tokens=True)
|
||||
|
||||
expected_string = [
|
||||
"Hello this is a long string of words. I'm going to try to explain what I mean.",
|
||||
"Hello this is a long string of words. I'm going to start with the first one.\n",
|
||||
"Hey, I'm not sure if I'm going to be able to do",
|
||||
]
|
||||
|
||||
|
||||
@@ -1076,7 +1076,7 @@ class FlaxT5ModelIntegrationTests(unittest.TestCase):
|
||||
expected_summaries = [
|
||||
'prosecutor: "so far no videos were used in the crash investigation" two magazines claim to have found a'
|
||||
" cell phone video of the final seconds . \"one can hear cries of 'My God' in several languages,\" one"
|
||||
" magazine says . all 150 on board were killed when germanwings flight 9525 crashed .",
|
||||
" magazine says . all 150 on board were killed in the crash .",
|
||||
"the formal accession was marked by a ceremony at The Hague, in the Netherlands . the ICC opened a"
|
||||
" preliminary examination into the situation in the occupied Palestinian territory . as members of the"
|
||||
" court, Palestinians may be subject to counter-charges as well .",
|
||||
|
||||
Reference in New Issue
Block a user