diff --git a/mlx_vlm/prompt_utils.py b/mlx_vlm/prompt_utils.py index fe419dc..1b1e40b 100644 --- a/mlx_vlm/prompt_utils.py +++ b/mlx_vlm/prompt_utils.py @@ -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']}"