MCPcopy
hub / github.com/huggingface/transformers / __init__

Method __init__

src/transformers/models/blt/modular_blt.py:772–786  ·  view source on GitHub ↗
(self, config: BltPatcherConfig)

Source from the content-addressed store, hash-verified

770 config: BltPatcherConfig
771
772 def __init__(self, config: BltPatcherConfig):
773 super().__init__(config)
774 self.rotary_emb = BltRotaryEmbedding(config=self.config)
775 self.layers = nn.ModuleList()
776 for layer_idx in range(self.config.num_hidden_layers):
777 self.layers.append(BltTransformerLayer(self.config, layer_idx))
778 self.embed_tokens = nn.Embedding(self.config.vocab_size, self.config.hidden_size)
779 self.norm = BltRMSNorm(self.config.hidden_size, eps=self.config.rms_norm_eps)
780 self.lm_head = nn.Linear(
781 self.config.hidden_size,
782 self.config.vocab_size,
783 bias=False,
784 )
785
786 self.post_init()
787
788 def forward(
789 self,

Callers

nothing calls this directly

Calls 5

BltRotaryEmbeddingClass · 0.70
BltTransformerLayerClass · 0.70
BltRMSNormClass · 0.70
__init__Method · 0.45
post_initMethod · 0.45

Tested by

no test coverage detected