Skip to content

Commit 45ca253

Browse files
houseroadlulmer
authored andcommitted
[V1][Easy] Add empty allowed_token_ids in the v1 sampler test (vllm-project#14308)
Signed-off-by: Lu Fang <[email protected]> Signed-off-by: Louis Ulmer <[email protected]>
1 parent c2aa8f2 commit 45ca253

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/v1/sample/test_sampling_params_e2e.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ def test_allowed_token_ids(model):
113113
PROMPT, SamplingParams(allowed_token_ids=allowed_token_ids))
114114
assert output[0].outputs[0].token_ids[-1] == TOKEN_ID
115115

116+
# Reject empty allowed_token_ids.
117+
with pytest.raises(ValueError):
118+
_ = model.generate(PROMPT, SamplingParams(allowed_token_ids=[]))
119+
116120
# Reject negative token id.
117121
with pytest.raises(ValueError):
118122
_ = model.generate(PROMPT, SamplingParams(allowed_token_ids=[-1]))

0 commit comments

Comments
 (0)