Ë
    ÜÓ^jE  ã                   ó¸   — d dl m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
 e	d¬«      e G d„ de«      «       «       Zdd
gZy)é    )ÚAny)Ústricté   )ÚPreTrainedConfig)ÚRopeParameters)Úauto_docstringzgoogle/t5_gemma_module-7b)Ú
checkpointc                   ó   ‡ — e Zd ZU dZdZdg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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<   d Zee
d!<   d"Ze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
d0<   dZ#e	e
d1<   d2Z$e	d%z  e
d3<   d%Z%ee   d%z  e
d4<   d5Z&ed%z  e
d6<   d7Z'ed%z  e
d8<   d-Z(ee
d9<   ˆ fd:„Z)d;„ Z*ˆ xZ+S )<ÚT5GemmaModuleConfigaA  
    query_pre_attn_scalar (`float`, *optional*, defaults to 256):
        scaling factor used on the attention scores
    final_logit_softcapping (`float`, *optional*, defaults to 30.0):
        scaling factor when applying tanh softcapping on the logits.
    attn_logit_softcapping (`float`, *optional*, defaults to 50.0):
        scaling factor when applying tanh softcapping on the attention scores.

    ```python
    >>> from transformers import T5GemmaModuleModel, T5GemmaModuleConfig
    >>> # Initializing a T5GemmaModule t5_gemma_module-7b style configuration
    >>> configuration = T5GemmaModuleConfig()
    >>> # Initializing a model from the t5_gemma_module-7b style configuration
    >>> model = T5GemmaModuleModel(configuration)
    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Út5_gemma_moduleÚpast_key_valuesÚcolwiseÚrowwise)zlayers.*.self_attn.q_projzlayers.*.self_attn.k_projzlayers.*.self_attn.v_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Únormé è Ú
vocab_sizei 	  Úhidden_sizei $  Úintermediate_sizeé   Únum_hidden_layersé   Únum_attention_headsé   Únum_key_value_headsé   Úhead_dimÚgelu_pytorch_tanhÚhidden_activationi    Úmax_position_embeddingsg{®Gáz”?Úinitializer_rangeg�íµ ÷Æ°>Úrms_norm_epsTÚ	use_cacher   NÚpad_token_idé   Úeos_token_idé   Úbos_token_idÚtie_word_embeddingsÚrope_parametersFÚattention_biasç        Úattention_dropoutÚquery_pre_attn_scalari   Úsliding_windowÚlayer_typesg      >@Úfinal_logit_softcappingg      I@Úattn_logit_softcappingÚ
is_decoderc                 ó¼   •— | j                   €;t        | j                  «      D �cg c]  }t        |dz   dz  «      rdnd‘Œ c}| _         t	        ‰| �  di |¤Ž y c c}w )Nr*   r,   Úsliding_attentionÚfull_attention© )r5   Úranger   ÚboolÚsuperÚ__post_init__)ÚselfÚkwargsÚiÚ	__class__s      €ú|/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/t5gemma/configuration_t5gemma.pyr@   z!T5GemmaModuleConfig.__post_init___   s`   ø€ Ø×ÑÐ#äX]Ð^b×^tÑ^tÓXuö ØST¤t¨Q°©U°a©KÔ'8Ñ#Ð>NÑNò ˆDÔô 	‰ÑÑ' Ó'ùò	 s   ¥Ac                 óˆ   — | j                   | j                  z  dk7  r&t        d| j                   › d| j                  › d�«      ‚y)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)rA   s    rE   Úvalidate_architecturez)T5GemmaModuleConfig.validate_architectureg   sS   € à×Ñ˜d×6Ñ6Ñ6¸!Ò;ÜØ# D×$4Ñ$4Ð#5ð 6Ø×2Ñ2Ð3°2ð7óð ð <ó    ),Ú__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"   r$   Ústrr%   r&   Úfloatr'   r(   r>   r)   r+   Úlistr-   r.   r/   r   Údictr0   r2   r3   r4   r5   r6   r7   r8   r@   rH   Ú__classcell__©rD   s   @rE   r   r      sº  ø… ñð$ #€JØ#4Ð"5Ðà%.Ø%.Ø%.Ø%.Ø"+Ø )Ø"+ñÐð &˜¨Ð(9Ð:Ø#Ð%5Ð6¸Ð8IÐJØ!Ð" _Ð$5Ð6ñÐð €J�ÓØ€K�ÓØ!Ð�sÓ!ØÐ�sÓØ Ð˜Ó Ø Ð˜Ó Ø€HˆcÓØ0Ð�sÓ0Ø#'Ð˜SÓ'Ø#Ð�uÓ#Ø€L�%ÓØ€IˆtÓØ €L�#˜‘*Ó Ø+,€L�#˜˜S™	‘/ DÑ(Ó,Ø €L�#˜‘*Ó Ø $Ð˜Ó$Ø48€O�^ dÑ*¨TÑ1Ó8Ø €N�DÓ Ø,/Ð�s˜U‘{ TÑ)Ó/Ø!$Ð˜3Ó$Ø!%€N�C˜$‘JÓ%Ø$(€K��c‘˜TÑ!Ó(Ø,0Ð˜U T™\Ó0Ø+/Ð˜E D™LÓ/à€J�Óô(örI   r   c                   óæ   ‡ — e Zd ZU dZdZdgZeedœZdZee	e
e
f   z  dz  ed<   dZee	e
e
f   z  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Zeed<   dZeed<   ˆ fd„Zˆ xZS )ÚT5GemmaConfigaÈ  
    encoder (`Union[T5GemmaModuleConfig, dict]`, optional, *optional*):
        Configuration for the encoder.
    decoder (`Union[T5GemmaModuleConfig, dict]`, optional, *optional*):
        Configuration for the decoder.

    Example:

    ```python
    >>> from transformers import T5GemmaConfig, T5GemmaModel
    >>> t5gemma_config = T5GemmaConfig.from_pretrained("google/t5gemma-2b-2b-prefixlm-it")
    >>> model = T5GemmaModel(t5gemma_config)
    ```Út5gemmar   )ÚencoderÚdecoderNr]   r^   TÚis_encoder_decoderr1   Údropout_rateÚclassifier_dropout_rater2   r.   r   r   c                 óŒ  •— t        | j                  t        «      rt        di | j                  ¤Ž| _        n| j                  €t        «       | _        t        | j                  t        «      rt        di | j                  ¤Ž| _        n| j                  €t        «       | _        d| j                  _        | j                  | j                  _        | j                  | j                  _        d| j                  _        d| j                  _        | j                  | j                  _        | j                  | j                  _        | j                  j                  | j                  _
        |j                  d| j                  j                  «      | _        dD ]   }||vsŒt        | j                  |«      ||<   Œ" t        ‰| �<  di |¤Ž y )NFTr&   )r-   r)   r+   r<   )Ú
isinstancer]   rW   r   r^   r8   r`   r2   r(   r   Úcross_attention_hidden_sizeÚpopr&   Úgetattrr?   r@   )rA   rB   Úspecial_token_keyrD   s      €rE   r@   zT5GemmaConfig.__post_init__Ž   sP  ø€ Ü�d—l‘l¤DÔ)Ü.Ñ>°·±Ñ>ˆD�LØ�\‰\Ð!Ü.Ó0ˆDŒLä�d—l‘l¤DÔ)Ü.Ñ>°·±Ñ>ˆD�LØ�\‰\Ð!Ü.Ó0ˆDŒLà"'ˆ�‰ÔØ$(×$5Ñ$5ˆ�‰Ô!Ø)-×)?Ñ)?ˆ�‰Ô&à"&ˆ�‰ÔØ!%ˆ�‰ÔØ$(×$5Ñ$5ˆ�‰Ô!Ø)-×)?Ñ)?ˆ�‰Ô&Ø37·<±<×3KÑ3Kˆ�‰Ô0à!'§¡Ð,?ÀÇÁ×A_ÑA_Ó!`ˆÔà!Qò 	UÐØ ¨Ò.Ü,3°D·L±LÐBSÓ,T�Ð(Ò)ð	Uô 	‰ÑÑ' Ó'rI   )rJ   rK   rL   rM   rN   rO   r   Úsub_configsr]   rW   r   rS   r^   r_   r>   r`   rR   rU   ra   r2   r.   r   r@   rX   rY   s   @rE   r[   r[   p   s³   ø… ñð €JØ#4Ð"5ÐØ1Ð>QÑR€Kà;?€GÐ  4¨¨S¨¡>Ñ1°DÑ8Ó?Ø;?€GÐ  4¨¨S¨¡>Ñ1°DÑ8Ó?Ø#Ð˜Ó#Ø #€L�#˜‘+Ó#Ø+.Ð˜S 5™[Ó.Ø%(Ð�u˜s‘{Ó(Ø $Ð˜Ó$Ø€J�Ó÷(ð (rI   r[   N)Útypingr   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úmodeling_rope_utilsr   Úutilsr   r   r[   Ú__all__r<   rI   rE   ú<module>ro      s|   ðõ* å .å 3Ý 1Ý #ñ Ð6Ô7ØôMÐ*ó Mó ó 8ðMñ` Ð6Ô7Øô7(Ð$ó 7(ó ó 8ð7(ðt Ð1Ð
2�rI   