mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Fix pixel attention mask padding in smolvlm (#37497)
* fix bad init * also modif smolvlm --------- Co-authored-by: Raushan Turganbay <raushan@huggingface.co>
This commit is contained in:
parent
5a6de703a7
commit
c94c59fc47
@ -581,7 +581,7 @@ class Idefics3ImageProcessor(BaseImageProcessor):
|
||||
padded_images_list = [
|
||||
[empty_image(pad_size, data_format) for _ in range(max_num_images)] for _ in range(batch_size)
|
||||
]
|
||||
padded_masks = [[np.zeros(pad_size) for _ in range(max_num_images)] for _ in range(batch_size)]
|
||||
padded_masks = [[np.zeros(pad_size, dtype=np.int64) for _ in range(max_num_images)] for _ in range(batch_size)]
|
||||
|
||||
for batch_idx in range(batch_size):
|
||||
for sample_idx, image in enumerate(images[batch_idx]):
|
||||
|
@ -578,7 +578,7 @@ class SmolVLMImageProcessor(BaseImageProcessor):
|
||||
padded_images_list = [
|
||||
[empty_image(pad_size, data_format) for _ in range(max_num_images)] for _ in range(batch_size)
|
||||
]
|
||||
padded_masks = [[np.zeros(pad_size) for _ in range(max_num_images)] for _ in range(batch_size)]
|
||||
padded_masks = [[np.zeros(pad_size, dtype=np.int64) for _ in range(max_num_images)] for _ in range(batch_size)]
|
||||
|
||||
for batch_idx in range(batch_size):
|
||||
for sample_idx, image in enumerate(images[batch_idx]):
|
||||
|
Loading…
Reference in New Issue
Block a user