§
    ‚Štj½  ã                   óŒ   — d dl m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 )é    )Ústricté   )ÚPreTrainedConfig)ÚRopeParameters)Úauto_docstringzMiniMaxAI/MiniMax-Text-01-hf)Ú
checkpointc                   óº  ‡ — e Zd ZU dZdZdgZdZdddddddd	œZd
gdgfddgdgfdgdgfdœZdddddœZ	ddi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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dz  ed+<   d,Zedz  ed-<   d.Zeee         z  dz  ed/<   d0Z eed1<   dZ!edz  ed2<   d3Z"eez  ed4<   d.Z#eed5<   dZ$eed<   d0Z%eed6<   d7Z&eed8<   d3Z'eed9<   dZ(e)e*z  dz  ed:<   dZ+ee         dz  ed;<   d<Z,eed=<   d,Z-eez  ed><   d,Z.eez  ed?<   d,Z/eez  ed@<   d,Z0eez  edA<   d,Z1eez  edB<   d,Z2eez  edC<   ˆ fdD„Z3ˆ xZ4S )EÚMiniMaxConfiga¡  
    block_size (`int`, *optional*, defaults to 256):
        The length of each attention block, determining how queries, keys, and values
        are grouped and processed for intra- and inter-block attention.
    full_attn_alpha_factor (`float`, *optional*, defaults to 1):
        Weight for residual value in residual connection after normal attention.
    full_attn_beta_factor (`float`, *optional*, defaults to 1):
        Weight for hidden state value in residual connection after normal attention.
    linear_attn_alpha_factor (`float`, *optional*, defaults to 1):
        Weight for residual value in residual connection after lightning attention.
    linear_attn_beta_factor (`float`, *optional*, defaults to 1):
        Weight for hidden state value in residual connection after lightning attention.
    mlp_alpha_factor (`float`, *optional*, defaults to 1):
        Weight for residual value in residual connection after MLP.
    mlp_beta_factor (`float`, *optional*, defaults to 1):
        Weight for hidden state value in residual connection after MLP.

    ```python
    >>> from transformers import MiniMaxModel, MiniMaxConfig

    >>> # Initializing a MiniMax style configuration
    >>> configuration = MiniMaxConfig()

    >>> # Initializing a model from the MiniMax style configuration
    >>> model = MiniMaxModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```ÚminimaxÚpast_key_valuesg    €„.AÚcolwiseÚrowwiseÚpacked_colwiseÚmoe_tp_experts)zlayers.*.self_attn.q_projzlayers.*.self_attn.k_projzlayers.*.self_attn.v_projzlayers.*.self_attn.o_projú!layers.*.mlp.experts.gate_up_projúlayers.*.mlp.experts.down_projúlayers.*.mlp.expertsÚ	input_idsÚinputs_embedsÚhidden_statesÚattention_mask)Úembed_tokensÚlayersÚnormÚ	ep_routerÚgrouped_gemm)zlayers.*.mlp.gater   r   r   Únum_expertsÚnum_local_expertsi }  Ú
