[Multimodal] Expose mm_processor_kwargs for DummyInputsBuilder (#34330)
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
This commit is contained in:
@@ -796,14 +796,18 @@ class Qwen3VLDummyInputsBuilder(BaseDummyInputsBuilder[Qwen3VLProcessingInfo]):
|
||||
seq_len: int,
|
||||
mm_counts: Mapping[str, int],
|
||||
mm_options: Mapping[str, BaseDummyOptions] | None = None,
|
||||
mm_processor_kwargs: Mapping[str, object] | None = None,
|
||||
) -> MultiModalDataDict:
|
||||
num_images = mm_counts.get("image", 0)
|
||||
num_videos = mm_counts.get("video", 0)
|
||||
image_overrides = mm_options.get("image") if mm_options else None
|
||||
video_overrides = mm_options.get("video") if mm_options else None
|
||||
|
||||
mm_processor_kwargs = mm_processor_kwargs or {}
|
||||
target_image_width, target_image_height = (
|
||||
self.info.get_image_size_with_most_features()
|
||||
self.info.get_image_size_with_most_features(
|
||||
max_pixels=mm_processor_kwargs.get("max_pixels", None),
|
||||
)
|
||||
)
|
||||
|
||||
# treat videos as special images
|
||||
@@ -828,7 +832,7 @@ class Qwen3VLDummyInputsBuilder(BaseDummyInputsBuilder[Qwen3VLProcessingInfo]):
|
||||
target_num_frames = min(target_num_frames, num_frames_override)
|
||||
target_num_frames = max(target_num_frames, 2)
|
||||
|
||||
video_processor = self.info.get_video_processor()
|
||||
video_processor = self.info.get_video_processor(**(mm_processor_kwargs or {}))
|
||||
video_max_pixels = video_processor.size["longest_edge"]
|
||||
# video_max_pixels contains the temporal compression factor,
|
||||
# so we divide by 2 to get the maximum number of image pixels.
|
||||
|
||||
Reference in New Issue
Block a user