Define a simple data collator to batch examples together.

from transformers import DefaultDataCollator
data_collator = DefaultDataCollator()

Finally, bring everything together, and call [~Trainer.train]:

from transformers import Trainer
trainer = Trainer(
     model=model,
     args=training_args,
     data_collator=data_collator,
     train_dataset=encoded_train_dataset,
     eval_dataset=encoded_test_dataset,
     tokenizer=processor,
 )
trainer.train()