"""Hugging Face PretrainedConfig wrapper for SimpleLM (auto-generated).""" from __future__ import annotations from typing import Optional from transformers import PretrainedConfig class SimpleLMConfig(PretrainedConfig): model_type = "simple_lm" def __init__( self, vocab_size: int = 32000, context_length: int = 512, d_model: int = 512, n_layers: int = 8, n_heads: int = 8, d_ff: Optional[int] = None, dropout: float = 0.1, activation: str = "gelu", bias: bool = True, tie_word_embeddings: bool = True, **kwargs, ) -> None: super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs) self.vocab_size = vocab_size self.context_length = context_length self.d_model = d_model self.n_layers = n_layers self.n_heads = n_heads self.d_ff = d_ff self.dropout = dropout self.activation = activation self.bias = bias @property def hidden_size(self) -> int: return self.d_model @property def max_position_embeddings(self) -> int: return self.context_length @property def num_hidden_layers(self) -> int: return self.n_layers @property def num_attention_heads(self) -> int: return self.n_heads