I came across this error when I updated my transformers version to the latest.
Traceback (most recent call last):
_ = trainer.train()
File "/home/willieseun/.local/lib/python3.10/site-packages/transformers/trainer.py", line 2171, in train
return inner_training_loop(
File "/home/willieseun/.local/lib/python3.10/site-packages/transformers/trainer.py", line 2531, in _inner_training_loop
tr_loss_step = self.training_step(model, inputs, num_items_in_batch)
File "/home/willieseun/.local/lib/python3.10/site-packages/transformers/trainer.py", line 3675, in training_step
loss = self.compute_loss(model, inputs, num_items_in_batch=num_items_in_batch)
TypeError: ReftTrainer.compute_loss() got an unexpected keyword argument 'num_items_in_batch'
I think they added a new argument which ReftTrainer does not support. Downgrading the transformers version is not an option because newer model classes like Gemma 3 are not present in the older transformer versions