| 691 | """ |
| 692 | |
| 693 | def __init__(self, config, *inputs, **kwargs): |
| 694 | super(PreTrainedBertModel, self).__init__() |
| 695 | if not isinstance(config, BertConfig): |
| 696 | raise ValueError( |
| 697 | "Parameter config in `{}(config)` should be an instance of class `BertConfig`. " |
| 698 | "To create a model from a Google pretrained model use " |
| 699 | "`model = {}.from_pretrained(PRETRAINED_MODEL_NAME)`".format( |
| 700 | self.__class__.__name__, self.__class__.__name__ |
| 701 | )) |
| 702 | self.config = config |
| 703 | |
| 704 | def init_bert_weights(self, module): |
| 705 | """ Initialize the weights. |