MCPcopy Create free account
hub / github.com/AnswerDotAI/ModernBERT / __init__

Method __init__

src/bert_layers/model.py:465–478  ·  view source on GitHub ↗
(self, config)

Source from the content-addressed store, hash-verified

463 """
464
465 def __init__(self, config):
466 super().__init__(config)
467 self.num_labels = config.num_labels
468 self.config = config
469
470 self.bert = BertModel(config)
471 classifier_dropout = (
472 config.classifier_dropout if config.classifier_dropout is not None else config.hidden_dropout_prob
473 )
474 self.dropout = nn.Dropout(classifier_dropout)
475 self.classifier = nn.Linear(config.hidden_size, config.num_labels)
476
477 # Initialize weights and apply final processing
478 self.post_init()
479
480 @classmethod
481 def from_composer(

Callers

nothing calls this directly

Calls 3

BertModelClass · 0.85
post_initMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected