§
     `ƒi¾1  ã                   ó4   — d dl mZ  G d„ de¦  «        ZdgZdS )é   )ÚPretrainedConfigc                   ó~   ‡ — e Zd ZdZdZddiZdgZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dˆ fd„	Zˆ xZS ) ÚZamba2Configas  
    This is the configuration class to store the configuration of a [`Zamba2Model`]. It is used to instantiate a
    Zamba2 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 Zamba2 model.

    [Zyphra/Zamba2-2.7B](https://huggingface.co/Zyphra/Zamba2-2.7B)

    Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
    documentation from [`PretrainedConfig`] for more information.
    Args:
        vocab_size (`int`, *optional*, defaults to 32000):
            Vocabulary size of the Zamba2 model. Defines the number of different tokens that can be represented by the
            `inputs_ids` passed when calling [`Zamba2Model`]
        max_position_embeddings (`int`, *optional*, defaults to 4096):
            The maximum sequence length that this model might ever be used with.
        hidden_size (`int`, *optional*, defaults to 2560):
            Dimension of the hidden representations.
        num_hidden_layers (`int`, *optional*, defaults to 54):
            Number of hidden layers in the model.
        layers_block_type (`list`, *optional*):
            List of layer types, which can be either "mamba" or "hybrid".
        mamba_d_state (`int`, *optional*, defaults to 64): shape of the state space latents.
        mamba_d_conv (`int`, *optional*, defaults to 4): Size of the convolution kernel.
        mamba_expand (`int`, *optional*, defaults to 2): Expanding factor used to determine the intermediate size.
        mamba_ngroups (`int`, *optional*, defaults to 1):
            Number of groups for the evolution matrices of mamba 2.
        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*):
            Accepted range of time step values.
        n_mamba_heads (`int`, *optional*, defaults to 8):
            Number of heads for the evolution matrices of mamba 2.
        use_conv_bias (`bool`, *optional*, defaults to `True`):
            Whether or not to use bias in the convolution layer of the mixer block.
        chunk_size (`int`, *optional*, defaults to 256):
            Size of the chunks that will comprise the sequence.
        use_mem_eff_path (`bool`, *optional*, defaults to `False`):
            Whether or not to use the fused conv1d and scan in mamba2 layers.
        add_bias_linear (`bool`, *optional*, defaults to `False`):
            Flag indicating whether or not to use bias in various layers
        intermediate_size (`int`, *optional*, defaults to 4 * hidden_size):
            Dimension of the MLP representations.
        hidden_act (`str`, *optional*, defaults to `"gelu"`):
            The non-linear activation function (function or string) in the MLP.
        num_attention_heads (`int`, *optional*, defaults to 32):
            Number of attention heads for each attention layer in the Transformer decoder.
        num_key_value_heads (`int`, *optional*):
            This is the number of key_value heads that should be used to implement Grouped Query Attention. If
            `num_key_value_heads=None`, the model will use Multi Head Attention (MHA), if
            `num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When
            converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
            by meanpooling all the original heads within that group. For more details, check out [this
            paper](https://huggingface.co/papers/2305.13245).
        attention_dropout (`float`, *optional*, defaults to 0.0):
            The dropout ratio for the attention probabilities.
        num_mem_blocks (`int`, *optional*, defaults to 1):
            Number of unshared transformer blocks.
        use_shared_attention_adapter (`bool`, *optional*, defaults to `False`):
            If True, unshared adapters (formally the same as LoRA but used in the base model) will be added to the q, k, v projectors in the shared attention layers.
        adapter_rank (`int`, *optional*, defaults to 128):
            Rank of the adapter in the shared MLP and shared attention layers.
        use_mem_rope (`bool`, *optional*, defaults to `False`):
            If True, includes RoPE in the shared attention layers.
        rope_theta (`float`, *optional*, defaults to `10000.0`):
            The base period of the RoPE embeddings.
        initializer_range (`float`, *optional*, defaults to 0.02):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
        rms_norm_eps (`float`, *optional*, defaults to 1e-05):
            The epsilon used by the rms normalization layers.
        use_cache (`bool`, *optional*, defaults to `True`):
            Whether or not the model should return the last key/values attentions (not used by all models). Only
            relevant if `config.is_decoder=True`.
        num_logits_to_keep (`int` or `None`, *optional*, defaults to 1):
            Number of prompt logits to calculate during generation. If `None`, all logits will be calculated. If an
            integer value, only last `num_logits_to_keep` logits will be calculated. Default is 1 because only the
            logits of the last prompt token are needed for generation. For long sequences, the logits for the entire
            sequence may use a lot of memory so, setting `num_logits_to_keep=1` will reduce memory footprint
            significantly.
        pad_token_id (`int`, *optional*, defaults to 0):
            The id of the padding token.
        bos_token_id (`int`, *optional*, defaults to 1):
            The id of the "beginning-of-sequence" token.
        eos_token_id (`int`, *optional*, defaults to 2):
            The id of the "end-of-sequence" token.
        use_long_context (`bool`, *optional*, defaults to `False`):
            Activates the context-extended version of Zamba by modifying RoPE.
    ```python
    >>> from transformers import Zamba2Model, Zamba2Config
    >>> # Initializing a Zamba2-2.7B style configuration
    >>> configuration = Zamba2Config()
    >>> # Initializing a model from the Zamba2-2.7B style configuration
    >>> model = Zamba2Model(configuration)
    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úzamba2Úhead_dimÚattention_head_dimÚpast_key_valuesé }  é   é 
  é6   Né@   é   é   é   çü©ñÒMbP?çš™™™™™¹?ç-Cëâ6?é   Té   FÚgelué    ç        é€   é'  ç{®Gáz”?çñhãˆµøä>é    c%                 óö  •—  t          ¦   «         j        d|!|"|#dœ|%¤Ž || _        || _        || _        |€d|z  | _        n|| _        || _        || _        || _        || _	        d|z  | _
        d| j        z  | j        z  | _        || _        || _        |$| _        |r|$rd}&||&| j        | j        dz
  z  z  z  }|| _        || _        || _        || _        || _        |	| _        || _        t-          ||z  ¦  «        |z  | _        || _        || _        || _        || _        || _        |
| _        || _        || _        |$rd| _        |€|}|| _         || _        | j        | j        z  | _!        | j        | _"        |€4dgdgdz  dgz   d	z  z   dgdz  z   dgz   dgd
z  z   dgz   dgdz  z   | _#        n|| _#        || _$        || _%        || _&        | | _'        d„ tQ          | j#        ¦  «        D ¦   «         | _)        || _*        d S )N)Úpad_token_idÚbos_token_idÚeos_token_idr   r   r   i @  Úmambaé   Úhybridé   r   c                 ó$   — g | ]\  }}|d k    ¯|‘ŒS )r%   © )Ú.0ÚindexÚtypes      úƒ/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/transformers/models/zamba2/configuration_zamba2.pyú
<listcomp>z)Zamba2Config.__init__.<locals>.<listcomp>í   s(   € Ð pÐ pÐ p©;¨5°$Ð_cÐgoÒ_oÐ_o Ð_oÐ_oÐ_oó    r(   )+ÚsuperÚ__init__Ú
vocab_sizeÚmax_position_embeddingsÚhidden_sizeÚintermediate_sizeÚ
hidden_actÚnum_hidden_layersÚnum_attention_headsÚnum_mem_blocksÚattention_hidden_sizer   Úattention_dropoutÚuse_mem_ropeÚuse_long_contextÚ
rope_thetaÚmamba_d_stateÚmamba_d_convÚmamba_expandÚadd_bias_linearÚmamba_ngroupsÚn_mamba_headsÚintÚmamba_headdimÚuse_conv_biasÚ
chunk_sizeÚtime_step_limitÚuse_shared_attention_adapterÚadapter_rankÚtime_step_minÚtime_step_maxÚtime_step_floorÚnum_key_value_headsÚkv_channelsÚnum_query_groupsÚlayers_block_typeÚinitializer_rangeÚrms_norm_epsÚ	use_cacheÚnum_logits_to_keepÚ	enumerateÚhybrid_layer_idsÚuse_mem_eff_path)(Úselfr1   r2   r3   r6   rQ   r>   r?   r@   rB   rK   rL   rM   rH   rC   rF   rG   rX   rA   r4   r5   r7   rN   r:   r8   rI   rJ   r;   r=   rR   rS   rT   rU   r    r!   r"   r<   ÚkwargsÚaÚ	__class__s(                                          €r,   r0   zZamba2Config.__init__ƒ   s®  ø€ ðP 	‰ŒÔð 	
Ø%Ø%Ø%ð	
ð 	
ð ð		
ð 	
ð 	
ð %ˆŒØ'>ˆÔ$Ø&ˆÔØÐ$Ø%&¨¡_ˆDÔ"Ð"à%6ˆDÔ"Ø$ˆŒØ!2ˆÔØ#6ˆÔ Ø,ˆÔØ%&¨¡_ˆÔ"Ø"# dÔ&6Ñ"6¸$Ô:RÑ"RˆÔØ!2ˆÔØ(ˆÔØ 0ˆÔØð 	eÐ,ð 	eØˆAØ# a¨DÔ,CÀtÔG^ÐabÑGbÑ,cÑ&dÑdˆJØ$ˆŒØ*ˆÔØ(ˆÔØ(ˆÔØ.ˆÔØ*ˆÔØ*ˆÔÝ  °Ñ!;Ñ<Ô<ÀÑMˆÔØ*ˆÔØ$ˆŒØ.ˆÔØ,HˆÔ)Ø(ˆÔØ*ˆÔØ*ˆÔØ.ˆÔØð 	1Ø+0ˆDÔ(ØÐ&Ø"5ÐØ#6ˆÔ Ø#6ˆÔ ØÔ+¨tÔ/GÑGˆÔØ $Ô 8ˆÔàÐ$à	Ø9˜q‘= H :Ñ-°Ñ2ñ3à)˜a‘-ñ ð *ñð )˜a‘-ñ	 ð
 *ñð )˜a‘-ñ ð Ô"Ð"ð &7ˆDÔ"Ø!2ˆÔØ(ˆÔØ"ˆŒØ"4ˆÔØ pÐ p½)ÀDÔDZÑ:[Ô:[Ð pÑ pÔ pˆÔØ 0ˆÔÐÐr.   )$r
   r   r   r   Nr   r   r   r   r   r   r   Nr   Tr   FFNr   r   Nr   r   Fr   Fr   r   r   Tr   r   r   r   F)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚattribute_mapÚkeys_to_ignore_at_inferencer0   Ú__classcell__)r\   s   @r,   r   r      sÞ   ø€ € € € € ðbð bðH €JØÐ!5Ð6€MØ#4Ð"5Ðð Ø $ØØØØØØØØØØØØØØØØØØØØ ØØØ%*ØØØØØØØØØØØðKk1ð k1ð k1ð k1ð k1ð k1ð k1ð k1ð k1ð k1r.   r   N)Úconfiguration_utilsr   r   Ú__all__r(   r.   r,   ú<module>rg      s[   ðð. 4Ð 3Ð 3Ð 3Ð 3Ð 3ðT1ð T1ð T1ð T1ð T1Ð#ñ T1ô T1ð T1ðn Ð
€€€r.   