File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,19 @@ def test_invalid_prune_threshold():
9090 BeamParams (K = 1 , prune_threshold = - 0.1 )
9191
9292
93+ def test_beam_params_eos_tokens_deprecation ():
94+ """Test that the deprecated eos_tokens kwarg works and warns."""
95+ with pytest .warns (DeprecationWarning , match = "eos_tokens.*deprecated" ):
96+ params = BeamParams (K = 3 , eos_tokens = [b"." , b"!" ])
97+ assert params .eos_byte_strings == {b"." , b"!" }
98+
99+
100+ def test_beam_params_eos_tokens_and_byte_strings_conflict ():
101+ """Test that specifying both eos_tokens and eos_byte_strings raises."""
102+ with pytest .raises (TypeError , match = "Cannot specify both" ):
103+ BeamParams (K = 3 , eos_byte_strings = [b"." ], eos_tokens = [b"!" ])
104+
105+
93106# EOS-specific tests
94107@pytest .mark .asyncio
95108async def test_eos_manual_configuration (llm ):
You can’t perform that action at this time.
0 commit comments