Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bofenghuang committed May 15, 2024
1 parent 91ff1af commit 57e5f09
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions vllm/entrypoints/openai/serving_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,18 +179,17 @@ def _validate_prompt_and_tokenize(
"Only one of prompt or prompt_ids should be provided.")

if prompt_ids is None:
# The special tokens (BOS) have already been included by the chat template at this point,
# The special tokens (BOS) have already been included by
# the chat template at this point,
# so we don't add them again.
# See how it's done in huggingface/transformers:
# https://github.com/huggingface/transformers/blob/5962d62bac850cd01ee830ffba880469338c96fd/src/transformers/tokenization_utils_base.py#L1820-L1829
tokenizer_kwargs = {"add_special_tokens": False}
tokenizer_kwargs: Dict[str, Any] = {"add_special_tokens": False}
if truncate_prompt_tokens is not None:
tokenizer_kwargs.update(
{
"truncation": True,
"max_length": truncate_prompt_tokens,
}
)
tokenizer_kwargs.update({
"truncation": True,
"max_length": truncate_prompt_tokens,
})
input_ids = self.tokenizer(prompt, **tokenizer_kwargs).input_ids
elif truncate_prompt_tokens is not None:
input_ids = prompt_ids[-truncate_prompt_tokens:]
Expand Down

0 comments on commit 57e5f09

Please sign in to comment.