[Bugfix] Fix output token length check logic (#16419)

Signed-off-by: look <eeslook@163.com>
This commit is contained in:
look 2025-04-11 04:16:48 +08:00 committed by GitHub
parent 56d4aefa33
commit 7cd0bd7212
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -156,7 +156,7 @@ def calculate_metrics(
if outputs[i].success:
output_len = outputs[i].output_tokens
if output_len is None:
if not output_len:
# We use the tokenizer to count the number of output tokens
# for some serving backends instead of looking at
# len(outputs[i].itl) since multiple output tokens may be