
    ^j                     r    d dl mZ ddlmZ ddlmZ ddlmZ  ed      e G d d	e                    Zd	gZ	y
)    )strict   )PreTrainedConfig)RopeParameters)auto_docstringz,naver-hyperclovax/HyperCLOVAX-SEED-Think-14B)
checkpointc                        e Zd ZU dZdZdgZddddddddZdgdgfd	d
gd	gfd	gd	gfdZdZe	e
d<   dZe	e
d<   dZe	e
d<   dZe	e
d<   dZe	e
d<   dZe	dz  e
d<   dZee
d<   dZe	e
d<   dZee
d<   dZee
d<   dZee
d <   dZe	dz  e
d!<   d"Ze	dz  e
d#<   d$Ze	ee	   z  dz  e
d%<   d&Zee
d'<   dZeez  dz  e
d(<   d&Z ee
d)<   d*Z!ee	z  e
d+<   d&Z"ee
d,<   d-Z#ee	z  e
d.<   d-Z$ee	z  e
d/<   d-Z%ee	z  e
d0<   dZ&edz  e
d1<   dZ'e	dz  e
d2<   dZ(ee
d3<    fd4Z)d5 Z* xZ+S )6HyperCLOVAXConfiga@  
    embedding_multiplier (`float`, *optional*, defaults to `1.0`):
        Scaling factor applied to the token embedding outputs. Used in MuP to control the
        scale of the embedding activations.
    logits_scaling (`float`, *optional*, defaults to `1.0`):
        Scaling factor **multiplied** to the final logits before loss computation or sampling.
        Used in MuP to ensure consistent output scale across model sizes. Note: unlike
        [`GraniteConfig`], this is a multiplier, not a divisor.
    residual_multiplier (`float`, *optional*, defaults to `1.0`):
        Scaling factor applied to each sub-layer output before adding to the residual stream.
        Used in Maximal Update Parametrization (MuP) to stabilize training across model sizes.
    attention_multiplier (`float`, *optional*, defaults to `head_dim ** -0.5`):
        Scaling factor applied to attention logits before softmax, replacing the standard
        `1 / sqrt(head_dim)` scaling. Set explicitly for MuP-based training; when `None`,
        defaults to the standard value.
    use_post_norm (`bool`, *optional*, defaults to `True`):
        Whether to apply an extra RMSNorm after each sub-layer output (Peri-Layer Normalization).

    ```python
    >>> from transformers import HyperCLOVAXModel, HyperCLOVAXConfig

    >>> # Initializing a HyperCLOVAX style configuration
    >>> configuration = HyperCLOVAXConfig()

    >>> # Initializing a model from the configuration
    >>> model = HyperCLOVAXModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```hyperclovaxpast_key_valuescolwiserowwise)zlayers.*.self_attn.q_projzlayers.*.self_attn.k_projzlayers.*.self_attn.v_projzlayers.*.self_attn.o_projzlayers.*.mlp.gate_projzlayers.*.mlp.up_projzlayers.*.mlp.down_proj	input_idsinputs_embedshidden_statesattention_mask)embed_tokenslayersnormi }  
vocab_sizei   hidden_sizei +  intermediate_size    num_hidden_layersnum_attention_headsNnum_key_value_headssilu
hidden_acti   max_position_embeddingsg{Gz?initializer_rangegư>rms_norm_epsT	use_cachepad_token_id   bos_token_id   eos_token_idFtie_word_embeddingsrope_parametersattention_biasg        attention_dropoutmlp_biasg      ?embedding_multiplierlogits_scalingresidual_multiplierattention_multiplierhead_dimuse_post_normc                     | j                   | j                  | j                  z  | _         | j                  | j                  | _        t	        |   di | | j                  | j                   dz  | _        y y )Ng      ࿩ )r1   r   r   r   super__post_init__r0   )selfkwargs	__class__s     /var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/hyperclovax/configuration_hyperclovax.pyr6   zHyperCLOVAXConfig.__post_init__n   su     ==  ,,0H0HHDM##+'+'?'?D$'' $$,(,t(;D% -    c                     | j                   | j                  z  dk7  r&t        d| j                    d| j                   d      y)zCValidates that `hidden_size` is divisible by `num_attention_heads`.r   zThe hidden size (z6) is not a multiple of the number of attention heads (z).N)r   r   
ValueError)r7   s    r:   validate_architecturez'HyperCLOVAXConfig.validate_architecture}   sS    d666!;#D$4$4#5 622327  <r;   ),__name__
__module____qualname____doc__
model_typekeys_to_ignore_at_inferencebase_model_tp_planbase_model_pp_planr   int__annotations__r   r   r   r   r   r   strr   r    floatr!   r"   boolr#   r%   r'   listr(   r)   r   dictr*   r+   r,   r-   r.   r/   r0   r1   r2   r6   r>   __classcell__)r9   s   @r:   r
   r
      s   > J#4"5 &/%.%.%."+ )"+ &(9:#%568IJ!"_$56 JK"s"s!!&*t*J#'S'#u#L%It#L#*# L#* +,L#S	/D(, %%48O^d*T18 ND %(us{(Hd(+%#++"%NECK%'** *.%$,-HcDj M4<r;   r
   N)
huggingface_hub.dataclassesr   configuration_utilsr   modeling_rope_utilsr   utilsr   r
   __all__r4   r;   r:   <module>rT      sL   ( / 3 1 # IJf( f  KfR 
r;   