Skip to content

Commit 896b515

Browse files
real-zhangzhegufengkegithubnemo
authored
SFT example: Use correct source for max_seq_length (#2474)
When using Unsloth the SFT example used the wrong source for the `max_seq_length` attribute. The attribute originates from TRL/TrainingArguments. --- Co-authored-by: gufengke <gufengke@pinduoduo.com> Co-authored-by: githubnemo <githubnemo@users.noreply.github.com>
1 parent 21fc8bd commit 896b515

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/sft/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def create_and_prepare_model(args, data_args, training_args):
122122
# Load model
123123
model, _ = FastLanguageModel.from_pretrained(
124124
model_name=args.model_name_or_path,
125-
max_seq_length=data_args.max_seq_length,
125+
max_seq_length=training_args.max_seq_length,
126126
dtype=None,
127127
load_in_4bit=args.use_4bit_quantization,
128128
)
@@ -198,7 +198,7 @@ def create_and_prepare_model(args, data_args, training_args):
198198
else args.lora_target_modules,
199199
use_gradient_checkpointing=training_args.gradient_checkpointing,
200200
random_state=training_args.seed,
201-
max_seq_length=data_args.max_seq_length,
201+
max_seq_length=training_args.max_seq_length,
202202
)
203203

204204
return model, peft_config, tokenizer

0 commit comments

Comments
 (0)