[Misc] Add BNB support to GLM4-V model (#12184)
Signed-off-by: Isotr0py <2037008807@qq.com>
This commit is contained in:
@@ -42,7 +42,8 @@ class PatchEmbedding(nn.Module):
|
||||
torch.Tensor
|
||||
Transformed tensor with shape (B, L, D)
|
||||
"""
|
||||
images = images.to(self.proj.weight.device)
|
||||
images = images.to(device=self.proj.weight.device,
|
||||
dtype=self.proj.weight.dtype)
|
||||
x = self.proj(images)
|
||||
x = x.flatten(2).transpose(1, 2)
|
||||
cls_token = self.cls_embedding.expand(x.shape[0], -1, -1)
|
||||
|
||||
Reference in New Issue
Block a user