How to fine-tune BERT model for next word prediction?

Hi everyone.

I have the text data cleaned and tokenized. Right now what I’m trying to do is use a pretrained BERT model on hugging face to make next word predictions, and then fine-tune it with my own dataset. I’ve been searching for hours for resources to do this but haven’t been able to figure it out. I was hoping someone here could help me out. Thanks and regards.