[Bugfix][Frontend] Preserve logprobs when top_logprobs is null (#47838)

Signed-off-by: Ting Sun <suntcrick@gmail.com>
Signed-off-by: Flora Feng <4florafeng@gmail.com>
Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
Ting SUN
2026-10-05 22:43:31 +00:00
committed by GitHub
co-authored by Flora Feng
parent 89a00995c9
commit 4a705c7b54
7 changed files with 46 additions and 12 deletions
@@ -84,6 +84,20 @@ class TestResponsesRequestSamplingParams:
assert sampling_params.stop == [] # Empty list
assert sampling_params.extra_args == {} # Empty dict
def test_null_top_logprobs_is_same_as_omitted(self):
"""`top_logprobs: null` must not drop the requested output logprobs."""
request = ResponsesRequest.model_validate(
{
"input": "test input",
"include": ["message.output_text.logprobs"],
"top_logprobs": None,
}
)
sampling_params = request.to_sampling_params(default_max_tokens=1000)
assert sampling_params.logprobs == 0
def test_seed_bounds_validation(self):
"""Test that seed values outside torch.long bounds are rejected."""
# Test seed below minimum