Changed expected_output_ids in TransfoXL generation test (#5462)
* Changed expected_output_ids in TransfoXL generation test to match #4826 generation PR. * making black happy * making isort happy
This commit is contained in:
@@ -162,7 +162,6 @@ class TransfoXLModelTester:
|
|||||||
|
|
||||||
@require_torch
|
@require_torch
|
||||||
class TransfoXLModelTest(ModelTesterMixin, unittest.TestCase):
|
class TransfoXLModelTest(ModelTesterMixin, unittest.TestCase):
|
||||||
|
|
||||||
all_model_classes = (TransfoXLModel, TransfoXLLMHeadModel) if is_torch_available() else ()
|
all_model_classes = (TransfoXLModel, TransfoXLLMHeadModel) if is_torch_available() else ()
|
||||||
all_generative_model_classes = (TransfoXLLMHeadModel,) if is_torch_available() else ()
|
all_generative_model_classes = (TransfoXLLMHeadModel,) if is_torch_available() else ()
|
||||||
test_pruning = False
|
test_pruning = False
|
||||||
@@ -448,7 +447,6 @@ class TransfoXLModelLanguageGenerationTest(unittest.TestCase):
|
|||||||
# father initially slaps him for making such an accusation , Rasputin watches as the
|
# father initially slaps him for making such an accusation , Rasputin watches as the
|
||||||
# man is chased outside and beaten . Twenty years later , Rasputin sees a vision of
|
# man is chased outside and beaten . Twenty years later , Rasputin sees a vision of
|
||||||
# the Virgin Mary , prompting him to become a priest . Rasputin quickly becomes famous ,
|
# the Virgin Mary , prompting him to become a priest . Rasputin quickly becomes famous ,
|
||||||
|
|
||||||
# with people , even a bishop , begging for his blessing . <eod> </s> <eos>
|
# with people , even a bishop , begging for his blessing . <eod> </s> <eos>
|
||||||
|
|
||||||
expected_output_ids = [
|
expected_output_ids = [
|
||||||
@@ -595,54 +593,77 @@ class TransfoXLModelLanguageGenerationTest(unittest.TestCase):
|
|||||||
0,
|
0,
|
||||||
33,
|
33,
|
||||||
1,
|
1,
|
||||||
1857,
|
142,
|
||||||
|
1298,
|
||||||
|
188,
|
||||||
2,
|
2,
|
||||||
1,
|
29546,
|
||||||
1009,
|
113,
|
||||||
|
8,
|
||||||
|
3654,
|
||||||
4,
|
4,
|
||||||
|
1,
|
||||||
1109,
|
1109,
|
||||||
11739,
|
7136,
|
||||||
4762,
|
833,
|
||||||
358,
|
|
||||||
5,
|
|
||||||
25,
|
|
||||||
245,
|
|
||||||
28,
|
|
||||||
1110,
|
|
||||||
3,
|
3,
|
||||||
13,
|
13,
|
||||||
1041,
|
1645,
|
||||||
4,
|
4,
|
||||||
|
29546,
|
||||||
|
11,
|
||||||
|
104,
|
||||||
|
7,
|
||||||
|
1,
|
||||||
|
1109,
|
||||||
|
532,
|
||||||
|
7129,
|
||||||
|
2,
|
||||||
|
10,
|
||||||
|
83507,
|
||||||
|
2,
|
||||||
|
1162,
|
||||||
|
1123,
|
||||||
|
2,
|
||||||
|
6,
|
||||||
|
7245,
|
||||||
|
10,
|
||||||
|
2,
|
||||||
|
5,
|
||||||
|
11,
|
||||||
|
104,
|
||||||
|
7,
|
||||||
|
1,
|
||||||
|
1109,
|
||||||
|
532,
|
||||||
|
7129,
|
||||||
|
2,
|
||||||
|
10,
|
||||||
24,
|
24,
|
||||||
603,
|
24,
|
||||||
490,
|
10,
|
||||||
2,
|
22,
|
||||||
71477,
|
10,
|
||||||
20098,
|
13,
|
||||||
104447,
|
770,
|
||||||
2,
|
5863,
|
||||||
20961,
|
|
||||||
1,
|
|
||||||
2604,
|
|
||||||
4,
|
4,
|
||||||
1,
|
7245,
|
||||||
329,
|
10,
|
||||||
3,
|
|
||||||
0,
|
|
||||||
]
|
]
|
||||||
# In 1991, the remains of Russian Tsar Nicholas II and his family (
|
# In 1991, the remains of Russian Tsar Nicholas II and his family ( except for
|
||||||
# except for Alexei and Maria ) are discovered. The voice of young son,
|
# Alexei and Maria ) are discovered. The voice of young son, Tsarevich Alexei
|
||||||
# Tsarevich Alexei Nikolaevich, narrates the remainder of the story.
|
# Nikolaevich, narrates the remainder of the story. 1883 Western Siberia, a young
|
||||||
# 1883 Western Siberia, a young Grigori Rasputin is asked by his father
|
# Grigori Rasputin is asked by his father and a group of men to perform magic.
|
||||||
# and a group of men to perform magic. Rasputin has a vision and
|
# Rasputin has a vision and denounces one of the men as a horse thief. Although
|
||||||
# denounces one of the men as a horse thief. Although his father initially
|
# his father initially slaps him for making such an accusation, Rasputin watches
|
||||||
# slaps him for making such an accusation, Rasputin watches as the man
|
# as the man is chased outside and beaten. Twenty years later, Rasputin sees a
|
||||||
# is chased outside and beaten. Twenty years later, Rasputin sees a vision
|
# vision of the Virgin Mary, prompting him to become a priest. Rasputin quickly
|
||||||
# of the Virgin Mary, prompting him to become a priest.
|
# becomes famous, with people, even a bishop, begging for his blessing. In the
|
||||||
# Rasputin quickly becomes famous, with people, even a bishop, begging for
|
# early 20th century, Rasputin became a symbol of the Russian Orthodox Church.
|
||||||
# his blessing. <unk> <unk> <eos> In the 1990s, the remains of Russian Tsar
|
# The image of Rasputin was used in the Russian national anthem, " Nearer, My God,
|
||||||
# Nicholas II and his family were discovered. The voice of <unk> young son,
|
# to Heaven ", and was used in the Russian national anthem, " " ( " The Great Spirit
|
||||||
# Tsarevich Alexei Nikolaevich, narrates the remainder of the story.<eos>
|
# of Heaven "
|
||||||
|
|
||||||
output_ids = model.generate(input_ids, max_length=200, do_sample=False)
|
output_ids = model.generate(input_ids, max_length=200, do_sample=False)
|
||||||
self.assertListEqual(output_ids[0].tolist(), expected_output_ids)
|
self.assertListEqual(output_ids[0].tolist(), expected_output_ids)
|
||||||
|
|||||||
Reference in New Issue
Block a user