[Bugfix][Multimodal] Fix video temporal padding estimates (#49030)
Signed-off-by: xiaoming <1259730330@qq.com>
This commit is contained in:
@@ -1082,8 +1082,8 @@ class Glm4vProcessingInfo(BaseProcessingInfo):
|
||||
preprocessed_size = ImageSize(width=image_width, height=image_height)
|
||||
|
||||
# NOTE: Frames are padded to be divisible by `temporal_patch_size`
|
||||
# https://github.com/huggingface/transformers/blob/v4.48.3/src/transformers/models/qwen2_vl/image_processing_qwen2_vl.py#L294
|
||||
padded_num_frames = num_frames + num_frames % temporal_patch_size
|
||||
# https://github.com/huggingface/transformers/blob/v5.13.0/src/transformers/models/qwen2_vl/video_processing_qwen2_vl.py#L249-L252
|
||||
padded_num_frames = num_frames + (-num_frames % temporal_patch_size)
|
||||
|
||||
grid_t = max(padded_num_frames // temporal_patch_size, 1)
|
||||
grid_h = preprocessed_size.height // patch_size
|
||||
|
||||
Reference in New Issue
Block a user