Ë
    ÜÓ^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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        ‰| �   di |¤Ž y )Nr   r   © )	Úintr   r   Úintermediate_sizer    ÚmathÚceilÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €úx/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/mamba/configuration_mamba.pyr3   zMambaConfig.__post_init__^   sf   ø€ Ü!$ T§[¡[°4×3CÑ3CÑ%CÓ!DˆÔà04×0CÑ0CÀvÒ0MŒD�I‰I�d×&Ñ&¨Ñ+Ô,ÐSW×SfÑ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	      sM  ø… ñ$ðL €Jà€J�ÓØ€K�ÓØ€J�ÓØÐ�sÓØ $Ð˜Ó$Ø €L�#˜‘*Ó Ø €L�#˜‘*Ó Ø+,€L�#˜˜S™	‘/ DÑ(Ó,Ø€FˆCƒ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�ÓØ!%Ð˜$Ó%Ø $Ð˜Ó$ô(ð ñ=ó ô=r8   r	   )
r?   r0   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r	   Ú__all__r-   r8   r7   ú<module>rL      sM   ðñ ã å .å 3Ý #ñ Ð4Ô5ØôM=Ð"ó M=ó ó 6ðM=ð` ˆ/�r8   