MCPcopy Create free account
hub / github.com/Pints-AI/1.5-Pints / __init__

Method __init__

lit_gpt/adapter.py:129–137  ·  view source on GitHub ↗
(self, config: Config, block_idx: int)

Source from the content-addressed store, hash-verified

127 we replace the attention layer where adaption is implemented."""
128
129 def __init__(self, config: Config, block_idx: int) -> None:
130 super().__init__()
131 self.norm_1 = config.norm_class(config.n_embd, eps=config.norm_eps)
132 self.attn = CausalSelfAttention(config, block_idx)
133 if not config.shared_attention_norm:
134 self.norm_2 = config.norm_class(config.n_embd, eps=config.norm_eps)
135 self.mlp = config.mlp_class(config)
136
137 self.config = config
138
139 def forward(
140 self,

Callers

nothing calls this directly

Calls 4

norm_classMethod · 0.80
CausalSelfAttentionClass · 0.70
__init__Method · 0.45
mlp_classMethod · 0.45

Tested by

no test coverage detected