mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Update expected values for test_xglm_sample
(#21975)
update expected values for xglm Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
parent
5d8efc79db
commit
f2a2616b74
@ -428,8 +428,14 @@ class XGLMModelLanguageGenerationTest(unittest.TestCase):
|
||||
output_ids = model.generate(input_ids, do_sample=True, num_beams=1)
|
||||
output_str = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
||||
|
||||
EXPECTED_OUTPUT_STR = "Today is a nice day and the sun is shining. A nice day with warm rainy"
|
||||
self.assertEqual(output_str, EXPECTED_OUTPUT_STR)
|
||||
EXPECTED_OUTPUT_STRS = [
|
||||
# TODO: remove this once we move to torch 2.0
|
||||
# torch 1.13.1 + cu116
|
||||
"Today is a nice day and the sun is shining. A nice day with warm rainy",
|
||||
# torch 2.0 + cu117
|
||||
"Today is a nice day and the water is still cold. We just stopped off for some fresh",
|
||||
]
|
||||
self.assertIn(output_str, EXPECTED_OUTPUT_STRS)
|
||||
|
||||
@slow
|
||||
def test_xglm_sample_max_time(self):
|
||||
|
Loading…
Reference in New Issue
Block a user