(self)
| 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): |
nothing calls this directly
no outgoing calls
no test coverage detected