Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Fixed QLoRA CPU issue due to internal API change #1503

Merged
merged 2 commits into from
Apr 30, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,13 @@ def finetune(self):
bnb_4bit_use_double_quant=finetune_args.double_quant,
bnb_4bit_quant_type=finetune_args.quant_type,
)
elif training_args.device.type == "cpu":
self.device_map = "cpu"
else:
raise NotImplementedError(
f"Unsupported device type {training_args.device.type}, only support cpu and cuda now."
)

if finetune_args.bits not in [4, 8]:
raise NotImplementedError(
f"Unsupported bits {finetune_args.bits}, only support 4 and 8 now."
Expand Down
Loading