Due to the change that added in SFTConfig, for the parameter in SFTTrainer.args, this broke previous behavior that allowed passing transformers.TrainingArguments into SFTTrainer.args. This was tried to be fixed by this commit a few hours ago, however the full set of TrainingArguments has many more parameters than SFTConfig. Thus converting TrainingArguments to a dictionary is insufficient.
Currently this is resulting in error: TypeError: SFTConfig.__init__() got an unexpected keyword argument 'cache_dir' because TrainingArguments has a field for cache_dir but SFTConfig does not.
Previously I ran with:
trainer = SFTTrainer(
model=model,
tokenizer=tokenizer,
train_dataset=formatted_train_dataset,
eval_dataset=formatted_validation_dataset,
packing=packing,
data_collator=data_collator,
dataset_text_field=data_args.dataset_text_field,
args=transformers.TrainingArguments,
max_seq_length=max_seq_length,
callbacks=trainer_callbacks,
peft_config=peft_config,
)
Since SFTTrainer is built from/inherits transformers.Trainer, these training argument configurations are important and used. Perhaps SFTConfig should also inherit from transformers.TrainingArguments?
Due to the change that added in SFTConfig, for the parameter in SFTTrainer.args, this broke previous behavior that allowed passing transformers.TrainingArguments into SFTTrainer.args. This was tried to be fixed by this commit a few hours ago, however the full set of TrainingArguments has many more parameters than SFTConfig. Thus converting TrainingArguments to a dictionary is insufficient.
Currently this is resulting in error:
TypeError: SFTConfig.__init__() got an unexpected keyword argument 'cache_dir'because TrainingArguments has a field for cache_dir but SFTConfig does not.Previously I ran with:
Since SFTTrainer is built from/inherits transformers.Trainer, these training argument configurations are important and used. Perhaps
SFTConfigshould also inherit from transformers.TrainingArguments?