Don't use min_pixels/max_pixels from Qwen2VL's processor (#33208)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2026-01-28 05:02:08 +00:00
committed by GitHub
parent 2eb673a088
commit 35fb0b8613

View File

@@ -841,8 +841,8 @@ class Qwen2VLProcessingInfo(BaseProcessingInfo):
height=image_height,
width=image_width,
factor=patch_size * merge_size,
min_pixels=image_processor.min_pixels,
max_pixels=image_processor.max_pixels,
min_pixels=image_processor.size["shortest_edge"],
max_pixels=image_processor.size["longest_edge"],
)
preprocessed_size = ImageSize(width=resized_width, height=resized_height)
else:
@@ -914,9 +914,7 @@ class Qwen2VLProcessingInfo(BaseProcessingInfo):
merge_size = vision_config.spatial_merge_size
if max_pixels is None:
image_processor = self.get_image_processor()
max_pixels = (
image_processor.max_pixels or image_processor.size["longest_edge"]
)
max_pixels = image_processor.size["longest_edge"]
unit = patch_size * merge_size
max_seq_len = max_pixels // (unit * unit)