diff --git a/vllm/model_executor/models/minicpmv.py b/vllm/model_executor/models/minicpmv.py index 3497dbc2e3..af5f5651bb 100644 --- a/vllm/model_executor/models/minicpmv.py +++ b/vllm/model_executor/models/minicpmv.py @@ -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