Skip to content

Commit

Permalink
clarify comment about prefixes
Browse files Browse the repository at this point in the history
Signed-off-by: Alvant <alvasian@yandex.ru>
  • Loading branch information
Alvant committed Oct 26, 2024
1 parent 59d6b43 commit 44d625a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vllm/engine/llm_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,8 @@ def process_model_params(
prompt_token_ids = tokenizer.encode(text=inputs["prompt"],
add_special_tokens=False)

# If space at the beginning produces a new word token
# If no space at the beginning
# or if prefix space produces a new word token
if (j == 0) or (
j > 0 and prompt_token_ids[0] != bad_words_ids[-1][0]
and len(prompt_token_ids) == len(bad_words_ids[-1])):
Expand Down

0 comments on commit 44d625a

Please sign in to comment.