Skip to content

Commit 86ee949

Browse files
yuafngYuanfeng LiDarkLight1337
authored
Fix tensor device and dtype placement in Qwen2VL model (#26219)
Signed-off-by: Cyrus Leung <[email protected]> Co-authored-by: Yuanfeng Li <[email protected]> Co-authored-by: Cyrus Leung <[email protected]>
1 parent 4570535 commit 86ee949

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vllm/model_executor/models/qwen2_vl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ def forward(
720720
rotary_pos_emb = self.rot_pos_emb(grid_thw)
721721

722722
# compute cu_seqlens
723-
grid_thw_ = torch.tensor(grid_thw)
723+
grid_thw_ = torch.tensor(grid_thw, device=x.device, dtype=torch.long)
724724
cu_seqlens = torch.repeat_interleave(grid_thw_[:, 1] * grid_thw_[:, 2],
725725
grid_thw_[:, 0]).cumsum(
726726
dim=0, dtype=torch.int32)

0 commit comments

Comments
 (0)