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):
PROMPT, SamplingParams(allowed_token_ids=allowed_token_ids))
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.
with pytest.raises(ValueError):
_ = 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