To clarify the problem:
Usually, when we want to use the transformer in it’s original form we do:
!pip install transformers
import transformers
from transformers import BertTokenizer, BertModel
If I want to change a class or two, what changes should I make to the above code snippet to import the BertTokenizer and BertModel. I am assuming cloning the repository and making the edits in the desired file is fine.
Hello @bengul
Is there any other way to achieve the same result without cloning the huggingface repo and making changes in the codes? It would be better in terms of ease of reproducibility if say I create a class that inherits the original class I want to make changes in (in your case BertEmbeddings) and then somehow make the from_pretrained class go through my created subclass rather than the original.
Initially, my thought was to do exactly what you proposed, but I was not sure how to achieve that. I am sure it is possible and probably a better approach.