mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-06-03 11:24:26 +08:00
[V1][Easy] Add empty allowed_token_ids in the v1 sampler test (#14308)
Signed-off-by: Lu Fang <lufang@fb.com>
This commit is contained in:
parent
1b7624bf5c
commit
53ea6ad830
@ -113,6 +113,10 @@ def test_allowed_token_ids(model):
|
|||||||
PROMPT, SamplingParams(allowed_token_ids=allowed_token_ids))
|
PROMPT, SamplingParams(allowed_token_ids=allowed_token_ids))
|
||||||
assert output[0].outputs[0].token_ids[-1] == TOKEN_ID
|
assert output[0].outputs[0].token_ids[-1] == TOKEN_ID
|
||||||
|
|
||||||
|
# Reject empty allowed_token_ids.
|
||||||
|
with pytest.raises(ValueError):
|
||||||
|
_ = model.generate(PROMPT, SamplingParams(allowed_token_ids=[]))
|
||||||
|
|
||||||
# Reject negative token id.
|
# Reject negative token id.
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
_ = model.generate(PROMPT, SamplingParams(allowed_token_ids=[-1]))
|
_ = model.generate(PROMPT, SamplingParams(allowed_token_ids=[-1]))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user