From 1158f91648c7138c5fb41d2266e14a30b8f2dc88 Mon Sep 17 00:00:00 2001 From: Yuwen Hu <54161268+Oscilloscope98@users.noreply.github.com> Date: Wed, 13 Nov 2024 09:27:50 +0800 Subject: [PATCH] Fix llava with multi-image inputs (#12384) --- python/llm/src/ipex_llm/transformers/low_bit_linear.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/llm/src/ipex_llm/transformers/low_bit_linear.py b/python/llm/src/ipex_llm/transformers/low_bit_linear.py index 4802f839942..af0ea92102c 100644 --- a/python/llm/src/ipex_llm/transformers/low_bit_linear.py +++ b/python/llm/src/ipex_llm/transformers/low_bit_linear.py @@ -727,7 +727,7 @@ def forward(self, x: torch.Tensor): # 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]