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