ó
    ‡Ž¡j—  ã                   ór   • S r SSKJr  SSKJr  SSKJr  SSKJr  \\" SSS	9 " S
 S\5      5       5       r	S/r
g)zBamba model configurationé    )Ústricté   )ÚPreTrainedConfig)ÚRopeParameters)Úauto_docstringz´
    The BambaModel is a hybrid [mamba2](https://github.com/state-spaces/mamba) architecture with SwiGLU.
    The checkpoints are  jointly trained by IBM, Princeton, and UIUC.
    zibm-fms/Bamba-9.8b-2.2T-hf)Úcustom_introÚ
checkpointc                   óÒ  ^ • \ rS rSr% SrSrSS0rS/rSr\	\
S'   S	r\\
S
'   Sr\	\
S'   Sr\	\
S'   Sr\	\
S'   Sr\	\
S'   Sr\	S-  \
S'   Sr\\
S'   Sr\\
S'   Sr\\
S'   Sr\\
S'   Sr\	S-  \
S'   Sr\	S-  \
S '   Sr\	S-  \
S!'   S"r\	\\	   -  S-  \
S#'   S$r\	\
S%'   S&r\\	-  S-  \
S''   Sr\\	   S-  \
S('   S)r \	S-  \
S*'   S+r!\\	-  S-  \
S,'   Sr"\	S-  \
S-'   S.r#\	S-  \
S/'   S0r$\	S-  \
S1'   S"r%\	S-  \
S2'   S.r&\	S-  \
S3'   Sr'\S-  \
S4'   S	r(\S-  \
S5'   S&\" S65      4r)\\   \*\\4   -  S-  \
S7'   S&r+\S-  \
S8'   Sr,\-\.-  S-  \
S9'   S	r/\\
S:'   S	r0\\
S;'   U 4S< jr1\2S= 5       r3S> r4S?r5U =r6$ )@ÚBambaConfigé   a"  
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.
attn_layer_indices (`list`, *optional*):
    Specifies the layer indices that will have full attention. Must contain values at most num_hidden_layers.
z_loss_coefficient (`float`, *optional*, defaults to 0.0):
    Coefficient for auxiliary z-loss used to control logit growth during training
