Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Ascend NPU adapter loading #772

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/peft/utils/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import accelerate
import torch
from accelerate.hooks import add_hook_to_module, remove_hook_from_module
from accelerate.utils import is_xpu_available
from accelerate.utils import is_npu_available, is_xpu_available


# Get current device name based on available devices
Expand All @@ -29,6 +29,8 @@ def infer_device():
torch_device = "cuda"
elif is_xpu_available():
torch_device = "xpu"
elif is_npu_available():
torch_device = "npu"
else:
torch_device = "cpu"
return torch_device
Expand Down