Skip to content

TypeError: SFTTrainer.__init__() got an unexpected keyword argument 'max_seq_length' #23

@dwgb93

Description

@dwgb93

I am unable to make distill_logits.py run.

I'm pretty sure this is due to a recent breaking update of TRL, but I'm not quite sure how to fix it.

LogitsTrainer doesn't seem to like the max_seq_length or dataset_text_field arguments.

Looking at the documentation here, I see that I can do something like
my_args = SFTConfig(max_seq_length=config["tokenizer"]["max_length"], dataset_text_field="text", output_dir="./results")

But I'm unclear as to how to include that. Setting args=my_args gets rid of the transformers TrainingArguments specified above.

Further, while attempting to fix these issues, I got another error: TypeError: LogitsTrainer.compute_loss() got an unexpected keyword argument 'num_items_in_batch'

This appears to be related to a different breaking update of transformers.

It's also worth noting that it keeps warning me tokenizer is deprecated and removed starting from version 0.16.0 for LogitsTrainer.__init__. Use processing_class instead.

Any chance you could help here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions