§
    ‚Š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MAMBA configurationé    N)Ústricté   )ÚPreTrainedConfig)Úauto_docstringzstate-spaces/mamba-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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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d-<   dZ$eed.<   ˆ fd/„Z%e&d0„ ¦   «         Z'ˆ xZ(S )1ÚMambaConfiga:  
    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.
    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.
    use_mambapy (`bool`, *optional*, defaults to `False`):
        Determines the fallback strategy during training if the CUDA-based official implementation of Mamba is not available. If `True`,
        the mamba.py implementation is used. If `False`, the naive and slower implementation is used. Consider switching to the naive
        version if memory is limited.
    use_associative_scan (`bool`, *optional*, defaults to `True`):
        Whether to use PyTorch's `torch._higher_order_ops.associative_scan` for the parallel scan instead of the naive
        sequential implementation. The associative scan is only active during `torch.compile` tracing and
        requires torch >= 2.9.0. Both paths are tested to produce numerically identical results (see
        `test_associative_scan_matches_sequential`). Set to `False` to fall back to the sequential loop.

    Example:

    ```python
    >>> from transformers import MambaConfig, MambaModel

    >>> # Initializing a Mamba configuration
    >>> configuration = MambaConfig()

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

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```ÚmambaihÄ  Ú
vocab_sizei   Úhidden_sizeé   Ú
state_sizeé    Únum_hidden_layersgñhãˆµøä>Úlayer_norm_epsilonr   NÚpad_token_idÚbos_token_idÚeos_token_idé   Úexpandé   Úconv_kernelFÚuse_biasTÚuse_conv_biasÚsiluÚ
hidden_actgš™™™™™¹?Úinitializer_rangeÚresidual_in_fp32ÚautoÚtime_step_rankg      ð?Útime_step_scalegü©ñÒMbP?Útime_step_minÚtime_step_maxÚrandomÚtime_step_init_schemeg-Cëâ6?Útime_step_floorÚrescale_prenorm_residualÚ	use_cacheÚuse_mambapyÚuse_associative_scanÚtie_word_embeddingsc                 óâ   •— t          | j        | j        z  ¦  «        | _        | j        dk    rt          j        | j        dz  ¦  «        n| j        | _         t          ¦   «         j        di |¤Ž d S )Nr   r   © )	Úintr   r   Úintermediate_sizer    ÚmathÚceilÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €úk/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/mamba/configuration_mamba.pyr3   zMambaConfig.__post_init__^   su   ø€ Ý!$ T¤[°4Ô3CÑ%CÑ!DÔ!DˆÔà04Ô0CÀvÒ0MÐ0M�DŒI�dÔ&¨Ñ+Ñ,Ô,Ð,ÐSWÔSfð 	Ôð 	�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'ó    c                 ó   — dg| j         z  S )NÚlinear_attention)r   )r4   s    r7   Úlayer_typeszMambaConfig.layer_typese   s   € à"Ð# dÔ&<Ñ<Ð<r8   ))Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typer   r.   Ú__annotations__r   r   r   r   Úfloatr   r   r   Úlistr   r   r   Úboolr   r   Ústrr   r   r    r!   r"   r#   r%   r&   r'   r(   r)   r*   r+   r3   Úpropertyr;   Ú__classcell__)r6   s   @r7   r	   r	      s%  ø€ € € € € € ð$ð $ðL €Jà€J�ÐÐÑØ€K�ÐÐÑØ€J�ÐÐÑØÐ�sÐÐÑØ $Ð˜Ð$Ð$Ñ$Ø €L�#˜‘*Ð Ð Ñ Ø €L�#˜‘*Ð Ð Ñ Ø+,€L�#˜˜Sœ	‘/ DÑ(Ð,Ð,Ñ,Ø€FˆC€O€O�OØ€K�ÐÐÑØ€HˆdÐÐÑØ€M�4ÐÐÑØ€J�ÐÐÑØ"Ð�uÐ"Ð"Ñ"Ø!Ð�dÐ!Ð!Ñ!Ø &€N�C˜#‘IÐ&Ð&Ñ&Ø €O�UÐ Ð Ñ Ø €M�5Ð Ð Ñ Ø€M�5ÐÐÑØ!)Ð˜3Ð)Ð)Ñ)Ø!€O�UÐ!Ð!Ñ!Ø%*Ð˜dÐ*Ð*Ñ*Ø€IˆtÐÐÑØ€K�ÐÐÑØ!%Ð˜$Ð%Ð%Ñ%Ø $Ð˜Ð$Ð$Ñ$ð(ð (ð (ð (ð (ð ð=ð =ñ „Xð=ð =ð =ð =ð =r8   r	   )
r?   r0   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r	   Ú__all__r-   r8   r7   ú<module>rL      s²   ðð Ð à €€€à .Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø #Ð #Ð #Ð #Ð #Ð #ð €Ð4Ð5Ñ5Ô5ØðM=ð M=ð M=ð M=ð M=Ð"ñ M=ô M=ñ „ñ 6Ô5ðM=ð` ˆ/€€€r8   