Skip to content

Commit 6c8ff54

Browse files
chaunceyjiangpy-andy-c
authored andcommitted
[Bugfix]: Fix messy code when using logprobs (vllm-project#20910)
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
1 parent 11b9786 commit 6c8ff54

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

vllm/transformers_utils/detokenizer_utils.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ def convert_prompt_ids_to_tokens(
7878
def convert_ids_list_to_tokens(
7979
tokenizer: AnyTokenizer,
8080
token_ids: list[int],
81-
skip_special_tokens: bool = False,
8281
) -> list[str]:
8382
"""Detokenize the input ids individually.
8483
@@ -92,10 +91,8 @@ def convert_ids_list_to_tokens(
9291
"""
9392
token_str_lst = []
9493
for token_id in token_ids:
95-
token_str = tokenizer.decode(
96-
[token_id],
97-
skip_special_tokens=skip_special_tokens,
98-
)
94+
# use default skip_special_tokens.
95+
token_str = tokenizer.decode([token_id])
9996
if token_str is None:
10097
token_str = ""
10198
token_str_lst.append(token_str)

0 commit comments

Comments
 (0)