From 4873ff8879f90db39bcec4254d18e0ccb6489c5e Mon Sep 17 00:00:00 2001 From: DarkLight1337 Date: Mon, 23 Dec 2024 17:42:24 +0000 Subject: [PATCH] Update max image tokens Signed-off-by: DarkLight1337 --- vllm/model_executor/models/phi3v.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vllm/model_executor/models/phi3v.py b/vllm/model_executor/models/phi3v.py index 9aed95601f1fc..313ee28d3c3b1 100644 --- a/vllm/model_executor/models/phi3v.py +++ b/vllm/model_executor/models/phi3v.py @@ -315,11 +315,14 @@ def get_max_phi3v_image_tokens( processor = ctx.get_hf_processor(**hf_processor_mm_kwargs) - return processor.calc_num_image_tokens_from_image_size( + num_image_tokens = processor.calc_num_image_tokens_from_image_size( width=MAX_IMAGE_FEATURE_SIZE_WIDTH, height=MAX_IMAGE_FEATURE_SIZE_HEIGHT, ) + # Include the separator (bos_token_id) + return num_image_tokens + 1 + class Phi3VMultiModalProcessor(BaseMultiModalProcessor):