I wanted to edit some classes in the transformers for example BertEmbeddings transformers/modeling_bert.py at 4c32f9f26e6a84f0d9843fec8757e6ce640bb44e · huggingface/transformers · GitHub
and pre-train Bert from scratch on a custom dataset. But I am stuck on how to make the edit work.
The process I am following is:

Clone the repository git clone https://github.com/huggingface/transformers.git

edit the classes I needed to edit
Install transformer using

cd transformers
pip install -e .

The problem is I can not load any model or tokenizer using commands like:
from transformers import BertModel

The error message shows:

ImportError: cannot import name ‘BertModel’ from ‘transformers’ (unknown location)

while import transformers works perfectly fine.
My questions are:

How do I import the BertTokenizer or BertModel

Is there a better way to achieve what I am trying to than my approach?

I could be way off so any helpful suggestion is appreciated. Thanks
Note: I am trying to do something like this. How to use additional input features for NER? - #2 by nielsr 1