§
    ‚Štj  ã                   óŒ   — 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	dS )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	          ¦   «         j        di |¤Ž d S )Nr$   é   © )r%   ÚmathÚceilr   ÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €úm/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/mamba2/configuration_mamba2.pyr7   zMamba2Config.__post_init__[   s[   ø€ à04Ô0CÀvÒ0MÐ0M�DŒI�dÔ&¨Ñ+Ñ,Ô,Ð,ÐSWÔSfð 	Ôð 	�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'ó    c                 ó¦   — | j         | j        z  | j        | j        z  k    r0t	          d| j         | j        z  › d| j        | j        z  › d�¦  «        ‚dS )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ÐOÝð7ØÔ$ t¤{Ñ2ð7ð 7à”N T¤]Ñ2ð7ð 7ð 7ñô ð ð PÐOr<   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	      sq  ø€ € € € € € ðð ðB €Jà€IˆsÐÐÑØ€HˆcÐÐÑØ€J�ÐÐÑØ€K�ÐÐÑØ€J�ÐÐÑØÐ�sÐÐÑØ $Ð˜Ð$Ð$Ñ$Ø €L�#˜‘*Ð Ð Ñ Ø €L�#˜‘*Ð Ð Ñ Ø+,€L�#˜˜Sœ	‘/ DÑ(Ð,Ð,Ñ,Ø€FˆC€O€O�OØ€K�ÐÐÑØ€HˆcÐÐÑØ€HˆdÐÐÑØ€M�4ÐÐÑØ€J�ÐÐÑØ"Ð�uÐ"Ð"Ñ"Ø!Ð�dÐ!Ð!Ñ!Ø &€N�C˜#‘IÐ&Ð&Ñ&Ø €M�5Ð Ð Ñ Ø€M�5ÐÐÑØ!€O�UÐ!Ð!Ñ!Ø8;¸U¸UÀ5¹\¼\Ð7J€O�T˜%”[ 5¨°¨Ô#4Ñ4ÐJÐJÑJØ%*Ð˜dÐ*Ð*Ñ*Ø€IˆtÐÐÑØ€HˆdÐÐÑØ€J�ÐÐÑØ %Ð˜Ð%Ð%Ñ%ð(ð (ð (ð (ð (ðð ð ð ð=ð =ñ „Xð=ð =ð =ð =ð =r<   r	   )
rG   r4   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r	   Ú__all__r3   r<   r;   ú<module>rV      s³   ðð Ð à €€€à .Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø #Ð #Ð #Ð #Ð #Ð #ð €Ð5Ð6Ñ6Ô6ØðR=ð R=ð R=ð R=ð R=Ð#ñ R=ô R=ñ „ñ 7Ô6ðR=ðj Ð
€€€r<   