mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Update expected values in constrained beam search tests (#17887)
* fix Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
parent
e02037b352
commit
0b0dd97737
@ -2510,8 +2510,8 @@ class GenerationIntegrationTests(unittest.TestCase):
|
||||
self.assertListEqual(
|
||||
generated_text,
|
||||
[
|
||||
"The soldiers were not prepared and didn't know how big the big weapons would be, so they scared them"
|
||||
" off. They had no idea what to do",
|
||||
"The soldiers were not prepared and didn't know what to do. They had no idea how they would react if"
|
||||
" the enemy attacked them, big weapons scared"
|
||||
],
|
||||
)
|
||||
|
||||
@ -2549,8 +2549,9 @@ class GenerationIntegrationTests(unittest.TestCase):
|
||||
self.assertListEqual(
|
||||
generated_text,
|
||||
[
|
||||
"The soldiers, who were all scared and screaming at each other as they tried to get out of the",
|
||||
"The child was taken to a local hospital where she screamed and scared for her life, police said.",
|
||||
"The soldiers, who had been stationed at the base for more than a year before being evacuated"
|
||||
" screaming scared",
|
||||
"The child was taken to a local hospital where he died.\n 'I don't think screaming scared",
|
||||
],
|
||||
)
|
||||
|
||||
@ -2585,8 +2586,9 @@ class GenerationIntegrationTests(unittest.TestCase):
|
||||
self.assertListEqual(
|
||||
generated_text,
|
||||
[
|
||||
"The soldiers, who were all scared and screaming at each other as they tried to get out of the",
|
||||
"The child was taken to a local hospital where she screamed and scared for her life, police said.",
|
||||
"The soldiers, who had been stationed at the base for more than a year before being evacuated"
|
||||
" screaming scared",
|
||||
"The child was taken to a local hospital where he died.\n 'I don't think screaming scared",
|
||||
],
|
||||
)
|
||||
|
||||
@ -2612,7 +2614,7 @@ class GenerationIntegrationTests(unittest.TestCase):
|
||||
|
||||
outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
||||
|
||||
self.assertListEqual(outputs, ["Wie alter sind Sie?"])
|
||||
self.assertListEqual(outputs, ["Wie alt sind Sie?"])
|
||||
|
||||
@slow
|
||||
def test_constrained_beam_search_example_integration(self):
|
||||
@ -2656,7 +2658,7 @@ class GenerationIntegrationTests(unittest.TestCase):
|
||||
)
|
||||
outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
||||
|
||||
self.assertListEqual(outputs, ["Wie alter sind Sie?"])
|
||||
self.assertListEqual(outputs, ["Wie alt sind Sie?"])
|
||||
|
||||
def test_constrained_beam_search_mixin_type_checks(self):
|
||||
tokenizer = AutoTokenizer.from_pretrained("patrickvonplaten/t5-tiny-random")
|
||||
|
Loading…
Reference in New Issue
Block a user