From 6bcdc6cc8f02c70bc86224a07028e18198131295 Mon Sep 17 00:00:00 2001 From: Yishuo Wang Date: Fri, 26 Jul 2024 13:41:51 +0800 Subject: [PATCH] fix qwen2 cpu (#11663) --- python/llm/src/ipex_llm/transformers/models/qwen2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/llm/src/ipex_llm/transformers/models/qwen2.py b/python/llm/src/ipex_llm/transformers/models/qwen2.py index 90de62ab..60191943 100644 --- a/python/llm/src/ipex_llm/transformers/models/qwen2.py +++ b/python/llm/src/ipex_llm/transformers/models/qwen2.py @@ -507,7 +507,7 @@ def qwen2_mlp_forward( x_2d.shape[0], x_2d.shape[1], self.gate_proj.out_len, SILU, qtype )) - elif not self.training: + elif x.device.type == "xpu" and not self.training: import xe_addons gate = self.gate_proj(x) up = self.up_proj(x)