From 5ea9a8beafc16aa5fd22558392abf9dee0d54e1a Mon Sep 17 00:00:00 2001 From: Yishuo Wang Date: Wed, 22 Jan 2025 11:19:44 +0800 Subject: [PATCH] fix --- python/llm/src/ipex_llm/transformers/low_bit_linear.py | 4 +++- 1 file changed, 3 insertions(+), 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 dd43ef7e789..08a49114639 100644 --- a/python/llm/src/ipex_llm/transformers/low_bit_linear.py +++ b/python/llm/src/ipex_llm/transformers/low_bit_linear.py @@ -659,7 +659,9 @@ def forward(self, x: torch.Tensor): if x_2d.size(0) == 1: import xe_linear result = xe_linear.linear_forward_vec(x_2d, self.weight.data, - self.in_len, self.out_len, self.qtype) + self.in_len, self.out_len, self.qtype) + if self.bias is not None: + result += self.bias return result.view(new_shape) if len(x_shape) == 3: