fix incorrect output of Qwen2-7B-Instruct-GPTQ-Int4 and Qwen2-7B-Instruct-AWQ

ipex kernel provide func like add_bias, so no need add it outside

Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
This commit is contained in:
Wang, Yi A 2024-11-04 03:41:31 -08:00
parent 6e3220529d
commit 69569f0c2a
2 changed files with 0 additions and 2 deletions

View File

@ -44,5 +44,4 @@ class WQLinear(nn.Module):
def forward(self, x): def forward(self, x):
out_shape = x.shape[:-1] + (self.out_features,) out_shape = x.shape[:-1] + (self.out_features,)
out = self.woq_linear(x.reshape(-1, x.shape[-1])) out = self.woq_linear(x.reshape(-1, x.shape[-1]))
out = out + self.bias if self.bias is not None else out
return out.reshape(out_shape) return out.reshape(out_shape)

View File

@ -122,5 +122,4 @@ class QuantLinear(nn.Module):
def forward(self, x): def forward(self, x):
out_shape = x.shape[:-1] + (self.outfeatures,) out_shape = x.shape[:-1] + (self.outfeatures,)
out = self.woq_linear(x.reshape(-1, x.shape[-1])) out = self.woq_linear(x.reshape(-1, x.shape[-1]))
out = out + self.bias if self.bias is not None else out
return out.reshape(out_shape) return out.reshape(out_shape)