#Rose X1.5 model configuration. from transformers import PretrainedConfig class RoseX15Config(PretrainedConfig): model_type = "rose_x1_5" def __init__( self, vocab_size=32768, hidden_size=576, num_hidden_layers=22, num_attention_heads=9, num_key_value_heads=3, head_dim=64, intermediate_size=1532, max_position_embeddings=4096, hidden_act="silu", rms_norm_eps=1e-6, attention_bias=False, mlp_bias=False, attention_dropout=0.0, rope_theta=100000.0, rope_scaling=None, tie_word_embeddings=True, # QK Norm use_qk_norm=True, # XSA (Exclusive Self Attention) use_xsa=True, # Refresh Gate refresh_gate_enabled=True, refresh_gate_inject_layers=None, refresh_gate_kernel_size=9, # muP (recorded for reproducibility; does not affect forward pass) mup_enabled=False, mup_base_hidden_size=None, mup_width_mult=None, **kwargs, ): self.vocab_size = vocab_size self.hidden_size = hidden_size self.num_hidden_layers = num_hidden_layers self.num_attention_heads = num_attention_heads self.num_key_value_heads = num_key_value_heads self.head_dim = head_dim self.intermediate_size = intermediate_size self.max_position_embeddings = max_position_embeddings self.hidden_act = hidden_act self.rms_norm_eps = rms_norm_eps self.attention_bias = attention_bias self.mlp_bias = mlp_bias self.attention_dropout = attention_dropout self.rope_theta = rope_theta self.rope_scaling = rope_scaling # QK Norm self.use_qk_norm = use_qk_norm # XSA self.use_xsa = use_xsa # Refresh Gate self.refresh_gate_enabled = refresh_gate_enabled self.refresh_gate_inject_layers = ( list(refresh_gate_inject_layers) if refresh_gate_inject_layers is not None else [4, 9] ) self.refresh_gate_kernel_size = refresh_gate_kernel_size # muP (metadata only) self.mup_enabled = mup_enabled self.mup_base_hidden_size = mup_base_hidden_size self.mup_width_mult = mup_width_mult super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)