Unverified Commit 35fb0b86 authored by Harry Mellor's avatar Harry Mellor Committed by GitHub
Browse files

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


Signed-off-by: default avatarHarry Mellor <19981378+hmellor@users.noreply.github.com>
parent 2eb673a0
...@@ -841,8 +841,8 @@ class Qwen2VLProcessingInfo(BaseProcessingInfo): ...@@ -841,8 +841,8 @@ class Qwen2VLProcessingInfo(BaseProcessingInfo):
height=image_height, height=image_height,
width=image_width, width=image_width,
factor=patch_size * merge_size, factor=patch_size * merge_size,
min_pixels=image_processor.min_pixels, min_pixels=image_processor.size["shortest_edge"],
max_pixels=image_processor.max_pixels, max_pixels=image_processor.size["longest_edge"],
) )
preprocessed_size = ImageSize(width=resized_width, height=resized_height) preprocessed_size = ImageSize(width=resized_width, height=resized_height)
else: else:
...@@ -914,9 +914,7 @@ class Qwen2VLProcessingInfo(BaseProcessingInfo): ...@@ -914,9 +914,7 @@ class Qwen2VLProcessingInfo(BaseProcessingInfo):
merge_size = vision_config.spatial_merge_size merge_size = vision_config.spatial_merge_size
if max_pixels is None: if max_pixels is None:
image_processor = self.get_image_processor() image_processor = self.get_image_processor()
max_pixels = ( max_pixels = image_processor.size["longest_edge"]
image_processor.max_pixels or image_processor.size["longest_edge"]
)
unit = patch_size * merge_size unit = patch_size * merge_size
max_seq_len = max_pixels // (unit * unit) max_seq_len = max_pixels // (unit * unit)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment