§
    ‚Štj   ã                   ó”   — d dl Z 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 )é    N)Ústricté   )ÚPreTrainedConfig)ÚRopeParameters)Úauto_docstringzopenbmb/MiniCPM3-4B)Ú
checkpointc            	       ó”  ‡ — e Zd ZU dZdZdgZd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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'<   d$Ze	dz  e
d(<   d!Zee
d)<   dZee z  dz  e
d*<   d+Z!ee
d,<   d-Z"e	ez  dz  e
d.<   d+Z#ee
d/<   dZ$e	dz  e
d0<   d1Z%e	e
d2<   d3Z&e	dz  e
d4<   d5Z'e	e
d6<   d7Z(e	e
d8<   dZ)e	dz  e
d9<   d:Z*e	ez  e
d;<   d<Z+e	ez  dz  e
d=<   d1Z,e	dz  e
d><   ˆ fd?„Z-d@„ Z.e/dAefdB„¦   «         Z0ˆ xZ1S )CÚMiniCPM3Configa‰  
    kv_lora_rank (`int`, *optional*, defaults to 256):
        Rank of the low-rank KV projection in multi-head latent attention.
    q_lora_rank (`int`, *optional*, defaults to 768):
        Rank of the low-rank query projection in multi-head latent attention. If `None`, the query projection
        is a single dense projection rather than a low-rank one.
    qk_nope_head_dim (`int`, *optional*, defaults to 64):
        Dimension of the non-RoPE part of each query/key head.
    qk_rope_head_dim (`int`, *optional*, defaults to 32):
        Dimension of the RoPE part of each query/key head.
    v_head_dim (`int`, *optional*):
        Dimension of each value head. If `None`, defaults to `hidden_size // num_attention_heads`.
    scale_emb (`int` or `float`, *optional*, defaults to 12):
        Multiplier applied to input embeddings.
    scale_depth (`int` or `float`, *optional*, defaults to 1.4):
        Multiplier for residual connections; the effective scaling is `scale_depth / sqrt(num_hidden_layers)`.
        If `None`, defaults to `sqrt(num_hidden_layers)` (no-op scaling).
    dim_model_base (`int`, *optional*, defaults to 256):
        Base model dimension used to scale logits before the language model head. If `None`,
        defaults to `hidden_size` (no-op scaling).

    Example:

    ```python
    >>> from transformers import MiniCPM3Model, MiniCPM3Config
    >>> # Initializing a MiniCPM3 style configuration
    >>> configuration = MiniCPM3Config()
    >>> # Initializing a model from the configuration
    >>> model = MiniCPM3Model(configuration)
    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    Úminicpm3Úpast_key_valuesÚcolwiseÚmla_kv_a_projÚrowwise)zlayers.*.self_attn.q_projzlayers.*.self_attn.q_b_projz%layers.*.self_attn.kv_a_proj_with_mqazlayers.*.self_attn.kv_b_projzlayers.*.self_attn.o_projzlayers.*.mlp.gate_projzlayers.*.mlp.up_projzlayers.*.mlp.down_projÚ	input_idsÚinputs_embedsÚhidden_statesÚattention_mask)Úembed_tokensÚlayersÚnormiè Ú
vocab_sizei 
  Úhidden_sizei   Úintermediate_sizeé>   Únum_hidden_layersé(   Únum_attention_headsNÚnum_key_value_headsÚsiluÚ
hidden_acti €  Úmax_position_embeddingsgš™™™™™¹?Úinitializer_rangegñhãˆµøä>Úrms_norm_epsTÚ	use_cacheÚpad_token_idé   Úbos_token_idé   Úeos_token_idÚpretraining_tpÚtie_word_embeddingsÚrope_parametersFÚattention_biasg        Úattention_dropoutÚmlp_biasÚhead_dimé   Úkv_lora_ranki   Úq_lora_ranké@   Úqk_nope_head_dimé    Úqk_rope_head_dimÚ
v_head_dimé   Ú	scale_embgffffffö?Úscale_depthÚdim_model_basec                 óT  •— | j         | _        | j        €| j        | j        z  | _        | j        €t          j        | j        ¦  «        | _        | j	        €| j        | _	        | j        €| j        | j        z  | _        | j
        €| j        | _
         t          ¦   «         j        di |¤Ž d S )N© )r7   r0   r8   r   r   r;   ÚmathÚsqrtr   r<   r   ÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €úq/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/minicpm3/configuration_minicpm3.pyrB   zMiniCPM3Config.__post_init__v   s¬   ø€ àÔ-ˆŒð Œ?Ð"Ø"Ô.°$Ô2JÑJˆDŒOØÔÐ#Ý#œy¨Ô)?Ñ@Ô@ˆDÔØÔÐ&Ø"&Ô"2ˆDÔØŒ=Ð Ø Ô,°Ô0HÑHˆDŒMØÔ#Ð+Ø'+Ô'?ˆDÔ$à�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'ó    c                 ól   — | j         | j        z  dk    r t          d| j         › d| j        › d�¦  «        ‚dS )zOPart of `@strict`-powered validation. Validates the architecture of the config.r   zThe hidden size (z6) is not a multiple of the number of attention heads (z).N)r   r   Ú
ValueError©rC   s    rF   Úvalidate_architecturez$MiniCPM3Config.validate_architectureˆ   s[   € àÔ˜dÔ6Ñ6¸!Ò;Ð;Ýð7 DÔ$4ð 7ð 7ØÔ2ð7ð 7ð 7ñô ð ð <Ð;rG   Úreturnc                 ó    — | j         | j        z  S )N)r   r<   rJ   s    rF   Úlogits_scalingzMiniCPM3Config.logits_scaling�   s   € ð Ô $Ô"5Ñ5Ð5rG   )2Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚkeys_to_ignore_at_inferenceÚbase_model_tp_planÚbase_model_pp_planr   ÚintÚ__annotations__r   r   r   r   r   r    Ústrr!   r"   Úfloatr#   r$   Úboolr%   r'   r)   Úlistr*   r+   r,   r   Údictr-   r.   r/   r0   r2   r3   r5   r7   r8   r:   r;   r<   rB   rK   ÚpropertyrN   Ú__classcell__)rE   s   @rF   r
   r
      s  ø€ € € € € € ð ð  ðD €JØ#4Ð"5Ðð &/Ø'0Ø1@Ø(1Ø%.Ø"+Ø )Ø"+ð	ð 	Ðð &˜¨Ð(9Ð:Ø#Ð%5Ð6¸Ð8IÐJØ!Ð" _Ð$5Ð6ðð Ðð €J�ÐÐÑØ€K�ÐÐÑØ!Ð�sÐ!Ð!Ñ!ØÐ�sÐÐÑØ!Ð˜Ð!Ð!Ñ!Ø&(Ð˜˜t™Ð(Ð(Ñ(Ø€J�ÐÐÑØ#(Ð˜SÐ(Ð(Ñ(Ø"Ð�uÐ"Ð"Ñ"Ø€L�%ÐÐÑØ€IˆtÐÐÑØ#€L�#˜‘*Ð#Ð#Ñ#Ø €L�#˜‘*Ð Ð Ñ Ø+,€L�#˜˜Sœ	‘/ DÑ(Ð,Ð,Ñ,Ø!"€N�C˜$‘JÐ"Ð"Ñ"Ø $Ð˜Ð$Ð$Ñ$Ø48€O�^ dÑ*¨TÑ1Ð8Ð8Ñ8Ø €N�DÐ Ð Ñ Ø,/Ð�s˜U‘{ TÑ)Ð/Ð/Ñ/Ø€HˆdÐÐÑØ€Hˆc�D‰jÐÐÑØ€L�#ÐÐÑØ!€K��t‘Ð!Ð!Ñ!ØÐ�cÐÐÑØÐ�cÐÐÑØ!€J��d‘
Ð!Ð!Ñ!Ø€Iˆs�U‰{ÐÐÑØ&)€K��u‘˜tÑ#Ð)Ð)Ñ)Ø!$€N�C˜$‘JÐ$Ð$Ñ$ð(ð (ð (ð (ð (ð$ð ð ð ð6 ð 6ð 6ð 6ñ „Xð6ð 6ð 6ð 6ð 6rG   r
   )r?   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úmodeling_rope_utilsr   Úutilsr   r
   Ú__all__r>   rG   rF   ú<module>re      s¿   ðð* €€€à .Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø #Ð #Ð #Ð #Ð #Ð #ð €Ð0Ð1Ñ1Ô1Øðs6ð s6ð s6ð s6ð s6Ð%ñ s6ô s6ñ „ñ 2Ô1ðs6ðl Ð
€€€rG   