Skip to content

Commit

Permalink
Merge branch 'pc/florence-2' of https://github.com/Blaizzy/mlx-vlm in…
Browse files Browse the repository at this point in the history
…to pc/florence-2
  • Loading branch information
Blaizzy committed Nov 3, 2024
2 parents 9502562 + b370ffd commit 1a54af9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mlx_vlm/prompt_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ def add_image_tokens(message, token_format):
return message
if role == "user" and not skip_image_token:
if isinstance(message["content"], list):
message["content"].extend([{"type": "image"}] * num_images)
if model_name == "pixtral":
message["content"] = [{"type": "image"}] * num_images + message[
"content"
]
else:
message["content"].extend([{"type": "image"}] * num_images)
else:
if model_name == "phi3_v":
message["content"] = f"{token_format}{message['content']}"
Expand Down

0 comments on commit 1a54af9

Please sign in to comment.