Skip to content

Commit 0e1d83d

Browse files
tastelikefeettastelikefeet
authored andcommitted
fix unsloth and support device_map (#5139)
Co-authored-by: tastelikefeet <[email protected]>
1 parent 432ff34 commit 0e1d83d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

swift/llm/argument/base_args/base_args.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ def load_args_from_ckpt(self) -> None:
216216
old_args = json.load(f)
217217
force_load_keys = [
218218
# base_args
219-
'tuner_backend',
220219
'train_type',
221220
# model_args
222221
'task_type',

swift/llm/model/register.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ def load_by_unsloth(args):
141141
model_name=args.adapters and args.adapters[0] or args.model_dir,
142142
dtype=args.torch_dtype,
143143
max_seq_length=args.max_length,
144-
full_finetuning=args.quant_bits is None,
144+
full_finetuning=args.train_type == 'full',
145145
load_in_4bit=args.quant_bits == 4,
146146
load_in_8bit=args.quant_bits == 8,
147+
device_map=args.device_map,
147148
)
148149
if isinstance(model, PeftModel):
149150
base_model = model.model

0 commit comments

Comments
 (0)