Skip to content

Commit

Permalink
packing and liger are compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
kashif committed Feb 7, 2025
1 parent da3d7a6 commit 7781ef2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions trl/trainer/sft_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,9 @@ def concat_prompt_completion(example):
fn_kwargs = {"seq_length": args.max_seq_length or min(processing_class.model_max_length, 1024)}
dataset = dataset.select_columns(["input_ids"])
dataset = dataset.map(pack_examples, batched=True, fn_kwargs=fn_kwargs, **map_kwargs)
elif args.use_liger:
# For Liger kernel, ensure only input_ids is present

# For Liger kernel, ensure only input_ids is present
if args.use_liger:
dataset = dataset.select_columns(["input_ids"])

return dataset
Expand Down

0 comments on commit 7781ef2

Please sign in to comment.