Unverified Commit 0b0dd977 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Update expected values in constrained beam search tests (#17887)



* fix
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent e02037b3
...@@ -2510,8 +2510,8 @@ class GenerationIntegrationTests(unittest.TestCase): ...@@ -2510,8 +2510,8 @@ class GenerationIntegrationTests(unittest.TestCase):
self.assertListEqual( self.assertListEqual(
generated_text, generated_text,
[ [
"The soldiers were not prepared and didn't know how big the big weapons would be, so they scared them" "The soldiers were not prepared and didn't know what to do. They had no idea how they would react if"
" off. They had no idea what to do", " the enemy attacked them, big weapons scared"
], ],
) )
...@@ -2549,8 +2549,9 @@ class GenerationIntegrationTests(unittest.TestCase): ...@@ -2549,8 +2549,9 @@ class GenerationIntegrationTests(unittest.TestCase):
self.assertListEqual( self.assertListEqual(
generated_text, generated_text,
[ [
"The soldiers, who were all scared and screaming at each other as they tried to get out of the", "The soldiers, who had been stationed at the base for more than a year before being evacuated"
"The child was taken to a local hospital where she screamed and scared for her life, police said.", " 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): ...@@ -2585,8 +2586,9 @@ class GenerationIntegrationTests(unittest.TestCase):
self.assertListEqual( self.assertListEqual(
generated_text, generated_text,
[ [
"The soldiers, who were all scared and screaming at each other as they tried to get out of the", "The soldiers, who had been stationed at the base for more than a year before being evacuated"
"The child was taken to a local hospital where she screamed and scared for her life, police said.", " 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): ...@@ -2612,7 +2614,7 @@ class GenerationIntegrationTests(unittest.TestCase):
outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True) outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True)
self.assertListEqual(outputs, ["Wie alter sind Sie?"]) self.assertListEqual(outputs, ["Wie alt sind Sie?"])
@slow @slow
def test_constrained_beam_search_example_integration(self): def test_constrained_beam_search_example_integration(self):
...@@ -2656,7 +2658,7 @@ class GenerationIntegrationTests(unittest.TestCase): ...@@ -2656,7 +2658,7 @@ class GenerationIntegrationTests(unittest.TestCase):
) )
outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True) 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): def test_constrained_beam_search_mixin_type_checks(self):
tokenizer = AutoTokenizer.from_pretrained("patrickvonplaten/t5-tiny-random") tokenizer = AutoTokenizer.from_pretrained("patrickvonplaten/t5-tiny-random")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment