[Bugfix][Frontend] Support scalar priority and wire priority into LLM.chat() (#57243)
Signed-off-by: subhash polisetti <subhashr161347@gmail.com>
This commit is contained in:
@@ -75,6 +75,10 @@ def test_multiple_priority(llm: LLM):
|
||||
outputs = llm.generate(PROMPTS, sampling_params=None, priority=[0] * len(PROMPTS))
|
||||
assert len(PROMPTS) == len(outputs)
|
||||
|
||||
# Generate works when priority is a single value applied to every prompt
|
||||
outputs = llm.generate(PROMPTS, sampling_params=None, priority=1)
|
||||
assert len(PROMPTS) == len(outputs)
|
||||
|
||||
# Exception raised, if the length of priority does not match the length of prompts
|
||||
with pytest.raises(VLLMValidationError):
|
||||
outputs = llm.generate(
|
||||
@@ -91,6 +95,10 @@ def test_single_prompt_priority(llm: LLM):
|
||||
outputs = llm.generate(PROMPTS[0], sampling_params=None, priority=[0])
|
||||
assert len(outputs) == 1
|
||||
|
||||
# Single string prompts should also accept a single priority value.
|
||||
outputs = llm.generate(PROMPTS[0], sampling_params=None, priority=1)
|
||||
assert len(outputs) == 1
|
||||
|
||||
|
||||
def test_max_model_len(vllm_runner):
|
||||
max_model_len = 20
|
||||
|
||||
Reference in New Issue
Block a user