MCPcopy Index your code
hub / github.com/Turing-Project/WriteGPT / __init__

Method __init__

LanguageNetwork/BERT/models/model_builder.py:43–49  ·  view source on GitHub ↗
(self, model_dir, temp_dir, load_pretrained_bert, bert_config)

Source from the content-addressed store, hash-verified

41
42class Bert(nn.Module):
43 def __init__(self, model_dir, temp_dir, load_pretrained_bert, bert_config):
44 super(Bert, self).__init__()
45 if load_pretrained_bert:
46 # self.models = BertModel.from_pretrained('bert-base-uncased', cache_dir=temp_dir)
47 self.model = BertModel.from_pretrained(model_dir, cache_dir=temp_dir)
48 else:
49 self.model = BertModel(bert_config)
50
51 def forward(self, x, segs, mask):
52 encoded_layers, _ = self.model(x, segs, attention_mask=mask)

Callers 1

__init__Method · 0.45

Calls 2

BertModelClass · 0.85
from_pretrainedMethod · 0.45

Tested by

no test coverage detected