From 766fe4522224c8d2938c0a507d6d20c72c777afe Mon Sep 17 00:00:00 2001 From: Yina Chen <33650826+cyita@users.noreply.github.com> Date: Wed, 17 Apr 2024 11:27:35 +0800 Subject: [PATCH] Fix spec error caused by lookup pr (#10777) * Fix spec error * remove * fix style --- python/llm/src/ipex_llm/transformers/speculative.py | 2 +- python/llm/src/ipex_llm/transformers/utils.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/python/llm/src/ipex_llm/transformers/speculative.py b/python/llm/src/ipex_llm/transformers/speculative.py index 3d75e5aa..de9b6237 100644 --- a/python/llm/src/ipex_llm/transformers/speculative.py +++ b/python/llm/src/ipex_llm/transformers/speculative.py @@ -594,7 +594,7 @@ def _non_cpu_ipex_verify(self, verify_input_ids, past_key_values, cur_attention_ "return_dict": return_dict, "use_cache": use_cache, } - if cur_attention_mask: + if cur_attention_mask is not None: forward_args["attention_mask"] = cur_attention_mask if self.config.model_type == "chatglm": diff --git a/python/llm/src/ipex_llm/transformers/utils.py b/python/llm/src/ipex_llm/transformers/utils.py index 1e728473..8d2fbedc 100644 --- a/python/llm/src/ipex_llm/transformers/utils.py +++ b/python/llm/src/ipex_llm/transformers/utils.py @@ -336,6 +336,7 @@ def get_modelscope_hf_config(model_id_or_path: str, local_path = model_id_or_path return Config._file2dict(local_path) + def is_torch_bf16_gpu_available(): # always true for XPU and CPU return True