Fix TokenizerManager crash on top_logprobs with tensor values (#26825)

This commit is contained in:
Kevin Flansburg
2026-06-03 13:55:02 -07:00
committed by GitHub
parent d1bc06b63b
commit 7716fa00e0
2 changed files with 83 additions and 1 deletions
@@ -2188,7 +2188,7 @@ class TokenizerManager(TokenizerControlMixin, TokenizerManagerScoreMixin):
# We should batch all top-k tokens in all positions.
ret = []
for i in range(len(token_logprobs_val)):
if token_logprobs_val[i]:
if token_logprobs_val[i] is not None:
ret.append(
self.detokenize_logprob_tokens(
token_logprobs_val[i], token_logprobs_idx[i], decode_to_text