"...git@developer.sourcefind.cn:2222/OpenDAS/vllm_cscc.git" did not exist on "baec0d4de9d202a4d91b8df0c3f1c53a4ddb0a09"
Unverified Commit 53ea6ad8 authored by Lu Fang's avatar Lu Fang Committed by GitHub
Browse files

[V1][Easy] Add empty allowed_token_ids in the v1 sampler test (#14308)


Signed-off-by: default avatarLu Fang <lufang@fb.com>
parent 1b7624bf
...@@ -113,6 +113,10 @@ def test_allowed_token_ids(model): ...@@ -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]))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment