Skip to content

Commit

Permalink
fixed QLoRA CPU issue due to internal API change. (#1503)
Browse files Browse the repository at this point in the history
Signed-off-by: Ye, Xinyu <xinyu.ye@intel.com>
Co-authored-by: VincyZhang <wenxin.zhang@intel.com>
  • Loading branch information
XinyuYe-Intel and VincyZhang authored Apr 30, 2024
1 parent 3240713 commit 699ffca
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit 699ffca

Please sign in to comment.