Skip to content

Commit 0a00dbb

Browse files
committed
Remove BART add_special_tokens fix
Signed-off-by: Carles Onielfa <carlesonielfa@gmail.com>
1 parent 440d8e2 commit 0a00dbb

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

vllm_bart_plugin/bart.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,9 +1045,6 @@ def _call_hf_processor(
10451045
has_encoder_data = mm_data is not None and "texts" in mm_data
10461046
result = {}
10471047

1048-
# vLLM may pass add_special_tokens in tok_kwargs; we set it ourselves
1049-
tok_kwargs = {k: v for k, v in tok_kwargs.items() if k != "add_special_tokens"}
1050-
10511048
if has_encoder_data:
10521049
# Tokenize the encoder text from mm_data
10531050
encoder_texts = mm_data["texts"]
@@ -1159,8 +1156,7 @@ def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
11591156
config.vocab_size, config.d_model, embed_scale=embed_scale
11601157
)
11611158
# Bias added to logits after lm_head, matching HuggingFace approach
1162-
self.register_buffer("final_logits_bias",
1163-
torch.zeros((1, config.vocab_size)))
1159+
self.register_buffer("final_logits_bias", torch.zeros((1, config.vocab_size)))
11641160
self.logits_processor = LogitsProcessor(
11651161
self.unpadded_vocab_size, config.vocab_size
11661162
)

0 commit comments

Comments
 (0)