[Generative Score API] Scoring(Prefill-only) optimizations. (#9748)

This commit is contained in:
Sundara Raman Ramachandran
2025-09-13 10:57:06 -07:00
committed by GitHub
parent 94d0f656fb
commit a360511d7b
9 changed files with 325 additions and 48 deletions

View File

@@ -1778,11 +1778,15 @@ class TokenizerManager(TokenizerCommunicatorMixin):
# the next position after the last token in the prompt
output_logprobs = result["meta_info"].get("output_token_ids_logprobs", [])
# Throw an error here if output_logprobs is None
if output_logprobs is None:
# Check if output_logprobs is properly populated
if (
output_logprobs is None
or not output_logprobs
or len(output_logprobs) == 0
):
raise RuntimeError(
f"output_logprobs is None for request {result['meta_info'].get('id', '<unknown>')}. "
"This usually indicates a problem with the scoring request or the backend output."
f"output_logprobs is empty for request {result['meta_info'].get('id', '<unknown>')}. "
"This indicates token_ids_logprobs were not computed properly for the scoring request."
)
for logprob, token_id, _ in output_logprobs[0]: