MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / __init__

Method __init__

inference/models/llama.py:239–248  ·  view source on GitHub ↗
(self, layer_id: int, args)

Source from the content-addressed store, hash-verified

237
238class TransformerBlock(nn.Module):
239 def __init__(self, layer_id: int, args):
240 super().__init__()
241 self.n_heads = args.num_attention_heads
242 self.dim = args.hidden_size
243 self.head_dim = args.hidden_size // args.num_attention_heads
244 self.self_attn = LlamaAttentionFused(args)
245 self.mlp = LlamaMLP(args)
246 self.layer_id = layer_id
247 self.input_layernorm = RMSNorm(args.hidden_size, eps=args.rms_norm_eps)
248 self.post_attention_layernorm = RMSNorm(args.hidden_size, eps=args.rms_norm_eps)
249
250 def forward(
251 self,

Callers

nothing calls this directly

Calls 4

LlamaAttentionFusedClass · 0.85
LlamaMLPClass · 0.85
RMSNormClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected