I think you need to define a compute metric function which get your prediction and return the accuracy.
def compute_metrics(pred):
labels = pred.label_ids
preds = pred.predictions.argmax(-1)
precision, recall, f1, _ = precision_recall_fscore_support(labels, preds)
precision_ma, recall_ma, f1_ma, _ = precision_recall_fscore_support(labels, preds, average=‘macro’)
precision_mi, recall_mi, f1_mi, _ = precision_recall_fscore_support(labels, preds, average=‘micro’)
acc = accuracy_score(labels, preds)
return {
‘accuracy’: acc,
‘f1’: f1}  and pass it to the trainer