MCPcopy Create free account
hub / github.com/microsoft/BitNet / __post_init__

Method __post_init__

gpu/convert_safetensors.py:26–33  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

24 norm_eps: float = 1e-5
25
26 def __post_init__(self):
27 if self.n_local_heads == -1:
28 self.n_local_heads = self.n_head
29 if self.intermediate_size is None:
30 hidden_dim = 4 * self.dim
31 n_hidden = int(2 * hidden_dim / 3)
32 self.intermediate_size = n_hidden + (256 - n_hidden % 256) if n_hidden % 256 else n_hidden
33 self.head_dim = self.dim // self.n_head
34
35 @classmethod
36 def from_name(cls, name: str):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected