[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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user