fix: accelerate the first inference speed on low-level NPUs.

This commit is contained in:
muxuezzz 2025-09-27 15:23:09 +08:00
parent a9cf1cd249
commit 083d8aa330

View File

@ -121,6 +121,7 @@ except:
try:
import torch_npu # noqa: F401
_ = torch.npu.device_count()
torch_npu.npu.set_compile_mode(jit_compile = False)
npu_available = torch.npu.is_available()
except:
npu_available = False