MCPcopy Create free account
hub / github.com/SooLab/CGFormer / __init__

Method __init__

bert/modeling_bert.py:895–902  ·  view source on GitHub ↗
(self, config)

Source from the content-addressed store, hash-verified

893)
894class BertLMHeadModel(BertPreTrainedModel):
895 def __init__(self, config):
896 super().__init__(config)
897 assert config.is_decoder, "If you want to use `BertLMHeadModel` as a standalone, add `is_decoder=True`."
898
899 self.bert = BertModel(config)
900 self.cls = BertOnlyMLMHead(config)
901
902 self.init_weights()
903
904 def get_output_embeddings(self):
905 return self.cls.predictions.decoder

Callers

nothing calls this directly

Calls 4

BertModelClass · 0.85
BertOnlyMLMHeadClass · 0.85
__init__Method · 0.45
init_weightsMethod · 0.45

Tested by

no test coverage detected