Fix llava with multi-image inputs (#12384)

This commit is contained in:
Yuwen Hu 2024-11-13 09:27:50 +08:00 committed by GitHub
parent 27152476e1
commit 1158f91648
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -727,7 +727,7 @@ class LowBitLinear(nn.Linear):
# return empty tensor with output shape, x.dtype and x.device
return torch.empty(new_shape, dtype=x.dtype, device=x.device)
x_2d = x.view(-1, x_shape[-1])
x_2d = x.contiguous().view(-1, x_shape[-1])
if self.act_order:
x_2d = x_2d[:, self.g_idx_map]