@nielsr thank you for your reply.
So if I get it right, you suggest to prefer the script for the MLM task. My downstream task is NER, and I have a second (smaller) annotated dataset to subsequently fine-tune the model. Since my downstream task is NER, I don’t think that I need to also pre-train the model on the NSP task.
p.s. Could you explain briefly why prefer the script over the BertForPreTraining model for MLM?