Skip to content

Commit e279a96

Browse files
[Bugfix][Examples] drop data_collator causing failures in trl init (#1606)
SUMMARY: [A recent update to trl](https://github.com/huggingface/trl/pull/3076/files) no longer allows data_collator to be set when padding_free=True, causing `examples/trl_mixin/ex_trl_distillation.py` to fail. This drops the default collator, which is not needed, to allow for performant packing. Resolves INFERENG-959 TEST PLAN: Resolved error in `examples/trl_mixin/ex_trl_distillation.py` in local check after this update. --------- Signed-off-by: Brian Dellabetta <bdellabe@redhat.com>
1 parent ee3baa0 commit e279a96

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

examples/trl_mixin/ex_trl_distillation.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from sft_trainer import SFTTrainer
2-
from transformers import AutoModelForCausalLM, AutoTokenizer, DefaultDataCollator
2+
from transformers import AutoModelForCausalLM, AutoTokenizer
33

44
from llmcompressor.args import DatasetArguments, ModelArguments
55
from llmcompressor.transformers import TextGenerationDataset
@@ -48,7 +48,6 @@
4848
distill_scale: 1.0
4949
"""
5050

51-
data_collator = DefaultDataCollator()
5251
trl_sft_config_args = dict(
5352
output_dir=output_dir,
5453
num_train_epochs=0.6,
@@ -67,7 +66,6 @@
6766
processing_class=tokenizer,
6867
recipe=recipe,
6968
train_dataset=train_dataset,
70-
data_collator=data_collator,
7169
trl_sft_config_args=trl_sft_config_args,
7270
dataset_args=dataset_args,
7371
model_args=model_args,

0 commit comments

Comments
 (0)