[Bugfix] fix device mismatch in MiniCPM-o-4_5 resampler (#43194)

Signed-off-by: Yan Ma <yan.ma@intel.com>
This commit is contained in:
Yan Ma
2026-05-26 13:12:50 +08:00
committed by GitHub
parent c2a4005c70
commit f815c99954
+3 -1
View File
@@ -378,7 +378,9 @@ class Resampler4_5(Resampler2_5):
) # D
pos_embed_2d.append(
self.pos_embed[:tgt_h, :tgt_w, :].reshape((tgt_h * tgt_w, -1)).to(dtype)
self.pos_embed[:tgt_h, :tgt_w, :]
.reshape((tgt_h * tgt_w, -1))
.to(device=device, dtype=dtype)
) # patches * D
key_padding_mask[i, patch_len[i] :] = True