@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 53ea6ad830
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 21:00 UTC

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

Signed-off-by: Lu Fang <lufang@fb.com>

Lu Fang committed Mar 5, 2025 at 13:41 UTC 53ea6ad8304f5d16bab97527ea1f4a19cfb25588
1 file changed +4
tests/v1/sample/test_sampling_params_e2e.py
+4
@@ -113,6 +113,10 @@ def test_allowed_token_ids(model):
113 PROMPT, SamplingParams(allowed_token_ids=allowed_token_ids))
114 assert output[0].outputs[0].token_ids[-1] == TOKEN_ID
115
116 + # Reject empty allowed_token_ids.
117 + with pytest.raises(ValueError):
118 + _ = model.generate(PROMPT, SamplingParams(allowed_token_ids=[]))
119 +
120 # Reject negative token id.
121 with pytest.raises(ValueError):
122 _ = model.generate(PROMPT, SamplingParams(allowed_token_ids=[-1]))