Getting warning message on creation of WeightedLossTrainer object
I am getting a warning when I create a WeightedLossTrainer object as follows:/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/accelerate/accelerator.py:432: FutureWarning: Passing the following arguments toAcceleratoris deprecated and will be removed in version 1.0 of Accelerate: dict_keys([‘dispatch_batches’, ‘split_batches’, ‘even_batches’, ‘use_seedable_sampler’]). Please pass anaccelerate.DataLoaderConfigurationinstead:dataloader_config = DataLoaderConfiguration(dispatch_batches=None, split_batches=False, even_batches=True, use_seedable_sampler=True)warnings.warn(Here is the code for creating the WeightedLossTrainer class:“”"class WeightedLossTrainer(Trainer):def compute_loss(self, model, inputs, return_outputs=False):#feedinputs to model and extract outputsoutputs = model(**inputs)#extractlogitslogits = outputs.get(“logits”)#extractlabelslabels = inputs.get(“labels”)#defineloss function with class weightsloss_func = nn.CrossEntropyLoss(weight=class_weights)#computelossloss = loss_func(logits, labels)return (loss, outputs) if return_outputs else loss“”"I get the warning message on creation of the object with the below code:“”"trainer = WeightedLossTrainer(model=model,args=training_args,compute_metrics=compute_metrics,train_dataset=tokenized_medication_datasets[‘train’],eval_dataset=tokenized_medication_datasets[‘validation’],data_collator=data_collator,tokenizer=tokenizer)“”"I am not using Accelerator object anywhere in the existing code for a TextClassification traning.
2024-04-19T13:06:28Z
feels like it some legacy code inside trainer itself. I have the same error message withDPOTrainer, though I am not using accelerator directly within my code.