Then you just pass all of this along with the datasets to Trainer:
 

trainer = Trainer(
     model,
     args,
     train_dataset=train_dataset,
     eval_dataset=val_dataset,
     tokenizer=image_processor,
     compute_metrics=compute_metrics,
     data_collator=collate_fn,
 )