Converting original BERT tf checkpoints to BertForMaskedLM
Hi!  I have some BERT models that I've trained using the original Google code for BERT, and I was hoping to port them over to `transformers`.  I noticed that there are two scripts to do this conversion: one for [the original tf1.x code](https://github.com/huggingface/transformers/blob/master/src/transformers/models/bert/convert_bert_original_tf_checkpoint_to_pytorch.py), and one for [the new tf2 code](https://github.com/huggingface/transformers/blob/master/src/transformers/models/bert/convert_bert_original_tf2_checkpoint_to_pytorch.py).

I noticed that tf2 conversion script has the following comment:
> You may adapt this script to include classification/MLM/NSP/etc. heads.

I'm using tf1.x, and that comment isn't the tf1.x conversion script.  However, the output model is a `BertForPreTraining`, and I'd like to port the entire MLM head over too.  I'm assuming that I'd need to somehow get a `BertForMaskedLM` in order to keep the MLM head.

Questions:
1. Would I have to make any modifications to the tf1.x conversion script other than swapping `BertForPreTraining` -> `BertForMaskedLM`?
2. I also noticed that the BERT configs on the model hub are slightly different than the original Google configs.  Is there any additional processing that I'd need to do to convert my configs too, so that they can be loaded by the `Auto*` classes?

Thank you!
The `BertForPreTraining` contains two heads: the NSP and the MLM heads. Therefore, by using the tf1 conversion script, you're already porting the entire model!

For the configuration, it should align pretty seamlessly to Google's configurations, but you can check the expected field here: https://github.com/huggingface/transformers/blob/master/src/transformers/models/bert/configuration_bert.py#L120-L138<|||||>Great, thank you!  For anyone who's curious, I ended up updating my config file with a few extra fields from here to make `Auto*` detection work: https://huggingface.co/bert-base-multilingual-cased/blob/main/config.json