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

Method __init__

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

Source from the content-addressed store, hash-verified

1004@add_start_docstrings("""Bert Model with a `language modeling` head on top. """, BERT_START_DOCSTRING)
1005class BertForMaskedLM(BertPreTrainedModel):
1006 def __init__(self, config):
1007 super().__init__(config)
1008 assert (
1009 not config.is_decoder
1010 ), "If you want to use `BertForMaskedLM` make sure `config.is_decoder=False` for bi-directional self-attention."
1011
1012 self.bert = BertModel(config)
1013 self.cls = BertOnlyMLMHead(config)
1014
1015 self.init_weights()
1016
1017 def get_output_embeddings(self):
1018 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