vocab_sizei   Úhidden_sizei 8  Úintermediate_sizeé    Únum_hidden_layersÚnum_attention_headsé   Únum_key_value_headsNÚhead_dimÚsiluÚ
hidden_acti   Úmax_position_embeddingsg{®Gáz”?Úinitializer_rangegñhãˆµøä>Úrms_norm_epsTÚ	use_cacheÚpad_token_idé   Úbos_token_idé   Úeos_token_idFÚtie_word_embeddingsÚsliding_windowg        Úattention_dropoutÚnum_experts_per_tokÚoutput_router_logitsgü©ñÒMbP?Úrouter_aux_loss_coefÚrouter_jitter_noiseÚrope_parametersÚlayer_typesé   Ú
block_sizeÚfull_attn_alpha_factorÚfull_attn_beta_factorÚlinear_attn_alpha_factorÚlinear_attn_beta_factorÚmlp_alpha_factorÚmlp_beta_factorc                 ó´   •— | j         €| j        | _         | j        €#d„ t          | j        ¦  «        D ¦   «         | _         t          ¦   «         j        di |¤Ž d S )Nc                 ó@   — g | ]}t          |d z   dz  ¦  «        rdnd‘ŒS )r/   r1   Úfull_attentionÚlinear_attention)Úbool)Ú.0Úis     úo/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/minimax/configuration_minimax.pyú
<listcomp>z/MiniMaxConfig.__post_init__.<locals>.<listcomp>|   sA   € ð  ð  ð  ØRS¥D¨!¨a©%°1©Ñ$5Ô$5ÐMÐ Ð Ð;Mð ð  ð  ó    © )r&   r$   r;   Úranger#   ÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €rK   rQ   zMiniMaxConfig.__post_init__w   sr   ø€ ØÔ#Ð+Ø'+Ô'?ˆDÔ$àÔÐ#ð ð  ÝW\Ð]aÔ]sÑWtÔWtð ñ  ô  ˆDÔð 	�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'rM   )5Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚkeys_to_ignore_at_inferenceÚdefault_thetaÚbase_model_tp_planÚbase_model_pp_planÚbase_model_ep_planÚattribute_mapr   ÚintÚ__annotations__r    r!   r#   r$   r&   r'   r)   Ústrr*   r+   Úfloatr,   r-   rH   r.   r0   r2   Úlistr3   r4   r5   r6   r   r7   r8   r9   r:   r   Údictr;   r=   r>   r?   r@   rA   rB   rC   rQ   Ú__classcell__)rT   s   @rK   r
   r
      s<  ø€ € € € € € ðð ð< €JØ#4Ð"5ÐØ€Mà%.Ø%.Ø%.Ø%.Ø-=Ø*3Ø 0ðð Ðð &˜¨Ð(9Ð:Ø#Ð%5Ð6¸Ð8IÐJØ!Ð" _Ð$5Ð6ðð Ðð )Ø-;Ø*8Ø 0ð	ð Ðð #Ð$7Ð8€Mà€J�ÐÐÑØ€K�ÐÐÑØ"Ð�sÐ"Ð"Ñ"ØÐ�sÐÐÑØ!Ð˜Ð!Ð!Ñ!Ø Ð˜Ð Ð Ñ Ø€Hˆc�D‰jÐÐÑØ€J�ÐÐÑØ#,Ð˜SÐ,Ð,Ñ,Ø#Ð�uÐ#Ð#Ñ#Ø€L�%ÐÐÑØ€IˆtÐÐÑØ#€L�#˜‘*Ð#Ð#Ñ#Ø €L�#˜‘*Ð Ð Ñ Ø+,€L�#˜˜Sœ	‘/ DÑ(Ð,Ð,Ñ,Ø %Ð˜Ð%Ð%Ñ%Ø!%€N�C˜$‘JÐ%Ð%Ñ%Ø%(Ð�u˜s‘{Ð(Ð(Ñ(Ø Ð˜Ð Ð Ñ ØÐ�sÐÐÑØ!&Ð˜$Ð&Ð&Ñ&Ø"'Ð˜%Ð'Ð'Ñ'Ø!$Ð˜Ð$Ð$Ñ$Ø48€O�^ dÑ*¨TÑ1Ð8Ð8Ñ8Ø$(€K��c”˜TÑ!Ð(Ð(Ñ(Ø€J�ÐÐÑØ*+Ð˜C %™KÐ+Ð+Ñ+Ø)*Ð˜3 ™;Ð*Ð*Ñ*Ø,-Ð˜c E™kÐ-Ð-Ñ-Ø+,Ð˜S 5™[Ð,Ð,Ñ,Ø$%Ð�c˜E‘kÐ%Ð%Ñ%Ø#$€O�S˜5‘[Ð$Ð$Ñ$ð	(ð 	(ð 	(ð 	(ð 	(ð 	(ð 	(ð 	(ð 	(rM   r
   N)
Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úmodeling_rope_utilsr   Úutilsr   r
   Ú__all__rN   rM   rK   ú<module>rl      s¶   ðð* /Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø #Ð #Ð #Ð #Ð #Ð #ð €Ð9Ð:Ñ:Ô:Øðb(ð b(ð b(ð b(ð b(Ð$ñ b(ô b(ñ „ñ ;Ô:ðb(ðJ Ð
€€€rM   