mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-14 23:58:11 +08:00
Merge pull request #5188 from Zxilly/main
fix: report correct device count for intel xpu Former-commit-id: cd3c536cb3936061d905256850b0e57df4498010
This commit is contained in:
commit
525747b472
@ -141,6 +141,8 @@ def get_device_count() -> int:
|
||||
return torch.npu.device_count()
|
||||
elif is_torch_cuda_available():
|
||||
return torch.cuda.device_count()
|
||||
elif is_torch_xpu_available():
|
||||
return torch.xpu.device_count()
|
||||
else:
|
||||
return 0
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user