Ë
    T^(hî  ã                   óh   — d Z ddlZddlmZ ddlmZ  ej                  e«      Z G d„ de«      Z	dgZ
y)zMAMBA2 configurationé    Né   )ÚPretrainedConfig)Úloggingc                   óp   ‡ — e Zd ZdZdZddddddddd	d
d
dddddddddddd ed«      fdddddfˆ fd„	Zˆ xZS )ÚMamba2Configal  
    This is the configuration class to store the configuration of a [`Mamba2Model`]. It is used to instantiate a MAMBA2
    model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
    defaults will yield a similar configuration to that of the MAMBA2
    [state-spaces/mamba2-2.8b](https://huggingface.co/state-spaces/mamba2-2.8b) architecture.

    Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
    documentation from [`PretrainedConfig`] for more information.


    Args:
        num_heads (`int`, *optional*, defaults to 128):
            Number of heads for the evolution matrices of mamba 2.
        head_dim (`int`, *optional*, defaults to 64):
            Dimension of each head.
        vocab_size (`int`, *optional*, defaults to 32768):
            Vocabulary size of the MAMBA2 model. Defines the number of different tokens that can be represented by the
            `inputs_ids` passed when calling [`Mamba2Model`].
        hidden_size (`int`, *optional*, defaults to 4096):
            Dimensionality of the embeddings and hidden states.
        state_size (`int`, *optional*, defaults to 128): shape of the state space latents.
        num_hidden_layers (`int`, *optional*, defaults to 64):
            Number of hidden layers in the model.
        layer_norm_epsilon (`float`, *optional*, defaults to 1e-05):
            The epsilon to use in the layer normalization layers.
        pad_token_id (`int`, *optional*, defaults to 1):
            Padding token id.
        bos_token_id (`int`, *optional*, defaults to 0):
            The id of the beginning of sentence token in the vocabulary.
        eos_token_id (`int`, *optional*, defaults to 2):
            The id of the end of sentence token in the vocabulary.
        expand (`int`, *optional*, defaults to 2): Expanding factor used to determine the intermediate size.
        conv_kernel (`int`, *optional*, defaults to 4): Size of the convolution kernel.
        n_groups (`int`, *optional*, defaults to 8):
            Number of groups for the evolution matrices of mamba 2.
        use_bias (`bool`, *optional*, defaults to `False`):
            Whether or not to use bias in ["in_proj", "out_proj"] of the mixer block
        use_conv_bias (`bool`, *optional*, defaults to `True`):
            Whether or not to use bias in the convolution layer of the mixer block.
        hidden_act (`str`, *optional*, defaults to `"silu"`):
            The non-linear activation function (function or string) in the decoder.
        initializer_range (`float`, *optional*, defaults to 0.1):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
        residual_in_fp32 (`bool`, *optional*, defaults to `True`):
            Whether or not residuals should be in `float32`. If set to `False` residuals will keep the same `dtype` as the rest of the model
        time_step_rank (`Union[int,str]`, *optional*, defaults to `"auto"`):
            Rank of the discretization projection matrix. `"auto"` means that it will default to `math.ceil(self.hidden_size / 16)`
        time_step_min (`float`, *optional*, defaults to 0.001):
            Minimum `time_step` used to bound `dt_proj.bias`.
        time_step_max (`float`, *optional*, defaults to 0.1):
            Maximum `time_step` used to bound `dt_proj.bias`.
        time_step_floor (`float`, *optional*, defaults to 0.0001):
            Minimum clamping value of the `dt_proj.bias` layer initialization.
        time_step_limit (`tuple`, *optional*, defaults to `(0.0, inf)`):
            Accepted range of time step values.
        rescale_prenorm_residual (`bool`, *optional*, defaults to `False`):
            Whether or not to rescale `out_proj` weights when initializing.
        use_cache (`bool`, *optional*, defaults to `True`):
            Whether or not the cache should be used.
        rms_norm (`bool`, *optional*, defaults to `True`):
            Whether to use RMS norm or not.
        chunk_size (`int`, *optional*, defaults to 256):
            Size of the chunks that will comprise the sequence.
        tie_word_embeddings (`bool`, *optional*, defaults to `False`):
            Whether to tie word embeddings or not.


    Example:

    ```python
    >>> from transformers import Mamba2Config, Mamba2Model

    >>> # Initializing a Mamba2 configuration
    >>> configuration = Mamba2Config()

    >>> # Initializing a model (with random weights) from the configuration
    >>> model = Mamba2Model(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úmamba2é€   é@   i €  i   gñhãˆµøä>é   r   é   é   é   FTÚsilugš™™™™™¹?Úautogü©ñÒMbP?g-Cëâ6?g        Úinfé   c                 ó  •— || _         || _        || _        || _        || _        || _        || _        |	| _        |
| _        || _	        || _
        || _        || _        || _        |dk(  r"t        j                  | j                  dz  «      n|| _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        t=        ‰| �|  d|	|
||dœ|¤Ž y )Nr   é   )Úbos_token_idÚeos_token_idÚpad_token_idÚtie_word_embeddings© ) Ú
vocab_sizeÚhidden_sizeÚ
state_sizeÚnum_hidden_layersÚlayer_norm_epsilonÚconv_kernelÚexpandr   r   r   Úuse_biasÚuse_conv_biasÚ
hidden_actÚinitializer_rangeÚmathÚceilÚtime_step_rankÚtime_step_minÚtime_step_maxÚtime_step_floorÚrescale_prenorm_residualÚresidual_in_fp32Ú	use_cacheÚn_groupsÚ	num_headsÚhead_dimÚrms_normÚ
chunk_sizeÚtime_step_limitr   ÚsuperÚ__init__)Úselfr/   r0   r   r   r   r   r   r   r   r   r    r   r.   r!   r"   r#   r$   r,   r'   r(   r)   r*   r3   r+   r-   r1   r2   r   ÚkwargsÚ	__class__s                                 €úm/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/models/mamba2/configuration_mamba2.pyr5   zMamba2Config.__init__o   s)  ø€ ð@ %ˆŒØ&ˆÔØ$ˆŒØ!2ˆÔØ"4ˆÔØ&ˆÔØˆŒà(ˆÔØ(ˆÔØ(ˆÔØ ˆŒØ*ˆÔØ$ˆŒØ!2ˆÔØBPÐTZÒBZœdŸi™i¨×(8Ñ(8¸2Ñ(=Ô>Ð`nˆÔØ*ˆÔØ*ˆÔØ.ˆÔØ(@ˆÔ%Ø 0ˆÔØ"ˆŒØ ˆŒØ"ˆŒØ ˆŒØ ˆŒØ$ˆŒØ$ˆŒØ.ˆÔØ#6ˆÔ ä‰Ñð 	
Ø%Ø%Ø%Ø 3ñ		
ð
 ó	
ó    )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚfloatr5   Ú__classcell__)r8   s   @r9   r   r      s|   ø„ ñPðd €Jð ØØØØØØØØØØØØØØØØØØØØØØ™e E›lÐ+Ø!&ØØØØ!÷;E
ñ E
r:   r   )r>   r%   Úconfiguration_utilsr   Úutilsr   Ú
get_loggerr;   Úloggerr   Ú__all__r   r:   r9   ú<module>rG      sA   ðñ ã å 3Ý ð 
ˆ×	Ñ	˜HÓ	%€ôZ
Ð#ô Z
ðz Ð
�r:   