Changing the classification head scenarios suggested above does not work for my case. Instead, I suggest, which works for me,  that you can change the body instead of head as follows
old_model= BertForSequenceClassification.from_pretrained("model-x") new_model=BertForSequenceClassification.from_pretrained("bert-base-uncased", num_labels=HowMany_LABELS_I_WANT) new_model.bert=old_model.bert
which works for me