ÚbambaÚlayer_typesÚlayers_block_typeÚpast_key_valuesi ô Ú
vocab_sizeFÚtie_word_embeddingsi   Úhidden_sizei 8  Úintermediate_sizeé    Únum_hidden_layersÚnum_attention_headsé   NÚnum_key_value_headsÚsiluÚ
hidden_actg{®Gáz”?Úinitializer_rangegñhãˆµøä>Úrms_norm_epsTÚ	use_cacheé   Únum_logits_to_keepr   Úpad_token_idÚbos_token_idé   Úeos_token_idi   Úmax_position_embeddingsg        Úattention_dropoutÚattn_layer_indicesé€   Úmamba_n_headsÚautoÚmamba_d_headÚmamba_n_groupsé   Úmamba_d_stateé   Úmamba_d_convÚmamba_expandÚmamba_chunk_sizeÚmamba_conv_biasÚmamba_proj_biasÚinfÚtime_step_limitÚz_loss_coefficientÚrope_parametersÚattention_biasÚmlp_biasc                 ó4  >• U R                   c  U R                  U l         U R                  S:X  a+  U R                  U R                  -  U R
                  -  U l        U R                  b  [        U R                  5      OS U l        SUS'   [        TU ]$  " S0 UD6  g )Nr*   g      à?Úpartial_rotary_factor© )
r   r   r+   r1   r   r)   r6   ÚtupleÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €Ú»C:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\transformers/models/bamba/configuration_bamba.pyr@   ÚBambaConfig.__post_init__R   s�   ø€ à×#Ñ#Ñ+Ø'+×'?Ñ'?ˆDÔ$ð ×Ñ Ó&Ø $× 1Ñ 1°D×4DÑ4DÑ DÈ×HZÑHZÑ ZˆDÔà>B×>RÑ>RÑ>^œu T×%9Ñ%9Ô:ÐdhˆÔØ*-ˆÐ&Ñ'ä‰ÒÑ' Ó'ó    c                 óœ   • [        U R                  5       Vs/ s H'  nU R                  (       a  XR                  ;   a  SOSPM)     sn$ s  snf )NÚfull_attentionÚlinear_attention)Úranger   r'   )rA   Úis     rD   r   ÚBambaConfig.layers_block_type`   sN   € ô ˜4×1Ñ1Ô2ó
â2�ð "&×!8×!8¸Q×BYÑBYÓ=YÑÐ`rÒrÙ2ñ
ð 	
ùò 
s   ˜.A	c                 óÀ   • U R                   U R                  -  nXR                  -  S:w  a  [        S5      eU R                  U R                  -  U:w  a  [        S5      eg)zOPart of `@strict`-powered validation. Validates the architecture of the config.r   z4mamba_n_heads must divide mamba_expand * hidden_sizezPThe dimensions for the Mamba head state do not match the model intermediate_sizeN)r1   r   r)   Ú
ValueErrorr+   )rA   Úmamba_intermediates     rD   Úvalidate_architectureÚ!BambaConfig.validate_architectureg   sb   € à!×.Ñ.°×1AÑ1AÑAÐØ× 2Ñ 2Ñ2°aÓ7ÜÐSÓTÐTà×Ñ˜t×1Ñ1Ñ1Ð5GÓGÜÐoÓpÐpð HrF   )r+   r   r6   )7Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú
model_typeÚattribute_mapÚkeys_to_ignore_at_inferencer   ÚintÚ__annotations__r   Úboolr   r   r   r   r   r   Ústrr   Úfloatr   r   r    r!   r"   r$   Úlistr%   r&   r'   r)   r+   r,   r.   r0   r1   r2   r3   r4   r6   r>   r7   r8   r   Údictr9   r:   r@   Úpropertyr   rP   Ú__static_attributes__Ú__classcell__)rC   s   @rD   r   r      s  ø‡ ñð €JØ"Ð$7Ð8€MØ#4Ð"5Ðà€J�ÓØ %Ð˜Ó%Ø€K�ÓØ"Ð�sÓ"ØÐ�sÓØ!Ð˜Ó!Ø&'Ð˜˜t™Ó'Ø€J�ÓØ#Ð�uÓ#Ø€L�%ÓØ€IˆtÓØ%&Ð˜˜d™
Ó&Ø €L�#˜‘*Ó Ø €L�#˜‘*Ó Ø+,€L�#˜˜S™	‘/ DÑ(Ó,Ø#)Ð˜SÓ)Ø,/Ð�u˜s‘{ TÑ)Ó/Ø+/Ð˜˜S™	 DÑ(Ó/Ø #€M�3˜‘:Ó#Ø%+€L�#˜‘)˜dÑ"Ó+Ø!"€N�C˜$‘JÓ"Ø #€M�3˜‘:Ó#Ø €L�#˜‘*Ó Ø €L�#˜‘*Ó Ø#&Ð�c˜D‘jÓ&Ø#'€O�T˜D‘[Ó'Ø#(€O�T˜D‘[Ó(ØADÁeÈEÃlÐ@S€O�T˜%‘[ 5¨°¨Ñ#6Ñ6¸Ñ=ÓSØ'*Ð˜ ™Ó*Ø48€O�^ dÑ*¨TÑ1Ó8Ø €N�DÓ Ø€HˆdÓõ(ð ñ
ó ð
÷qð qrF   r   N)rV   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úmodeling_rope_utilsr   Úutilsr   r   Ú__all__r=   rF   rD   Ú<module>ri      sY   ðñ  å .å 3Ý 1Ý #ð Ùðð ,ñôOqÐ"ó Oqóó ðOqðd ˆ/�rF   