Ë
    ÜÓ^j  ã                   ór   — d Z ddl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)zMAMBA2 configurationé    N)Ústricté   )ÚPreTrainedConfig)Úauto_docstringzstate-spaces/mamba2-2.8b)Ú
checkpointc                   ó  ‡ — e Zd ZU dZ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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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ed#<   d$Zeez  ed%<   d&Zeed'<   d!Zeed(<   d)Z eed*<   d+ ed,«      fZ!ee   e"ed-f   z  ed.<   dZ#eed/<   dZ$eed0<   dZ%eed1<   d2Z&eed3<   dZ'eed4<   ˆ fd5„Z(d6„ Z)e*d7„ «       Z+ˆ xZ,S )8ÚMamba2ConfigaÀ  
    layer_norm_epsilon (`float`, *optional*, defaults to 1e-05):
        The epsilon to use in the layer normalization layers..
    expand (`int`, *optional*, defaults to 2):
        Expanding factor used to determine the intermediate size.
    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.
    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
    rescale_prenorm_residual (`bool`, *optional*, defaults to `False`):
        Whether or not to rescale `out_proj` weights when initializing.
    chunk_size (`int`, *optional*, defaults to 256):
        Size of the chunks that will comprise the sequence.

    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é€   Ú	num_headsé@   Úhead_dimi €  Ú
vocab_sizei   Úhidden_sizeÚ
state_sizeÚnum_hidden_layersgñhãˆµøä>Úlayer_norm_epsiloné   NÚpad_token_idr   Úbos_token_idé   Úeos_token_idÚexpandé   Úconv_kernelé   Ún_groupsFÚuse_biasTÚuse_conv_biasÚsiluÚ
hidden_actgš™™™™™¹?Úinitializer_rangeÚresidual_in_fp32ÚautoÚtime_step_rankgü©ñÒMbP?Útime_step_minÚtime_step_maxg-Cëâ6?Útime_step_floorg        Úinf.Útime_step_limitÚrescale_prenorm_residualÚ	use_cacheÚrms_normé   Ú
chunk_sizeÚtie_word_embeddingsc                 ó¨   •— | j                   dk(  r"t        j                  | j                  dz  «      n| j                   | _         t	        ‰| �  di |¤Ž y )Nr$   é   © )r%   ÚmathÚceilr   ÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €úz/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/mamba2/configuration_mamba2.pyr7   zMamba2Config.__post_init__[   sJ   ø€ à04×0CÑ0CÀvÒ0MŒD�I‰I�d×&Ñ&¨Ñ+Ô,ÐSW×SfÑSfð 	Ôô 	‰ÑÑ' Ó'ó    c                 óê   — | j                   | j                  z  | j                  | j                  z  k7  r@t	        d| j                   | j                  z  › d| j                  | j                  z  › d�«      ‚y)zOPart of `@strict`-powered validation. Validates the architecture of the config.z2Inconsistent configuration: hidden_size * expand (z#) must equal num_heads * head_dim (z).N)r   r   r   r   Ú
ValueError©r8   s    r;   Úvalidate_architecturez"Mamba2Config.validate_architecturea   sr   € à×Ñ˜tŸ{™{Ñ*°·±ÀÇÁÑ0NÒOÜðØ×$Ñ$ t§{¡{Ñ2Ð3ð 4Ø—N‘N T§]¡]Ñ2Ð3°2ð7óð ð Pr<   c                 ó"   — dg| j                   z  S )NÚlinear_attention)r   r?   s    r;   Úlayer_typeszMamba2Config.layer_typesj   s   € à"Ð# d×&<Ñ&<Ñ<Ð<r<   )-Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typer   ÚintÚ__annotations__r   r   r   r   r   r   Úfloatr   r   r   Úlistr   r   r   r   Úboolr   r!   Ústrr"   r#   r%   r&   r'   r(   r*   Útupler+   r,   r-   r/   r0   r7   r@   ÚpropertyrC   Ú__classcell__)r:   s   @r;   r	   r	      s  ø… ñðB €Jà€IˆsÓØ€HˆcÓØ€J�ÓØ€K�ÓØ€J�ÓØÐ�sÓØ $Ð˜Ó$Ø €L�#˜‘*Ó Ø €L�#˜‘*Ó Ø+,€L�#˜˜S™	‘/ DÑ(Ó,Ø€FˆCƒOØ€K�ÓØ€HˆcÓØ€HˆdÓØ€M�4ÓØ€J�ÓØ"Ð�uÓ"Ø!Ð�dÓ!Ø &€N�C˜#‘IÓ&Ø €M�5Ó Ø€M�5ÓØ!€O�UÓ!Ø8;¹UÀ5»\Ð7J€O�T˜%‘[ 5¨°¨Ñ#4Ñ4ÓJØ%*Ð˜dÓ*Ø€IˆtÓØ€HˆdÓØ€J�ÓØ %Ð˜Ó%ô(òð ñ=ó ô=r<   r	   )
rG   r4   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r	   Ú__all__r3   r<   r;   ú<module>rV      sN   ðñ ã å .å 3Ý #ñ Ð5Ô6ØôR=Ð#ó R=ó ó 7ðR=ðj Ð
�r<   