"...git@developer.sourcefind.cn:2222/OpenDAS/vllm_cscc.git" did not exist on "0e3f06fe9ccfb59cb89c353b6ef81110fa0854c9"
Commit 185ccc2d authored by guanyu1's avatar guanyu1
Browse files

修复qwen2-vl-7b图像处理部分张量创建在cpu上导致报错问题

parent 70506d98
...@@ -746,7 +746,10 @@ class Qwen2VisionTransformer(nn.Module): ...@@ -746,7 +746,10 @@ class Qwen2VisionTransformer(nn.Module):
rotary_pos_emb = self.rot_pos_emb(grid_thw) rotary_pos_emb = self.rot_pos_emb(grid_thw)
# compute cu_seqlens # compute cu_seqlens
grid_thw_ = torch.tensor(grid_thw) grid_thw_ = torch.tensor(grid_thw,
device=self.device,
dtype=torch.int32
)
cu_seqlens = torch.repeat_interleave(grid_thw_[:, 1] * grid_thw_[:, 2], cu_seqlens = torch.repeat_interleave(grid_thw_[:, 1] * grid_thw_[:, 2],
grid_thw_[:, 0]).cumsum( grid_thw_[:, 0]).cumsum(
dim=0, dtype=torch.int32) dim=0, dtype=torch.int32)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment