Skip to content

Commit a964e5e

Browse files
[Bugfix] Allow --skip-tokenizer-init with echo and return_token_ids (#26238)
Signed-off-by: DarkLight1337 <[email protected]>
1 parent 78c1d5b commit a964e5e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/entrypoints/openai/test_token_in_token_out.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async def test_token_in_token_out_and_logprobs(server):
5454
prompt=token_ids,
5555
max_tokens=20,
5656
temperature=0,
57-
echo=False,
57+
echo=True,
5858
extra_body={
5959
"return_token_ids": True,
6060
},

vllm/entrypoints/openai/serving_completion.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,5 +691,6 @@ def _build_render_config(
691691
truncate_prompt_tokens=request.truncate_prompt_tokens,
692692
add_special_tokens=request.add_special_tokens,
693693
cache_salt=request.cache_salt,
694-
needs_detokenization=bool(request.echo),
694+
needs_detokenization=bool(request.echo
695+
and not request.return_token_ids),
695696
)

0 commit comments

Comments
 (0)