Skip to content

Commit

Permalink
[Bugfix] Fix BLIP-2 processing (#12412)
Browse files Browse the repository at this point in the history
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
  • Loading branch information
DarkLight1337 authored Jan 25, 2025
1 parent 221d388 commit fb30ee9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vllm/model_executor/models/blip2.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,14 @@ def _get_prompt_replacements(
bos_token_id = tokenizer.bos_token_id
assert isinstance(bos_token_id, int)

image_token_id = vocab["image"]
image_token_id = vocab["<image>"]
num_image_tokens = self.info.get_num_image_tokens()
image_tokens = [image_token_id] * num_image_tokens

return [
PromptReplacement(
modality="image",
target="</s>",
target=[bos_token_id],
replacement=PromptReplacementDetails(
full=image_tokens + [bos_token_id],
features=image_tokens,
Expand Down

0 comments on commit fb30ee9

Please sign in to comment.