You need to use the AutoModelForSequenceClassification class to add a classification head on top of your pretrained model.
AutoModelForSequenceClassification