MCPcopy Create free account
hub / github.com/ml-explore/mlx-examples / __init__

Method __init__

llms/speculative_decoding/model.py:241–246  ·  view source on GitHub ↗
(self, config: T5Config)

Source from the content-addressed store, hash-verified

239
240class TransformerDecoder(nn.Module):
241 def __init__(self, config: T5Config):
242 super().__init__()
243 n_layers = getattr(config, "num_decoder_layers", config.num_layers)
244 self.layers = [TransformerDecoderLayer(config) for i in range(n_layers)]
245 self.ln = nn.RMSNorm(config.d_model, eps=config.layer_norm_epsilon)
246 self.relative_attention_bias = RelativePositionBias(config, bidirectional=False)
247
248 def __call__(self, x, memory, cache=None):
249 if cache[0] is not None:

Callers

nothing calls this directly

Calls 3

__init__Method · 0.45

Tested by

no test coverage detected