+
    œ°³j•  ã                   ó  € ^ RI t ^ RIHt ^RIHt ^RIHt ^RIHt ^RI	H
t
HtHtHtHt ]! RR7      ] ! R	 R
]4      4       4       t ! R R]4      t ! R R]4      t ! R R]
4      t ! R R]4      t ! R R]4      t. ROtR# )é    N)Ústrict)ÚCache)Úauto_docstring)ÚGemma2Config)ÚGemma2AttentionÚGemma2DecoderLayerÚGemma2ForCausalLMÚ	Gemma2MLPÚGemma2RMSNormzgoogle/vaultgemma-1b)Ú
checkpointc                   ó(   € ] tR t^tRt]! 4       tRtR# )ÚVaultGemmaConfigaì  
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 VaultGemmaModel, VaultGemmaConfig
>>> # Initializing a VaultGemma vaultgemma-7b style configuration
>>> configuration = VaultGemmaConfig()
>>> # Initializing a model from the vaultgemma-7b style configuration
>>> model = VaultGemmaModel(configuration)
>>> # Accessing the model configuration
>>> configuration = model.config
```© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚAttributeErrorÚuse_bidirectional_attentionÚ__static_attributes__r   ó    Úr/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/vaultgemma/modular_vaultgemma.pyr   r      s   † ññ$ #1Ó"2Ôr   r   c                   ó   € ] tR t^1tRtR# )ÚVaultGemmaRMSNormr   N©r   r   r   r   r   r   r   r   r   r   1   ó   † Ûr   r   c                   ó   € ] tR t^5tRtR# )ÚVaultGemmaMLPr   Nr   r   r   r   r   r   5   r   r   r   c                   óB   a a€ ] tR t^9t oRtV3R lV 3R lltRtVtV ;t# )ÚVaultGemmaAttentionz=Multi-headed attention from 'Attention Is All You Need' paperc                ó&   <€ V ^8„  d   QhRS[ RS[/# )é   ÚconfigÚ	layer_idx)r   Úint)ÚformatÚ__classdict__s   "€r   Ú__annotate__Ú VaultGemmaAttention.__annotate__<   s   ø€ ÷ ñ Ñ/ð ¹Cñ r   c                ó2   <€ \         SV `  4        R V n        R# )TN)ÚsuperÚ__init__Ú	is_causal)Úselfr$   r%   Ú	__class__s   &&&€r   r-   ÚVaultGemmaAttention.__init__<   s   ø€ Ü‰ÑÔØˆŽr   )r.   )	r   r   r   r   r   r-   r   Ú__classdictcell__Ú__classcell__©r0   r(   s   @@r   r!   r!   9   s   ù‡ € ÙG÷÷ ó r   r!   c                   óH   a a€ ] tR t^At oV 3R ltRV3R lR lltRtVtV ;t# )ÚVaultGemmaDecoderLayerc                ó0   <€ \         SV `  ! R/ VB  V =V =R # )Nr   )r,   r-   Úpost_attention_layernormÚpost_feedforward_layernorm)r/   Úsuper_kwargsr0   s   &,€r   r-   ÚVaultGemmaDecoderLayer.__init__B   s   ø€ Ü‰ÒÑ(˜<Ò(ØÐ)ØÒ+r   c                óX  <€ V ^8„  d   QhRS[ P                  RS[S[ P                  S[ P                  3,          RS[ P                  R,          RS[ P                  R,          RS[R,          RS[S[ P
                  S[S[ P
                  S[ P
                  3,          R,          3,          /# )r#   Úhidden_statesÚposition_embeddingsÚattention_maskNÚposition_idsÚpast_key_valuesÚreturn)ÚtorchÚTensorÚtupleÚ
LongTensorr   ÚFloatTensor)r'   r(   s   "€r   r)   Ú#VaultGemmaDecoderLayer.__annotate__G   s¡   ø€ ÷ ñ á—|‘|ðñ #¡5§<¡<±·±Ð#=Õ>ðñ Ÿ™ tÕ+ð	ñ
 ×&Ñ&¨Õ-ðñ  �ðñ 
‰u× Ñ ¡%©×(9Ñ(9¹5×;LÑ;LÐ(LÕ"MÐPTÕ"TÐTÕ	Uñr   c                óÐ   € TpV P                  V4      pV P                  ! RR VRVRVRVRV/VB w  rWq,           pTpV P                  V4      pV P                  V4      pWq,           pV# )r=   r>   r?   r@   rA   r   )Úinput_layernormÚ	self_attnÚpre_feedforward_layernormÚmlp)	r/   r=   r>   r?   r@   rA   ÚkwargsÚresidualÚ_s	   &&&&&&,  r   ÚforwardÚVaultGemmaDecoderLayer.forwardG   s�   € ð !ˆØ×,Ñ,¨]Ó;ˆàŸ>š>ñ 
Ø'ð
à 3ð
ð *ð
ð &ð	
ð
 ,ð
ð ñ
Ñˆð !Õ0ˆà ˆØ×6Ñ6°}ÓEˆØŸ™ Ó/ˆØ Õ0ˆàÐr   r   )NNN)	r   r   r   r   r-   rQ   r   r2   r3   r4   s   @@r   r6   r6   A   s   ù‡ € õ,÷
÷ ò r   r6   c                   ó   € ] tR t^etRtR# )ÚVaultGemmaForCausalLMr   Nr   r   r   r   rT   rT   e   r   r   rT   )r   rT   ÚVaultGemmaModelÚVaultGemmaPreTrainedModel)rC   Úhuggingface_hub.dataclassesr   Úcache_utilsr   Úutilsr   Úgemma2.configuration_gemma2r   Úgemma2.modeling_gemma2r   r   r	   r
   r   r   r   r   r!   r6   rT   Ú__all__r   r   r   Ú<module>r]      s‹   ðó  Ý .å  Ý #Ý 6ß uÕ uñ Ð1Ô2Øô3�|ó 3ó ó 3ð3ô,	˜ô 	ô	�Iô 	ô˜/ô ô!Ð/ô !ôH	Ð-ô 	ò‚r   