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

Method __post_init__

lora/models.py:26–36  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

24 rope_scaling: Optional[Dict[str, Union[float, str]]] = None
25
26 def __post_init__(self):
27 if self.num_key_value_heads is None:
28 self.num_key_value_heads = self.num_attention_heads
29
30 if self.rope_scaling:
31 required_keys = {"factor", "type"}
32 if not all(key in self.rope_scaling for key in required_keys):
33 raise ValueError(f"rope_scaling must contain keys {required_keys}")
34
35 if self.rope_scaling["type"] != "linear":
36 raise ValueError("rope_scaling 'type' currently only supports 'linear'")
37
38 @classmethod
39 def from_dict(cls, params):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected