[Frontend] Support min_p in the Responses API (#48084)
Signed-off-by: sungbin1015 <sbin@solbox.com> Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
co-authored by
Flora Feng
parent
c5c1161382
commit
2ddde19e8e
@@ -183,6 +183,7 @@ def test_request_payload_is_accepted_by_the_server_schema():
|
||||
"temperature": 0.7,
|
||||
"top_p": 0.9,
|
||||
"top_k": 20,
|
||||
"min_p": 0.05,
|
||||
"frequency_penalty": 0.2,
|
||||
"presence_penalty": 0.1,
|
||||
"repetition_penalty": 1.05,
|
||||
@@ -217,9 +218,6 @@ def test_request_payload_is_accepted_by_the_server_schema():
|
||||
assert set(seen["payload"]) <= set(ResponsesRequest.model_fields)
|
||||
ResponsesRequest.model_validate(seen["payload"])
|
||||
|
||||
# `vllm bench serve` rejects --min-p for this backend for the same reason.
|
||||
assert "min_p" not in ResponsesRequest.model_fields
|
||||
|
||||
|
||||
def test_latency_accounting_matches_the_other_endpoints():
|
||||
"""`latency - ttft` must equal `sum(itl)`.
|
||||
|
||||
@@ -29,6 +29,7 @@ class TestResponsesRequestSamplingParams:
|
||||
temperature=0.8,
|
||||
top_p=0.95,
|
||||
top_k=50,
|
||||
min_p=0.1,
|
||||
max_output_tokens=100,
|
||||
)
|
||||
|
||||
@@ -37,8 +38,20 @@ class TestResponsesRequestSamplingParams:
|
||||
assert sampling_params.temperature == 0.8
|
||||
assert sampling_params.top_p == 0.95
|
||||
assert sampling_params.top_k == 50
|
||||
assert sampling_params.min_p == 0.1
|
||||
assert sampling_params.max_tokens == 100
|
||||
|
||||
def test_min_p_default(self):
|
||||
"""Test that min_p defaults to 0.0 when unset (parity with top_k)."""
|
||||
request = ResponsesRequest(
|
||||
model="test-model",
|
||||
input="test input",
|
||||
)
|
||||
|
||||
sampling_params = request.to_sampling_params(default_max_tokens=1000)
|
||||
|
||||
assert sampling_params.min_p == 0.0
|
||||
|
||||
def test_extra_sampling_params(self):
|
||||
"""Test extra sampling parameters are correctly mapped."""
|
||||
request = ResponsesRequest(
|
||||
|
||||
Reference in New Issue
Block a user