mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-12 04:44:52 +00:00
hotfix: fix xpu crash brought by code refine. torch.xpu rely on import ipex
Signed-off-by: Wang, Yi A <yi.a.wang@intel.com>
This commit is contained in:
parent
0b95693fb8
commit
4d28e29236
@ -56,6 +56,8 @@ elif torch.version.cuda is not None and torch.cuda.is_available():
|
||||
get_free_memory = get_cuda_free_memory
|
||||
elif is_ipex_available():
|
||||
SYSTEM = "ipex"
|
||||
import intel_extension_for_pytorch # noqa: F401
|
||||
|
||||
if hasattr(torch, "xpu") and torch.xpu.is_available():
|
||||
empty_cache = torch.xpu.empty_cache
|
||||
synchronize = torch.xpu.synchronize
|
||||
|
Loading…
Reference in New Issue
Block a user