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

Method __init__

inference/models/mpt.py:235–244  ·  view source on GitHub ↗
(self, layer_id: int, args)

Source from the content-addressed store, hash-verified

233
234class MPTBlock(nn.Module):
235 def __init__(self, layer_id: int, args):
236 super().__init__()
237 self.n_heads = args.n_heads
238 self.dim = args.d_model
239 self.head_dim = args.d_model // args.n_heads
240 self.attn = MPTAttentionFused(args)
241 self.ffn = MPTMLP(d_model=args.d_model, expansion_ratio=4)
242 self.layer_id = layer_id
243 self.norm_1 = LPLayerNorm(args.d_model, eps=1e-6)
244 self.norm_2 = LPLayerNorm(args.d_model, eps=1e-6)
245
246 def forward(
247 self,

Callers

nothing calls this directly

Calls 4

MPTAttentionFusedClass · 0.85
MPTMLPClass · 0.85
LPLayerNormClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected