+
    œ°³j ã                   óä  € R t ^ RIt^ RIt^ RIHt ^ RIt^ RIHt ^ RIHtH	t	H
t
 ^RIHt ^RIHt ^RIHtHtHt ^RIHt ^R	IHtHt ^R
IHt ^RIHtHtHtHtH t H!t!H"t" ^RI#H$t$H%t% ^RI&H't' ^RI(H)t)H*t*H+t+H,t,H-t-H.t. ^RI/H0t0H1t1 ^RI2H3t3H4t4 ^RI5H6t6 ]-Pn                  ! ]84      t9 ! R R]Pt                  4      t; ! R R]Pt                  4      t< ! R R]Pt                  4      t= ! R R]Pt                  4      t>R9R R llt? ! R R]Pt                  4      t@ ! R R]Pt                  4      tA ! R  R!]Pt                  4      tB ! R" R#]4      tC ! R$ R%]Pt                  4      tD], ! R& R']%4      4       tE ! R( R)]E4      tF], ! R* R+]E4      4       tG],! R,R-7       ! R. R/]E]4      4       tH], ! R0 R1]E4      4       tI],! R2R-7       ! R3 R4]E4      4       tJ], ! R5 R6]E4      4       tK], ! R7 R8]E4      4       tL. R:OtMR# );zPyTorch T5 model.N)ÚCallable)Únn)ÚBCEWithLogitsLossÚCrossEntropyLossÚMSELoss)Úinitialization)ÚACT2FN)ÚCacheÚDynamicCacheÚEncoderDecoderCache)ÚGenerationMixin)Úcreate_bidirectional_maskÚcreate_causal_mask)ÚGradientCheckpointingLayer)ÚBaseModelOutputÚ)BaseModelOutputWithPastAndCrossAttentionsÚSeq2SeqLMOutputÚSeq2SeqModelOutputÚ#Seq2SeqQuestionAnsweringModelOutputÚSeq2SeqSequenceClassifierOutputÚTokenClassifierOutput)ÚALL_ATTENTION_FUNCTIONSÚPreTrainedModel)ÚUnpack)ÚDUMMY_INPUTSÚ
DUMMY_MASKÚTransformersKwargsÚauto_docstringÚloggingÚtorch_compilable_check)Úcan_return_tupleÚmerge_with_config_defaults)ÚOutputRecorderÚcapture_outputs©ÚT5Configc                   ó<   a a€ ] tR t^2t oRV 3R lltR tRtVtV ;t# )ÚT5LayerNormc                óŽ   <€ \         SV `  4        \        P                  ! \        P
                  ! V4      4      V n        W n        R# )zS
Construct a layernorm module in the T5 style. No bias and no subtraction of mean.
N)ÚsuperÚ__init__r   Ú	ParameterÚtorchÚonesÚweightÚvariance_epsilon)ÚselfÚhidden_sizeÚepsÚ	__class__s   &&&€Úc/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/t5/modeling_t5.pyr*   ÚT5LayerNorm.__init__3   s/   ø€ ô 	‰ÑÔÜ—l’l¤5§:¢:¨kÓ#:Ó;ˆŒØ #Öó    c                ó¼  € VP                  \        P                  4      P                  ^4      P	                  RRR7      pV\        P
                  ! W P                  ,           4      ,          pV P                  P                  \        P                  \        P                  39   d&   VP                  V P                  P                  4      pV P                  V,          # )é   T)Úkeepdiméÿÿÿÿ)Útor,   Úfloat32ÚpowÚmeanÚrsqrtr/   r.   ÚdtypeÚfloat16Úbfloat16)r0   Úhidden_statesÚvariances   && r4   ÚforwardÚT5LayerNorm.forward;   s™   € ð !×#Ñ#¤E§M¡MÓ2×6Ñ6°qÓ9×>Ñ>¸rÈ4Ð>ÓPˆØ%¬¯ª°H×?TÑ?TÕ4TÓ(UÕUˆð �;‰;×Ñ¤§¡´·±Ð ?Ô?Ø)×,Ñ,¨T¯[©[×->Ñ->Ó?ˆMà�{‰{˜]Õ*Ð*r6   )r/   r.   )g�íµ ÷Æ°>©	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r*   rE   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©r3   Ú__classdict__s   @@r4   r'   r'   2   s   ù‡ € ÷$÷+ò +r6   r'   c                   óD   a a€ ] tR t^Kt oV3R lV 3R lltR tRtVtV ;t# )ÚT5DenseActDensec                ó    <€ V ^8„  d   QhRS[ /# ©r8   Úconfigr$   )ÚformatrP   s   "€r4   Ú__annotate__ÚT5DenseActDense.__annotate__L   s   ø€ ÷ /ñ /™xñ /r6   c                ón  <€ \         SV `  4        \        P                  ! VP                  VP
                  R R7      V n        \        P                  ! VP
                  VP                  R R7      V n        \        P                  ! VP                  4      V n
        \        VP                  ,          V n        R# ©F©ÚbiasN)r)   r*   r   ÚLinearÚd_modelÚd_ffÚwiÚwoÚDropoutÚdropout_rateÚdropoutr   Údense_act_fnÚact©r0   rU   r3   s   &&€r4   r*   ÚT5DenseActDense.__init__L   sn   ø€ Ü‰ÑÔÜ—)’)˜FŸN™N¨F¯K©K¸eÔDˆŒÜ—)’)˜FŸK™K¨¯©¸eÔDˆŒÜ—z’z &×"5Ñ"5Ó6ˆŒÜ˜&×-Ñ-Õ.ˆŽr6   c                ó  € V P                  V4      pV P                  V4      pV P                  V4      p\        V P                  P
                  \        P                  4      '       d’   VP                  V P                  P
                  P                  8w  dc   V P                  P
                  P                  \        P                  8w  d0   VP                  V P                  P
                  P                  4      pV P	                  V4      pV# ©N)r`   rf   rd   Ú
isinstancera   r.   r,   ÚTensorr@   Úint8r;   ©r0   rC   s   &&r4   rE   ÚT5DenseActDense.forwardS   s­   € ØŸ™ Ó.ˆØŸ™ Ó/ˆØŸ™ ]Ó3ˆä�t—w‘w—~‘~¤u§|¡|×4Ò4Ø×#Ñ# t§w¡w§~¡~×';Ñ';Ô;Ø—‘—‘×$Ñ$¬¯
©
Ô2à)×,Ñ,¨T¯W©W¯^©^×-AÑ-AÓBˆMØŸ™ Ó.ˆØÐr6   )rf   rd   r`   ra   rG   rO   s   @@r4   rR   rR   K   s   ù‡ € ÷/ó /÷ò r6   rR   c                   óD   a a€ ] tR t^at oV3R lV 3R lltR tRtVtV ;t# )ÚT5DenseGatedActDensec                ó    <€ V ^8„  d   QhRS[ /# rT   r$   )rV   rP   s   "€r4   rW   Ú!T5DenseGatedActDense.__annotate__b   s   ø€ ÷ /ñ /™xñ /r6   c                óÒ  <€ \         SV `  4        \        P                  ! VP                  VP
                  R R7      V n        \        P                  ! VP                  VP
                  R R7      V n        \        P                  ! VP
                  VP                  R R7      V n        \        P                  ! VP                  4      V n        \        VP                  ,          V n        R# rZ   )r)   r*   r   r]   r^   r_   Úwi_0Úwi_1ra   rb   rc   rd   r   re   rf   rg   s   &&€r4   r*   ÚT5DenseGatedActDense.__init__b   sŠ   ø€ Ü‰ÑÔÜ—I’I˜fŸn™n¨f¯k©kÀÔFˆŒ	Ü—I’I˜fŸn™n¨f¯k©kÀÔFˆŒ	Ü—)’)˜FŸK™K¨¯©¸eÔDˆŒÜ—z’z &×"5Ñ"5Ó6ˆŒÜ˜&×-Ñ-Õ.ˆŽr6   c                óF  € V P                  V P                  V4      4      pV P                  V4      pW#,          pV P                  V4      p\	        V P
                  P                  \        P                  4      '       d’   VP                  V P
                  P                  P                  8w  dc   V P
                  P                  P                  \        P                  8w  d0   VP                  V P
                  P                  P                  4      pV P                  V4      pV# rj   )rf   ru   rv   rd   rk   ra   r.   r,   rl   r@   rm   r;   )r0   rC   Úhidden_geluÚhidden_linears   &&  r4   rE   ÚT5DenseGatedActDense.forwardj   sÀ   € Ø—h‘h˜tŸy™y¨Ó7Ó8ˆØŸ	™	 -Ó0ˆØ#Õ3ˆØŸ™ ]Ó3ˆô �t—w‘w—~‘~¤u§|¡|×4Ò4Ø×#Ñ# t§w¡w§~¡~×';Ñ';Ô;Ø—‘—‘×$Ñ$¬¯
©
Ô2à)×,Ñ,¨T¯W©W¯^©^×-AÑ-AÓBˆMàŸ™ Ó.ˆØÐr6   )rf   rd   ru   rv   ra   rG   rO   s   @@r4   rq   rq   a   s   ù‡ € ÷/ó /÷ò r6   rq   c                   óD   a a€ ] tR t^~t oV3R lV 3R lltR tRtVtV ;t# )Ú	T5LayerFFc                ó    <€ V ^8„  d   QhRS[ /# rT   r$   )rV   rP   s   "€r4   rW   ÚT5LayerFF.__annotate__   s   ø€ ÷ 7ñ 7™xñ 7r6   c                ó   <€ \         SV `  4        VP                  '       d   \        V4      V n        M\        V4      V n        \        VP                  VP                  R 7      V n	        \        P                  ! VP                  4      V n        R# )©r2   N)r)   r*   Úis_gated_actrq   ÚDenseReluDenserR   r'   r^   Úlayer_norm_epsilonÚ
layer_normr   rb   rc   rd   rg   s   &&€r4   r*   ÚT5LayerFF.__init__   sb   ø€ Ü‰ÑÔØ××ÐÜ"6°vÓ">ˆDÕä"1°&Ó"9ˆDÔä% f§n¡n¸&×:SÑ:SÔTˆŒÜ—z’z &×"5Ñ"5Ó6ˆŽr6   c                óx   € V P                  V4      pV P                  V4      pWP                  V4      ,           pV# rj   )r…   rƒ   rd   )r0   rC   Úforwarded_statess   && r4   rE   ÚT5LayerFF.forward‰   s;   € ØŸ?™?¨=Ó9ÐØ×.Ñ.Ð/?Ó@ÐØ%¯©Ð5EÓ(FÕFˆØÐr6   )rƒ   rd   r…   rG   rO   s   @@r4   r}   r}   ~   s   ù‡ € ÷7ó 7÷ò r6   r}   c                ó<  € V ^8„  d   QhR\         P                  R\        P                  R\        P                  R\        P                  R\        P                  R,          R\        R,          R\        R	\        P                  R,          R
\
        \        ,          /	# )r8   ÚmoduleÚqueryÚkeyÚvalueÚattention_maskNÚscalingrd   Úposition_biasÚkwargs)r   ÚModuler,   rl   Úfloatr   r   )rV   s   "r4   rW   rW   �   sŽ   € ÷ %ñ %Ü�I‰Ið%ä�<‰<ð%ô 
�‰ð%ô �<‰<ð	%ô
 —L‘L 4Õ'ð%ô �T�\ð%ô ð%ô —<‘< $Õ&ð%ô Ô'Õ(ñ%r6   c                 óÎ  € Vf   VP                  R4      R,          p\        P                  ! WP                  ^^4      4      V,          p	Ve	   W—,           p	Ve	   W”,           p	\        P
                  P                  V	RR7      p	\        P
                  P                  W–V P                  R7      p	\        P                  ! W“4      p
V
P                  ^^4      P                  4       p
W©3# )N©Údim)ÚpÚtrainingr:   ç      à¿)
Úsizer,   ÚmatmulÚ	transposer   Ú
functionalÚsoftmaxrd   r™   Ú
contiguous)r‹   rŒ   r�   rŽ   r�   r�   rd   r‘   r’   Úattn_weightsÚattn_outputs   &&&&&&&&,  r4   Úeager_attention_forwardr£   �   s¿   € ð ‚Ø—*‘*˜R“. DÕ(ˆô —<’< §}¡}°Q¸Ó':Ó;¸gÕE€LàÒ Ø#Õ3ˆàÒ!Ø#Õ4ˆä—=‘=×(Ñ(¨¸2Ð(Ó>€LÜ—=‘=×(Ñ(¨È6Ï?É?Ð(Ó[€Lä—,’,˜|Ó3€KØ×'Ñ'¨¨1Ó-×8Ñ8Ó:€KàÐ$Ð$r6   c                   óv   a a€ ] tR t^°t oRV3R lV 3R lllt]R	R l4       tR
R ltRV3R lR lltRt	Vt
V ;t# )ÚT5Attentionc                ó:   <€ V ^8„  d   QhRS[ RS[R,          RS[/# )r8   rU   Ú	layer_idxNÚ	is_causal)r%   ÚintÚbool)rV   rP   s   "€r4   rW   ÚT5Attention.__annotate__±   s-   ø€ ÷ %,ñ %,áð%,ñ ˜•:ð	%,ñ
 ñ%,r6   c                ó<  <€ \         SV `  4        Wn        VP                  V n        W@n        W n        VP                  V n        VP                  V n        VP                  V n        VP                  V n
        VP                  V n        VP                  V n        V P                  V P                  ,          V n        R V n        W0n        Vf@   V P                  '       d.   \$        P'                  RV P(                  P*                   R24       \,        P.                  ! V P                  V P                  RR7      V n        \,        P.                  ! V P                  V P                  RR7      V n        \,        P.                  ! V P                  V P                  RR7      V n        \,        P.                  ! V P                  V P                  RR7      V n        V P
                  '       d1   \,        P8                  ! V P                  V P                  4      V n        RV n        R# )ç      ð?NzInstantiating a decoder z³ without passing `layer_idx` is not recommended and will to errors during the forward call, if caching is used. Please make sure to provide a `layer_idx` when creating this class.Fr[   )r)   r*   rU   Ú
is_decoderr¨   Úhas_relative_attention_biasÚrelative_attention_num_bucketsÚrelative_attention_max_distancer^   Úd_kvÚkey_value_proj_dimÚ	num_headsÚn_headsrc   rd   Ú	inner_dimr�   r§   ÚloggerÚwarning_oncer3   rH   r   r]   ÚqÚkÚvÚoÚ	EmbeddingÚrelative_attention_biasÚgradient_checkpointing)r0   rU   r¯   r§   r¨   r3   s   &&&&&€r4   r*   ÚT5Attention.__init__±   s{  ø€ ô 	‰ÑÔØŒØ ×+Ñ+ˆŒØ"ŒØ+FÔ(Ø.4×.SÑ.SˆÔ+Ø/5×/UÑ/UˆÔ,Ø—~‘~ˆŒØ"(§+¡+ˆÔØ×'Ñ'ˆŒØ×*Ñ*ˆŒØŸ™¨×(?Ñ(?Õ?ˆŒàˆŒØ"ŒØÒ §§ Ü×ÑØ*¨4¯>©>×+BÑ+BÐ*Cð D,ð ,ôô —’˜4Ÿ<™<¨¯©¸eÔDˆŒÜ—’˜4Ÿ<™<¨¯©¸eÔDˆŒÜ—’˜4Ÿ<™<¨¯©¸eÔDˆŒÜ—’˜4Ÿ>™>¨4¯<©<¸eÔDˆŒà×+×+Ð+Ü+-¯<ª<¸×8[Ñ8[Ð]a×]iÑ]iÓ+jˆDÔ(à&+ˆÖ#r6   c                óÄ  € ^ pV'       dP   V^,          pW@^ 8„  P                  \        P                  4      V,          ,          p\        P                  ! V 4      p M,\        P                  ! V \        P
                  ! V 4      4      ) p V^,          pW8  pV\        P                  ! V P                  4       V,          4      \        P                  ! W5,          4      ,          W%,
          ,          P                  \        P                  4      ,           p\        P                  ! V\        P                  ! Wr^,
          4      4      pV\        P                  ! W`V4      ,          pV# )aR  
Adapted from Mesh Tensorflow:
https://github.com/tensorflow/mesh/blob/0cb87fe07da627bf0b7e60475d59f95ed6b5be3d/mesh_tensorflow/transformer/transformer_layers.py#L593

Translate relative position to a bucket number for relative attention. The relative position is defined as
memory_position - query_position, i.e. the distance in tokens from the attending position to the attended-to
position. If bidirectional=False, then positive relative positions are invalid. We use smaller buckets for
small absolute relative_position and larger buckets for larger absolute relative_positions. All relative
positions >=max_distance map to the same bucket. All relative positions <=-max_distance map to the same bucket.
This should allow for more graceful generalization to longer sequences than the model has been trained on

Args:
    relative_position: an int32 Tensor
    bidirectional: a boolean - whether the attention is bidirectional
    num_buckets: an integer
    max_distance: an integer

Returns:
    a Tensor with the same shape as relative_position, containing int32 values in the range [0, num_buckets)
)r;   r,   ÚlongÚabsÚminÚ
zeros_likeÚlogr”   ÚmathÚ	full_likeÚwhere)Úrelative_positionÚbidirectionalÚnum_bucketsÚmax_distanceÚrelative_bucketsÚ	max_exactÚis_smallÚrelative_position_if_larges   &&&&    r4   Ú_relative_position_bucketÚ%T5Attention._relative_position_bucketØ   s  € ð, ÐßØ˜AÕˆKØ°QÑ!6× :Ñ :¼5¿:¹:Ó FÈÕ TÕTÐÜ %§	¢	Ð*;Ó <Ñä!&§¢Ð+<¼e×>NÒ>NÐO`Ó>aÓ!bÐ bÐð   1Õ$ˆ	Ø$Ñ0ˆð &/Ü�IŠIÐ'×-Ñ-Ó/°)Õ;Ó<Ü�hŠh�|Õ/Ó0õ1àÕ&õ(÷ ‰"ŒU�Z‰Z‹.õ	&Ð"ô
 &+§Y¢YØ&¬¯ªÐ8RÐbcÕTcÓ(dó&
Ð"ð 	œEŸKšK¨ÐE_Ó`Õ`ÐØÐr6   c                óú  € Vf!   V P                   P                  P                  p\        P                  ! V\        P
                  VR7      R,          V,           p\        P                  ! V\        P
                  VR7      R,          pWe,
          pV P                  VV P                  '       * V P                  V P                  R7      pV P                  V4      p	V	P                  . RO4      P                  ^ 4      p	V	# )z%Compute binned relative position bias)r@   Údevice)rË   rÌ   rÍ   )ºNNNN)NrÖ   )r8   é    é   )r¾   r.   rÕ   r,   ÚarangerÂ   rÒ   r®   r°   r±   ÚpermuteÚ	unsqueeze)
r0   Úquery_lengthÚ
key_lengthrÕ   Úpast_seen_tokensÚcontext_positionÚmemory_positionrÊ   Úrelative_position_bucketÚvaluess
   &&&&&     r4   Úcompute_biasÚT5Attention.compute_bias  sÍ   € àŠ>Ø×1Ñ1×8Ñ8×?Ñ?ˆFÜ Ÿ<š<¨¼E¿J¹JÈvÔVÐW^Õ_ÐbrÕrÐÜŸ,š, z¼¿¹ÈFÔSÐT[Õ\ˆØ+Õ>ÐØ#'×#AÑ#AØØ#Ÿ™Ô.Ø×;Ñ;Ø×=Ñ=ð	 $Bó $
Ð ð ×-Ñ-Ð.FÓGˆØ—‘¢	Ó*×4Ñ4°QÓ7ˆØˆr6   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# ©r8   r’   ©r   r   )rV   rP   s   "€r4   rW   r«     s    ø€ ÷ X8ñ X8ñ Ñ+Õ,ñX8r6   c           	     óp  € VP                   RR
 p. VOR
NV P                  N5pVe   VP                  V P                  4      M^ p	\	        V	\
        P                  4      '       d   V	P                  4       MT	p	VRJp
V P                  V4      P                  V4      P                  ^^4      pRp\	        V\        4      '       dH   VP                  P                  V P                  4      pV
'       d   VP                  pMVP                  pMTpV
'       d   TMTpV
'       d\   VeX   V'       dP   VP                   V P                  ,          P"                  pVP                   V P                  ,          P$                  pMÛ. VP                   RR
 OR
NV P                  N5pV P'                  V4      P                  V4      P                  ^^4      pV P)                  V4      P                  V4      P                  ^^4      pVeX   VP+                  VVV P                  4      w  ppV
'       d0   \	        V\        4      '       d   RVP                  V P                  &   Vfº   VP                   R,          pV P,                  '       go   \
        P.                  ! ^V P0                  V^,          V3VP2                  VP4                  R7      pV P6                  '       d   V P8                  '       d   RVn        M&V P=                  V^,          VVP2                  V	R7      p\>        P@                  ! V PB                  PD                  \F        4      pT! V VVVV3RV P8                  '       g   RMV PH                  RV PJ                  R	V/VB w  ppVPL                  ! . VOR
N5!  PO                  4       pV PQ                  V4      pVVV3# )zp
Self-attention (if key_value_states is None) or attention over source sentence (provided by key_value_states).
NFT)rÕ   r@   )rÕ   rÞ   rd   ç        r�   r‘   r:   éþÿÿÿ))Úshaper³   Úget_seq_lengthr§   rk   r,   rl   Úcloner¹   Úviewr�   r   Ú
is_updatedÚgetÚcross_attention_cacheÚself_attention_cacheÚlayersÚkeysrâ   rº   r»   Úupdater¯   Úzerosrµ   rÕ   r@   r¿   r™   Úrequires_gradrã   r   Úget_interfacerU   Ú_attn_implementationr£   rd   r�   Úreshaper    r¼   )r0   rC   ÚmaskÚkey_value_statesr‘   Úpast_key_valuesr’   Úinput_shapeÚhidden_shaperÞ   Úis_cross_attentionÚquery_statesrï   Úcurr_past_key_valuesÚcurrent_statesÚ
key_statesÚvalue_statesÚkv_shaperÝ   Úattention_interfacer¢   r¡   s   &&&&&&,               r4   rE   ÚT5Attention.forward  sY  € ð $×)Ñ)¨#¨2Ð.ˆØB˜ÐB bÐB¨$×*AÑ*AÑBˆØM\ÒMh˜?×9Ñ9¸$¿.¹.ÔIÐnoÐä7AÐBRÔTY×T`ÑT`×7aÒ7aÐ+×1Ñ1Ô3ÐgwÐð .°TÐ9Ðà—v‘v˜mÓ,×1Ñ1°,Ó?×IÑIÈ!ÈQÓOˆð ˆ
Ü�oÔ':×;Ò;Ø(×3Ñ3×7Ñ7¸¿¹ÓGˆJß!à'6×'LÑ'LÑ$à'6×'KÑ'KÑ$à#2Ð ç-?Ñ)À]ˆß /Ò"=Ç*à-×4Ñ4°T·^±^ÕD×IÑIˆJØ/×6Ñ6°t·~±~ÕF×MÑM‰LàP˜×-Ñ-¨c¨rÐ2ÐP°BÐP¸×8OÑ8OÑPˆHØŸ™ Ó/×4Ñ4°XÓ>×HÑHÈÈAÓNˆJØŸ6™6 .Ó1×6Ñ6°xÓ@×JÑJÈ1ÈaÓPˆLàÒ*Ø+?×+FÑ+FÀzÐS_Ðae×aoÑaoÓ+pÑ(�
˜Lç%¬*°_ÔFY×*ZÒ*ZØAE�O×.Ñ.¨t¯~©~Ñ>ð Ò Ø#×)Ñ)¨"Õ-ˆJØ×3×3Ð3Ü %§¢Ø˜Ÿ™ k°!¥n°jÐAØ'×.Ñ.Ø&×,Ñ,ô!�ð
 ×.×.Ð.°4·=·=°=Ø26�MÔ/øà $× 1Ñ 1Ø •N J°|×7JÑ7JÐ]mð !2ó !�ô )@×(MÒ(MØ�K‰K×,Ñ,Ô.Eó)
Ðñ %8ØØØØØñ
%
ð  $Ÿ}Ÿ}˜}‘C°$·,±,ð
%
ð —L‘Lð
%
ð (ð
%
ð ñ
%
Ñ!ˆ�\ð "×)Ò)Ð;¨;Ð;¸Ó;×FÑFÓHˆØ—f‘f˜[Ó)ˆà˜M¨<Ð7Ð7r6   )rU   r^   rd   r¿   r¯   r¶   r¨   r®   rº   r³   r§   rµ   r¼   r¹   r¾   r±   r°   r�   r»   )FNF)Té    é€   )Nr×   ©NNNN)rH   rI   rJ   rK   r*   ÚstaticmethodrÒ   rã   rE   rL   rM   rN   rO   s   @@r4   r¥   r¥   °   s<   ù‡ € ÷%,õ %,ðN ó- ó ð- ô^÷"X8÷ X8ò X8r6   r¥   c                   óX   a a€ ] tR tRt oRV3R lV 3R llltRV3R lR lltRtVtV ;t# )	ÚT5LayerSelfAttentionit  c                ó.   <€ V ^8„  d   QhRS[ R,          /# ©r8   r§   N©r©   )rV   rP   s   "€r4   rW   Ú!T5LayerSelfAttention.__annotate__u  s   ø€ ÷ 	7ñ 	7ÉSÐSWÍZñ 	7r6   c                óö   <€ \         SV `  4        \        VVVVP                  R 7      V n        \        VP                  VP                  R7      V n        \        P                  ! VP                  4      V n        R# )©r¯   r§   r¨   r�   N)r)   r*   r¥   r®   ÚSelfAttentionr'   r^   r„   r…   r   rb   rc   rd   ©r0   rU   r¯   r§   r3   s   &&&&€r4   r*   ÚT5LayerSelfAttention.__init__u  s]   ø€ Ü‰ÑÔÜ(ØØ(CØØ×'Ñ'ô	
ˆÔô & f§n¡n¸&×:SÑ:SÔTˆŒÜ—z’z &×"5Ñ"5Ó6ˆŽr6   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# ræ   rç   )rV   rP   s   "€r4   rW   r  €  s   ø€ ÷ =ñ =ñ Ñ+Õ,ñ=r6   c           	     ó’   € V P                  V4      pV P                  ! V3R VRVRV/VB w  rspWP                  V4      ,           pWsV3# )rû   r‘   rý   )r…   r  rd   )	r0   rC   r�   r‘   rý   r’   Únormed_hidden_statesÚattention_outputr¡   s	   &&&&&,   r4   rE   ÚT5LayerSelfAttention.forward€  sr   € ð  $Ÿ™¨}Ó=ÐØ8<×8JÒ8JØ ñ9
àð9
ð (ð9
ð ,ð	9
ð
 ñ9
Ñ5Ð¨ð )¯<©<Ð8HÓ+IÕIÐØ°Ð<Ð<r6   )r  rd   r…   ©FN©NNNrG   rO   s   @@r4   r  r  t  s   ù‡ € ÷	7õ 	7÷=÷ =ò =r6   r  c                   óX   a a€ ] tR tRt oRV3R lV 3R llltRV3R lR lltRtVtV ;t# )	ÚT5LayerCrossAttentioni”  c                ó.   <€ V ^8„  d   QhRS[ R,          /# r  r  )rV   rP   s   "€r4   rW   Ú"T5LayerCrossAttention.__annotate__•  s   ø€ ÷ 7ñ 7©#°­*ñ 7r6   c                óâ   <€ \         SV `  4        \        VR VR R7      V n        \	        VP
                  VP                  R7      V n        \        P                  ! VP                  4      V n        R# )Fr  r�   N)r)   r*   r¥   ÚEncDecAttentionr'   r^   r„   r…   r   rb   rc   rd   )r0   rU   r§   r3   s   &&&€r4   r*   ÚT5LayerCrossAttention.__init__•  sU   ø€ Ü‰ÑÔÜ*Ø°ÀÐV[ô 
ˆÔô & f§n¡n¸&×:SÑ:SÔTˆŒÜ—z’z &×"5Ñ"5Ó6ˆŽr6   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# ræ   rç   )rV   rP   s   "€r4   rW   r"  �  s   ø€ ÷ 9ñ 9ñ Ñ+Õ,ñ9r6   c                ó–   € V P                  V4      pV P                  ! V3R VRVRVRV/VB w  r„p	WP                  V4      ,           p
W¤V	3# )rû   rü   r‘   rý   )r…   r$  rd   )r0   rC   rü   r�   r‘   rý   r’   r  r  r¡   Úlayer_outputs   &&&&&&,    r4   rE   ÚT5LayerCrossAttention.forward�  s{   € ð  $Ÿ™¨}Ó=ÐØ8<×8LÒ8LØ ñ9
àð9
ð .ð9
ð (ð	9
ð
 ,ð9
ð ñ9
Ñ5Ð¨ð %§|¡|Ð4DÓ'EÕEˆØ¨LÐ8Ð8r6   )r$  rd   r…   rj   r  rG   rO   s   @@r4   r   r   ”  s   ù‡ € ÷7õ 7÷9÷ 9ò 9r6   r   c                   óX   a a€ ] tR tRt oRV3R lV 3R llltRV3R lR lltRtVtV ;t# )	ÚT5Blocki³  c                ó.   <€ V ^8„  d   QhRS[ R,          /# r  r  )rV   rP   s   "€r4   rW   ÚT5Block.__annotate__´  s   ø€ ÷ 
-ñ 
-ÉSÐSWÍZñ 
-r6   c                ó|  <€ \         SV `  4        VP                  V n        \        P                  ! 4       V n        V P
                  P                  \        WVR 7      4       V P                  '       d&   V P
                  P                  \        WR7      4       V P
                  P                  \        V4      4       R# )©r¯   r§   )r§   N)
r)   r*   r®   r   Ú
ModuleListÚlayerÚappendr  r   r}   r  s   &&&&€r4   r*   ÚT5Block.__init__´  s   ø€ Ü‰ÑÔØ ×+Ñ+ˆŒÜ—]’]“_ˆŒ
Ø�
‰
×ÑÜ  ÐluÔvô	
ð �?�?ˆ?Ø�J‰J×ÑÔ3°FÔPÔQà�
‰
×Ñœ) FÓ+Ö,r6   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# ræ   rç   )rV   rP   s   "€r4   rW   r-  À  s    ø€ ÷ =Pñ =Pñ Ñ+Õ,ñ=Pr6   c                óÆ  € V P                   ^ ,          ! V3RVRVRV/VB w  rp
VP                  \        P                  8X  d«   \        P                  ! \        P
                  ! V4      P                  4       \        P                  ! VP                  4      P                  R,
          \        P                  ! VP                  4      P                  4      p\        P                  ! W) VR7      pRpV P                  ;'       d    VRJpV'       dï   V P                   ^,          ! V3RVRVRVRV/VB w  rp
VP                  \        P                  8X  d«   \        P                  ! \        P
                  ! V4      P                  4       \        P                  ! VP                  4      P                  R,
          \        P                  ! VP                  4      P                  4      p\        P                  ! W) VR7      pV P                   R,          ! V4      pVP                  \        P                  8X  d«   \        P                  ! \        P
                  ! V4      P                  4       \        P                  ! VP                  4      P                  R,
          \        P                  ! VP                  4      P                  4      p\        P                  ! W) VR7      pWV3# )	r×   r�   r‘   rý   iè  )rÄ   ÚmaxNrü   r:   )r1  r@   r,   rA   rÉ   ÚisinfÚanyÚfinfor6  Úclampr®   )r0   rC   r�   r‘   Úencoder_hidden_statesÚencoder_attention_maskÚencoder_decoder_position_biasrý   r’   Úself_attn_position_biasÚ_Úclamp_valueÚcross_attn_position_biasÚdo_cross_attentions   &&&&&&&&,     r4   rE   ÚT5Block.forwardÀ  sP  € ð 59·J±J¸q¶MØñ5
à)ð5
ð (ð5
ð ,ð	5
ð
 ñ5
Ñ1ˆ°ð ×Ñ¤%§-¡-Ô/ÜŸ+š+Ü—’˜MÓ*×.Ñ.Ó0Ü—’˜M×/Ñ/Ó0×4Ñ4°tÕ;Ü—’˜M×/Ñ/Ó0×4Ñ4óˆKô
 "ŸKšK¨¸<È[ÔYˆMà#'Ð Ø!Ÿ_™_×RÐRÐ1FÈdÐ1RÐßØ9=¿¹ÀA¾Øñ:à!6ð:ð  6ð:ð <ð	:ð
 !0ð:ð ñ:Ñ6ˆM°Qð ×"Ñ"¤e§m¡mÔ3Ü#ŸkškÜ—K’K Ó.×2Ñ2Ó4Ü—K’K × 3Ñ 3Ó4×8Ñ8¸4Õ?Ü—K’K × 3Ñ 3Ó4×8Ñ8ó�ô
 !&§¢¨M¸|ÐQ\Ô ]�ð Ÿ
™
 2ž }Ó5ˆð ×Ñ¤%§-¡-Ô/ÜŸ+š+Ü—’˜MÓ*×.Ñ.Ó0Ü—’˜M×/Ñ/Ó0×4Ñ4°tÕ;Ü—’˜M×/Ñ/Ó0×4Ñ4óˆKô
 "ŸKšK¨¸<È[ÔYˆMàÐ7OÐOÐOr6   )r®   r1  r  )NNNNNNrG   rO   s   @@r4   r+  r+  ³  s!   ù‡ € ÷
-õ 
-÷=P÷ =Pò =Pr6   r+  c                   óT   a a€ ] tR tRt oRtV3R lV 3R lltV3R lR ltRtVtV ;t	# )ÚT5ClassificationHeadi   z-Head for sentence-level classification tasks.c                ó    <€ V ^8„  d   QhRS[ /# rT   r$   )rV   rP   s   "€r4   rW   Ú!T5ClassificationHead.__annotate__  s   ø€ ÷ Eñ E™xñ Er6   c                ó0  <€ \         SV `  4        \        P                  ! VP                  VP                  4      V n        \        P                  ! VP                  R 7      V n        \        P                  ! VP                  VP                  4      V n
        R# ))r˜   N)r)   r*   r   r]   r^   Údenserb   Úclassifier_dropoutrd   Ú
num_labelsÚout_projrg   s   &&€r4   r*   ÚT5ClassificationHead.__init__  sZ   ø€ Ü‰ÑÔÜ—Y’Y˜vŸ~™~¨v¯~©~Ó>ˆŒ
Ü—z’z F×$=Ñ$=Ô>ˆŒÜŸ	š	 &§.¡.°&×2CÑ2CÓDˆŽr6   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# )r8   rC   Úreturn©r,   rl   )rV   rP   s   "€r4   rW   rG  	  s#   ø€ ÷ ñ ¡U§\¡\ð ±e·l±lñ r6   c                óº   € V P                  V4      pV P                  V4      p\        P                  ! V4      pV P                  V4      pV P	                  V4      pV# rj   )rd   rI  r,   ÚtanhrL  rn   s   &&r4   rE   ÚT5ClassificationHead.forward	  sN   € ØŸ™ ]Ó3ˆØŸ
™
 =Ó1ˆÜŸ
š
 =Ó1ˆØŸ™ ]Ó3ˆØŸ™ mÓ4ˆØÐr6   )rI  rd   rL  )
rH   rI   rJ   rK   Ú__doc__r*   rE   rL   rM   rN   rO   s   @@r4   rE  rE     s#   ù‡ € Ù7÷Eó E÷÷ ð r6   rE  c            
       óà   a a€ ] tR tRt oRtRtR.tR.tRtRt	Rt
RtR]! ]^ R7      R	]! ]RR7      R
]! ]RR7      /t]R 4       t]P(                  ! 4       V 3R l4       tR tV3R ltRtVtV ;t# )ÚT5PreTrainedModeli  ÚtransformerTr+  ra   FrC   )ÚindexÚ
attentionsÚcross_attentionsc                ó~   € \         P                  ! \        4      p\         P                  ! \        4      pR VRVRV/pV# )Údecoder_input_idsÚ	input_idsÚdecoder_attention_mask)r,   Útensorr   r   )r0   r]  Ú
input_maskÚdummy_inputss   &   r4   ra  ÚT5PreTrainedModel.dummy_inputs'  s<   € ä—L’L¤Ó.ˆ	Ü—\’\¤*Ó-ˆ
à Ø˜Ø$ jð
ˆð
 Ðr6   c                óÐ  <€ \         SV `  V4       V P                  P                  p\	        V\
        4      '       d+   \        P                  ! VP                  VR,          4       R# \	        V\        \        \        \        34      '       Ed%   \        P                  ! VP                  P                  RVR,          R7       \        VR4      '       dQ   V P                  P                   '       g5   \        P                  ! VP"                  P                  RVR,          R7       \        VR4      '       d{   \        P                  ! VP$                  P                  RW P                  P&                  R	,          ,          R7       \        P(                  ! VP$                  P*                  4       R# R# \	        V\,        4      '       du   \        VR4      '       da   \        P                  ! VP.                  P                  RVR,          R7       \        P(                  ! VP.                  P*                  4       R# R# \	        V\0        4      '       Ed_   \        P                  ! VP2                  P                  RW P                  P&                  R	,          ,          R7       \        VP2                  R4      '       dC   VP2                  P*                  e+   \        P(                  ! VP2                  P*                  4       \        P                  ! VP4                  P                  RW P                  P&                  R	,          ,          R7       \        VP4                  R4      '       dG   VP4                  P*                  e-   \        P(                  ! VP4                  P*                  4       R# R# R# \	        V\6        4      '       Ed_   \        P                  ! VP8                  P                  RW P                  P&                  R	,          ,          R7       \        VP8                  R4      '       dC   VP8                  P*                  e+   \        P(                  ! VP8                  P*                  4       \        P                  ! VP:                  P                  RW P                  P<                  R	,          ,          R7       \        VP:                  R4      '       dG   VP:                  P*                  e-   \        P(                  ! VP:                  P*                  4       R# R# R# \	        V\>        4      '       Ed   \        P                  ! VP@                  P                  RW P                  P&                  R	,          ,          R7       \        VP@                  R4      '       dC   VP@                  P*                  e+   \        P(                  ! VP@                  P*                  4       \        P                  ! VPB                  P                  RW P                  P&                  R	,          ,          R7       \        VPB                  R4      '       dC   VPB                  P*                  e+   \        P(                  ! VPB                  P*                  4       \        P                  ! VP:                  P                  RW P                  P<                  R	,          ,          R7       \        VP:                  R4      '       dG   VP:                  P*                  e-   \        P(                  ! VP:                  P*                  4       R# R# R# \	        V\D        4      '       Ed‰   V P                  P&                  pV P                  PF                  pV P                  PH                  p\        P                  ! VPJ                  P                  RW#V,          R	,          ,          R7       \        P                  ! VPL                  P                  RW#R	,          ,          R7       \        P                  ! VPN                  P                  RW#R	,          ,          R7       \        P                  ! VPP                  P                  RW%V,          R	,          ,          R7       VPR                  '       d=   \        P                  ! VPT                  P                  RW#R	,          ,          R7       R# R# R# )
zInitialize the weightsr­   ré   )r>   ÚstdÚlm_headÚ
qa_outputsÚ
classifierr\   Nrš   )+r)   Ú_init_weightsrU   Úinitializer_factorrk   r'   ÚinitÚ	constant_r.   ÚT5ModelÚT5ForConditionalGenerationÚT5EncoderModelÚT5ForQuestionAnsweringÚnormal_ÚsharedÚhasattrÚtie_word_embeddingsre  rf  r^   Úzeros_r\   ÚT5ForTokenClassificationrg  rE  rI  rL  rR   r`   ra   r_   rq   ru   rv   r¥   r²   r´   r¹   rº   r»   r¼   r¯   r¾   )r0   r‹   Úfactorr^   r³   rµ   r3   s   &&    €r4   rh  ÚT5PreTrainedModel._init_weights2  sc  ø€ ô 	‰Ñ˜fÔ%Ø—‘×/Ñ/ˆÜ�fœk×*Ò*Ü�NŠN˜6Ÿ=™=¨&°3­,Ö7ÜØÜÔ0´.ÔBXÐY÷
ó 
ô �LŠL˜Ÿ™×-Ñ-°C¸VÀc½\ÕJÜ�v˜y×)Ò)°$·+±+×2Q×2QÐ2QÜ—’˜VŸ^™^×2Ñ2¸À&È3Å,ÕOÜ�v˜|×,Ò,Ü—’˜V×.Ñ.×5Ñ5¸CÀV×P[ÑP[×PcÑPcÐhlÕOlÕEmÕnÜ—’˜F×-Ñ-×2Ñ2Ö3ñ -ô ˜Ô 8×9Ò9Ü�v˜|×,Ò,Ü—’˜V×.Ñ.×5Ñ5¸CÀVÈcÅ\ÕRÜ—’˜F×-Ñ-×2Ñ2Ö3ñ -ô ˜Ô 4×5Ó5Ü�LŠL˜Ÿ™×,Ñ,°3¸FÇ{Á{×GZÑGZÐ_cÕFcÕ<dÕeÜ�v—|‘| V×,Ò,°·±×1BÑ1BÒ1NÜ—’˜FŸL™L×-Ñ-Ô.Ü�LŠL˜Ÿ™×/Ñ/°c¸vÏ+É+×J]ÑJ]ÐbfÕIfÕ?gÕhÜ�v—‘¨×/Ò/°F·O±O×4HÑ4HÒ4TÜ—’˜FŸO™O×0Ñ0Ö1ñ 5UÑ/ä˜¤×0Ó0Ü�LŠL˜Ÿ™×)Ñ)°¸ÇKÁK×DWÑDWÐ\`ÕC`Õ9aÕbÜ�v—y‘y &×)Ò)¨f¯i©i¯n©nÒ.HÜ—’˜FŸI™IŸN™NÔ+Ü�LŠL˜Ÿ™×)Ñ)°¸ÇKÁK×DTÑDTÐY]ÕC]Õ9^Õ_Ü�v—y‘y &×)Ò)¨f¯i©i¯n©nÒ.HÜ—’˜FŸI™IŸN™NÖ+ñ /IÑ)ä˜Ô 4×5Ó5Ü�LŠL˜Ÿ™×+Ñ+°#¸6ÇkÁk×FYÑFYÐ^bÕEbÕ;cÕdÜ�v—{‘{ F×+Ò+°·±×0@Ñ0@Ò0LÜ—’˜FŸK™K×,Ñ,Ô-Ü�LŠL˜Ÿ™×+Ñ+°#¸6ÇkÁk×FYÑFYÐ^bÕEbÕ;cÕdÜ�v—{‘{ F×+Ò+°·±×0@Ñ0@Ò0LÜ—’˜FŸK™K×,Ñ,Ô-Ü�LŠL˜Ÿ™×)Ñ)°¸ÇKÁK×DTÑDTÐY]ÕC]Õ9^Õ_Ü�v—y‘y &×)Ò)¨f¯i©i¯n©nÒ.HÜ—’˜FŸI™IŸN™NÖ+ñ /IÑ)ä˜¤×,Ó,Ø—k‘k×)Ñ)ˆGØ!%§¡×!1Ñ!1ÐØ—k‘k×+Ñ+ˆGÜ�LŠL˜Ÿ™Ÿ™¨s¸ÐM_ÕC_ÐdhÕBhÕ8iÕjÜ�LŠL˜Ÿ™Ÿ™¨s¸È4Å-Õ8PÕQÜ�LŠL˜Ÿ™Ÿ™¨s¸È4Å-Õ8PÕQÜ�LŠL˜Ÿ™Ÿ™¨s¸ÐM_ÕC_ÐdhÕBhÕ8iÕjØ×1×1Ð1Ü—’˜V×;Ñ;×BÑBÈÐRXÐimÕ\mÕRn×oñ 2ñ -r6   c                ó>  € V P                   P                  pV P                   P                  pVf   \        R4      hVP	                  VP
                  4      pVRR R13,          P                  4       VR&   W$R&   Vf   \        R4      hVP                  VR8H  V4       V# )NzŠself.model.config.decoder_start_token_id has to be defined. In T5 it is usually set to the pad_token_id. See T5 docs for more information..z1self.model.config.pad_token_id has to be defined.r:   ).:rØ   NN).r×   éœÿÿÿ)rU   Údecoder_start_token_idÚpad_token_idÚ
ValueErrorÚ	new_zerosrë   rí   Úmasked_fill_)r0   r]  rz  r{  Úshifted_input_idss   &&   r4   Ú_shift_rightÚT5PreTrainedModel._shift_rightj  s§   € Ø!%§¡×!CÑ!CÐØ—{‘{×/Ñ/ˆà!Ò)Üð4óð ð
 &×/Ñ/°	·±Ó@ÐØ%.¨s°C°R°C¨xÕ%8×%>Ñ%>Ó%@Ð˜'Ñ"Ø$:˜&Ñ!àÒÜÐPÓQÐQà×&Ñ&Ð'8¸DÑ'@À,ÔOà Ð r6   c                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # rT   r$   )rV   rP   s   "€r4   rW   ÚT5PreTrainedModel.__annotate__  s   ø‡ ‚ áÑò r6   © r:   )rH   rI   rJ   rK   Úbase_model_prefixÚsupports_gradient_checkpointingÚ_no_split_modulesÚ_keep_in_fp32_modulesÚ_supports_flash_attnÚ_supports_flex_attnÚ_supports_sdpaÚ_can_compile_fullgraphr"   r+  r  r   Ú_can_record_outputsÚpropertyra  r,   Úno_gradrh  r€  Ú__annotate_func__rL   rM   rN   rO   s   @@r4   rV  rV    sª   ù‡ € ð &ÐØ&*Ð#à"˜ÐØ!˜FÐð !ÐØÐØ€NØ!Ðð 	™¨°qÔ9Ø‘nÐ%9ÀÔDØ™NÐ+@ÈÔKðÐð ñó ðð ‡]‚]ƒ_ô5pó ð5pòn!÷q … r6   rV  c                   ól   a a€ ] tR tRt oV 3R ltR t]]]RV3R lR ll4       4       4       t	Rt
VtV ;t# )ÚT5Stacki€  c                ó"  <€ \         SV `  V4       \        P                  ! VP                  VP
                  4      V n        VP                  V n        \        P                  ! \        VP                  4       Uu. uF  p\        V\        V^ 8H  4      VR7      NK  	  up4      V n        \        VP
                  VP                  R7      V n        \        P"                  ! VP$                  4      V n        V P)                  4        RV n        R# u upi )r×   r/  r�   FN)r)   r*   r   r½   Ú
vocab_sizer^   Úembed_tokensr®   r0  ÚrangeÚ
num_layersr+  rª   Úblockr'   r„   Úfinal_layer_normrb   rc   rd   Ú	post_initr¿   )r0   rU   Úir3   s   && €r4   r*   ÚT5Stack.__init__�  sÈ   ø€ Ü‰Ñ˜Ô äŸLšL¨×):Ñ):¸F¿N¹NÓKˆÔØ ×+Ñ+ˆŒä—]’]Ü]bÐci×ctÑctÔ]uÓvÑ]uÐXYŒW�V¼¸aÀ1¹f»ÐQR×SÑ]uÑvó
ˆŒ
ô !,¨F¯N©NÀ×@YÑ@YÔ ZˆÔÜ—z’z &×"5Ñ"5Ó6ˆŒð 	�‰ÔØ&+ˆÖ#ùò ws   Á9#Dc                ó   € Wn         R # rj   )r•  ©r0   Únew_embeddingss   &&r4   Úset_input_embeddingsÚT5Stack.set_input_embeddings‘  s   € Ø*Ör6   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# ræ   rç   )rV   rP   s   "€r4   rW   ÚT5Stack.__annotate__—  s    ø€ ÷ W
ñ W
ñ Ñ+Õ,ñW
r6   c           	     ó<  € VR J VR J,          '       d   \        R4      hVf   V P                  V4      pVRJ d"   V P                  '       g   \        RV  R24      hV P                  '       du   V'       dl   Vfh   V P                  P                  '       d6   \        \        V P                  R7      \        V P                  R7      4      pM+\        V P                  R7      pMV P                  '       g   R pV P                  P                  '       d=   \        V P                  TT\        V\
        4      '       d   VP                  MTR7      pM\        V P                  VVR7      pR p	V P                  '       d   Ve   \        V P                  VVVR7      p	R p
R pV P                  V4      pV P                   F4  pV! VVV
VV	V3R	V/VB w  rÎpTp
V P                  '       g   K,  Vf   K2  TpK6  	  V P                  V4      pV P                  V4      p\        VVR
7      # )Nz:You must specify exactly one of input_ids or inputs_embedsTz)`use_cache` can only be set to `True` if z is used as a decoder)rU   )rU   Úinputs_embedsr�   rý   )rU   r¥  r�   )rU   r¥  r�   r;  rý   )Úlast_hidden_staterý   )r|  r•  r®   rU   Úis_encoder_decoderr   r
   r   rk   rò   r   rd   r˜  r™  r   )r0   r]  r�   r;  r<  r¥  rý   Ú	use_cacher’   Úencoder_extended_attention_maskr‘   r=  rC   Úlayer_moduleÚself_attention_position_biasÚcross_attention_position_biass   &&&&&&&&,       r4   rE   ÚT5Stack.forward”  s  € ð ˜Ð -°tÐ";×<Ô<ÜÐYÓZÐZàÒ Ø ×-Ñ-¨iÓ8ˆMà˜ÓØ—?—?�?Ü Ð#LÈTÈFÐRgÐ!hÓiÐià�?�?ˆ?ß˜_Ò4Ø—;‘;×1×1Ð1Ü&9Ü$¨D¯K©KÔ8¼,ÈdÏkÉkÔ:Zó'‘Oô '3¸$¿+¹+Ô&F�OøØ——�ð #ˆOà�;‰;×!×!Ð!Ü/Ø—{‘{Ø+Ø-ä˜oÔ/B×CÒCð !0× DÒ Dà$ô‰Nô 7Ø—{‘{Ø+Ø-ôˆNð +/Ð'Ø�?�?ˆ?Ð4Ò@Ü.GØ—{‘{Ø+Ø5Ø&;ô	/Ð+ð ˆØ(,Ð%àŸ™ ]Ó3ˆà ŸJœJˆLÙYeØØØØ%Ø/Ø-ñ	Zð !0ð	Zð ñ	ZÑVˆMÐ9Vð 9ˆMØ��ŠÐ#8Ô#DØ0MÒ-ñ 'ð" ×-Ñ-¨mÓ<ˆØŸ™ ]Ó3ˆä8Ø+Ø+ô
ð 	
r6   )r˜  rd   r•  r™  r¿   r®   )NNNNNNN)rH   rI   rJ   rK   r*   r   r!   r#   r   rE   rL   rM   rN   rO   s   @@r4   r’  r’  €  sA   ù‡ € õ,ò +ð  ØØ÷W
ñ W
ó ó ó  ÷W
ð W
r6   r’  c                   ó†   a a€ ] tR tRt oR.tRRRR/tV3R lV 3R lltR tR	 t]	]
RV3R
 lR ll4       4       tRtVtV ;t# )rl  iñ  úFdecoder.block.0.layer.1.EncDecAttention.relative_attention_bias.weightúencoder.embed_tokens.weightúshared.weightúdecoder.embed_tokens.weightc                ó    <€ V ^8„  d   QhRS[ /# rT   r$   )rV   rP   s   "€r4   rW   ÚT5Model.__annotate__û  s   ø€ ÷ ñ ™xñ r6   c                óŠ  <€ \         SV `  V4       \        P                  ! VP                  VP
                  4      V n        \        P                  ! V4      pR Vn	        R Vn
        \        V4      V n        \        P                  ! V4      pRVn	        VP                  Vn        \        V4      V n        V P!                  4        R# ©FTN)r)   r*   r   r½   r”  r^   rq  ÚcopyÚdeepcopyr®   r¨  r’  ÚencoderÚnum_decoder_layersr—  Údecoderrš  ©r0   rU   Úencoder_configÚdecoder_configr3   s   &&  €r4   r*   ÚT5Model.__init__û  s’   ø€ Ü‰Ñ˜Ô Ü—l’l 6×#4Ñ#4°f·n±nÓEˆŒäŸš vÓ.ˆØ$)ˆÔ!Ø#(ˆÔ Ü˜~Ó.ˆŒäŸš vÓ.ˆØ$(ˆÔ!Ø$*×$=Ñ$=ˆÔ!Ü˜~Ó.ˆŒð 	�‰Ör6   c                ó   € V P                   # rj   ©rq  ©r0   s   &r4   Úget_input_embeddingsÚT5Model.get_input_embeddings  ó   € Ø�{‰{Ðr6   c                ó~   € Wn         V P                  P                  V4       V P                  P                  V4       R # rj   ©rq  r¹  r   r»  rž  s   &&r4   r   ÚT5Model.set_input_embeddings  ó+   € Ø$ŒØ�‰×)Ñ)¨.Ô9Ø�‰×)Ñ)¨.Ö9r6   c                ó–  <€ V ^8„  d   QhRS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[S[S[ P                  ,          ,          R,          RS[R,          RS[ P                  R,          R	S[ P                  R,          R
S[R,          RS[S[	,          RS[
/# )r8   r]  Nr�   r\  r^  Úencoder_outputsrý   r¥  Údecoder_inputs_embedsr¨  r’   rO  )r,   Ú
LongTensorÚFloatTensorÚ
BoolTensorÚtupler	   rl   rª   r   r   r   )rV   rP   s   "€r4   rW   r´    sç   ø€ ÷ d
ñ d
á×#Ñ# dÕ*ðd
ñ ×)Ñ)¨DÕ0ðd
ñ !×+Ñ+¨dÕ2ð	d
ñ
 !&× 0Ñ 0°4Õ 7ðd
ñ ™u¡U×%6Ñ%6Õ7Õ8¸4Õ?ðd
ñ  �ðd
ñ —|‘| dÕ*ðd
ñ  %Ÿ|™|¨dÕ2ðd
ñ ˜$•;ðd
ñ Ñ+Õ,ðd
ñ 
ñd
r6   c
                ó  € Vf   V P                   ! RRVRVRV/V
B pM]\        V\        4      '       gH   \        V^ ,          \        V4      ^8”  d
   V^,          MR\        V4      ^8”  d
   V^,          MRR7      pV^ ,          pV P                  ! RRVRVRVRVRVRVR	V	/V
B p\        VP                  VP                  VP                  VP                  VP                  VP                  VP                  VP                  R
7      # )a>	  
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
    Indices of input sequence tokens in the vocabulary. T5 is a model with relative position embeddings so you
    should be able to pad the inputs on both the right and the left.

    Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
    [`PreTrainedTokenizer.__call__`] for detail.

    [What are input IDs?](../glossary#input-ids)

    To know more on how to prepare `input_ids` for pretraining take a look a [T5 Training](./t5#training).
decoder_input_ids (`torch.LongTensor` of shape `(batch_size, target_sequence_length)`, *optional*):
    Indices of decoder input sequence tokens in the vocabulary.

    Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
    [`PreTrainedTokenizer.__call__`] for details.

    [What are decoder input IDs?](../glossary#decoder-input-ids)

    T5 uses the `pad_token_id` as the starting token for `decoder_input_ids` generation. If `past_key_values`
    is used, optionally only the last `decoder_input_ids` have to be input (see `past_key_values`).

    To know more on how to prepare `decoder_input_ids` for pretraining take a look at [T5
    Training](./t5#training).
decoder_attention_mask (`torch.BoolTensor` of shape `(batch_size, target_sequence_length)`, *optional*):
    Default behavior: generate a tensor that ignores pad tokens in `decoder_input_ids`. Causal mask will also
    be used by default.

Example:

```python
>>> from transformers import AutoTokenizer, T5Model

>>> tokenizer = AutoTokenizer.from_pretrained("google-t5/t5-small")
>>> model = T5Model.from_pretrained("google-t5/t5-small")

>>> input_ids = tokenizer(
...     "Studies have been shown that owning a dog is good for you", return_tensors="pt"
... ).input_ids  # Batch size 1
>>> decoder_input_ids = tokenizer("Studies show that", return_tensors="pt").input_ids  # Batch size 1

>>> # preprocess: Prepend decoder_input_ids with start token which is pad token for T5Model.
>>> # This is not needed for torch's T5ForConditionalGeneration as it does this internally using labels arg.
>>> decoder_input_ids = model._shift_right(decoder_input_ids)

>>> # forward pass
>>> outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)
>>> last_hidden_states = outputs.last_hidden_state
```Nr]  r�   r¥  ©r¦  rC   rY  rý   r;  r<  r¨  )r¦  rý   Údecoder_hidden_statesÚdecoder_attentionsrZ  Úencoder_last_hidden_stater;  Úencoder_attentionsr„  )r¹  rk   r   Úlenr»  r   r¦  rý   rC   rY  rZ  )r0   r]  r�   r\  r^  rË  rý   r¥  rÌ  r¨  r’   rC   Údecoder_outputss   &&&&&&&&&&,  r4   rE   ÚT5Model.forward  sJ  € ðB Ò"Ø"Ÿlšlñ Ø#ðà-ðð ,ðð ñ	‰Oô ˜O¬_×=Ò=Ü-Ø"1°!Õ"4Ü47¸Ó4HÈ1Ô4L˜o¨aÖ0ÐRVÜ14°_Ó1EÈÔ1I˜?¨1Ö-ÈtôˆOð (¨Õ*ˆð Ÿ,š,ñ 	
Ø'ð	
à1ð	
ð 0ð	
ð ,ð		
ð
 #0ð	
ð $2ð	
ð  ð	
ð ñ	
ˆô "Ø-×?Ñ?Ø+×;Ñ;Ø"1×"?Ñ"?Ø.×9Ñ9Ø,×=Ñ=Ø&5×&GÑ&GØ"1×"?Ñ"?Ø.×9Ñ9ô	
ð 		
r6   )r»  r¹  rq  ©	NNNNNNNNN©rH   rI   rJ   rK   Ú"_keys_to_ignore_on_load_unexpectedÚ_tied_weights_keysr*   rÃ  r   r    r   rE   rL   rM   rN   rO   s   @@r4   rl  rl  ñ  se   ù‡ € ð 	Qð*Ð&ð 	& Ø% ðÐ÷
ó ò"ò:ð
 Ø÷d
ñ d
ó ó ÷d
ð d
r6   rl  z:
    T5 Model with a `language modeling` head on top.
    )Úcustom_introc                   óœ   a a€ ] tR tRt oR.tRRRRRR/tV3R lV 3R lltR	 tR
 t]	]
RV3R lR ll4       4       tV3R lR ltRtVtV ;t# )rm  i}  r¯  zlm_head.weightr±  r°  r²  c                ó    <€ V ^8„  d   QhRS[ /# rT   r$   )rV   rP   s   "€r4   rW   Ú'T5ForConditionalGeneration.__annotate__Œ  s   ø€ ÷ ñ ™xñ r6   c                ó  <€ \         SV `  V4       VP                  V n        \        P
                  ! VP                  VP                  4      V n        \        P                  ! V4      pR Vn
        R Vn        \        V4      V n        \        P                  ! V4      pRVn
        VP                  Vn        \        V4      V n        \        P"                  ! VP                  VP                  R R7      V n        V P'                  4        R# )FTr[   N)r)   r*   r^   Ú	model_dimr   r½   r”  rq  r·  r¸  r®   r¨  r’  r¹  rº  r—  r»  r]   re  rš  r¼  s   &&  €r4   r*   Ú#T5ForConditionalGeneration.__init__Œ  s»   ø€ Ü‰Ñ˜Ô ØŸ™ˆŒä—l’l 6×#4Ñ#4°f·n±nÓEˆŒäŸš vÓ.ˆØ$)ˆÔ!Ø#(ˆÔ Ü˜~Ó.ˆŒäŸš vÓ.ˆØ$(ˆÔ!Ø$*×$=Ñ$=ˆÔ!Ü˜~Ó.ˆŒä—y’y §¡°×1BÑ1BÈÔOˆŒð 	�‰Ör6   c                ó   € V P                   # rj   rÁ  rÂ  s   &r4   rÃ  Ú/T5ForConditionalGeneration.get_input_embeddings¡  rÅ  r6   c                ó~   € Wn         V P                  P                  V4       V P                  P                  V4       R # rj   rÇ  rž  s   &&r4   r   Ú/T5ForConditionalGeneration.set_input_embeddings¤  rÉ  r6   c                ó¾  <€ V ^8„  d   QhRS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[S[S[ P
                  ,          ,          R,          RS[R,          RS[ P                  R,          R	S[ P                  R,          R
S[ P                  R,          RS[R,          RS[S[	,          RS[
/# )r8   r]  Nr�   r\  r^  rË  rý   r¥  rÌ  Úlabelsr¨  r’   rO  )r,   rÍ  rÎ  rÏ  rÐ  rl   r	   rª   r   r   r   )rV   rP   s   "€r4   rW   rá  «  sÿ   ø€ ÷ 
ñ 
á×#Ñ# dÕ*ð
ñ ×)Ñ)¨DÕ0ð
ñ !×+Ñ+¨dÕ2ð	
ñ
 !&× 0Ñ 0°4Õ 7ð
ñ ™u¡U§\¡\Õ2Õ3°dÕ:ð
ñ  �ð
ñ ×(Ñ(¨4Õ/ð
ñ  %×0Ñ0°4Õ7ð
ñ × Ñ  4Õ'ð
ñ ˜$•;ð
ñ Ñ+Õ,ð
ñ 
ñ
r6   c                óœ  € Vf   V P                   ! RRVRVRV/VB pM]\        V\        4      '       gH   \        V^ ,          \        V4      ^8”  d
   V^,          MR\        V4      ^8”  d
   V^,          MRR7      pV^ ,          pV	e   Vf   Vf   V P	                  V	4      pV P
                  ! RRVRVRVRVRVRVR	V
/VB pV^ ,          pV P                  P                  '       d   WàP                  R,          ,          pV P                  V4      pRpV	e_   \        RR
7      pV	P                  VP                  4      p	V! VP                  RVP                  R4      4      V	P                  R4      4      p\        VVVP                   VP"                  VP$                  VP&                  VP(                  VP"                  VP$                  R7	      # )a±
  
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
    Indices of input sequence tokens in the vocabulary. T5 is a model with relative position embeddings so you
    should be able to pad the inputs on both the right and the left.

    Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
    [`PreTrainedTokenizer.__call__`] for detail.

    [What are input IDs?](../glossary#input-ids)

    To know more on how to prepare `input_ids` for pretraining take a look a [T5 Training](./t5#training).
decoder_input_ids (`torch.LongTensor` of shape `(batch_size, target_sequence_length)`, *optional*):
    Indices of decoder input sequence tokens in the vocabulary.

    Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
    [`PreTrainedTokenizer.__call__`] for details.

    [What are decoder input IDs?](../glossary#decoder-input-ids)

    T5 uses the `pad_token_id` as the starting token for `decoder_input_ids` generation. If `past_key_values`
    is used, optionally only the last `decoder_input_ids` have to be input (see `past_key_values`).

    To know more on how to prepare `decoder_input_ids` for pretraining take a look at [T5
    Training](./t5#training).
decoder_attention_mask (`torch.BoolTensor` of shape `(batch_size, target_sequence_length)`, *optional*):
    Default behavior: generate a tensor that ignores pad tokens in `decoder_input_ids`. Causal mask will also
    be used by default.
labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
    Labels for computing the sequence classification/regression loss. Indices should be in `[-100, 0, ...,
    config.vocab_size - 1]`. All labels set to `-100` are ignored (masked), the loss is only computed for
    labels in `[0, ..., config.vocab_size]`

Examples:

```python
>>> from transformers import AutoTokenizer, T5ForConditionalGeneration

>>> tokenizer = AutoTokenizer.from_pretrained("google-t5/t5-small")
>>> model = T5ForConditionalGeneration.from_pretrained("google-t5/t5-small")

>>> # training
>>> input_ids = tokenizer("The <extra_id_0> walks in <extra_id_1> park", return_tensors="pt").input_ids
>>> labels = tokenizer("<extra_id_0> cute dog <extra_id_1> the <extra_id_2>", return_tensors="pt").input_ids
>>> outputs = model(input_ids=input_ids, labels=labels)
>>> loss = outputs.loss
>>> logits = outputs.logits

>>> # inference
>>> input_ids = tokenizer(
...     "summarize: studies have shown that owning a dog is good for you", return_tensors="pt"
... ).input_ids  # Batch size 1
>>> outputs = model.generate(input_ids)
>>> print(tokenizer.decode(outputs[0], skip_special_tokens=True))
>>> # studies have shown that owning a dog is good for you.
```Nr]  r�   r¥  rÒ  rý   r;  r<  r¨  ©Úignore_index©	ÚlossÚlogitsrý   rÓ  rÔ  rZ  rÕ  r;  rÖ  r„  rš   ry  r:   )r¹  rk   r   r×  r€  r»  rU   Úscale_decoder_outputsrã  re  r   r;   rÕ   rî   r›   r   rý   rC   rY  rZ  r¦  )r0   r]  r�   r\  r^  rË  rý   r¥  rÌ  rê  r¨  r’   rC   rØ  Úsequence_outputÚ	lm_logitsrï  Úloss_fcts   &&&&&&&&&&&,      r4   rE   Ú"T5ForConditionalGeneration.forward©  sõ  € ðP Ò"à"Ÿlšlñ Ø#ðà-ðð ,ðð ñ	‰Oô ˜O¬_×=Ò=Ü-Ø"1°!Õ"4Ü47¸Ó4HÈ1Ô4L˜o¨aÖ0ÐRVÜ14°_Ó1EÈÔ1I˜?¨1Ö-ÈtôˆOð (¨Õ*ˆàÒÐ"3Ò";Ð@UÒ@]à $× 1Ñ 1°&Ó 9Ðð Ÿ,š,ñ 	
Ø'ð	
à1ð	
ð 0ð	
ð ,ð		
ð
 #0ð	
ð $2ð	
ð  ð	
ð ñ	
ˆð *¨!Õ,ˆà�;‰;×,×,Ð,Ø-·±ÀÕ1EÕFˆOà—L‘L Ó1ˆ	àˆØÒÜ'°TÔ:ˆHà—Y‘Y˜y×/Ñ/Ó0ˆFÙ˜IŸN™N¨2¨y¯~©~¸bÓ/AÓBÀFÇKÁKÐPRÃOÓTˆDäØØØ+×;Ñ;Ø"1×"?Ñ"?Ø.×9Ñ9Ø,×=Ñ=Ø&5×&GÑ&GØ"1×"?Ñ"?Ø.×9Ñ9ô

ð 
	
r6   c                ó4   <€ V ^8„  d   QhRS[ P                  /# )r8   rê  rP  )rV   rP   s   "€r4   rW   rá  ,  s   ø€ ÷ )ñ )¹E¿L¹Lñ )r6   c                ó$   € V P                  V4      # rj   )r€  )r0   rê  s   &&r4   Ú%prepare_decoder_input_ids_from_labelsÚ@T5ForConditionalGeneration.prepare_decoder_input_ids_from_labels,  s   € Ø× Ñ  Ó(Ð(r6   )r»  r¹  re  rã  rq  ©
NNNNNNNNNN)rH   rI   rJ   rK   rÜ  rÝ  r*   rÃ  r   r    r   rE   rø  rL   rM   rN   rO   s   @@r4   rm  rm  }  st   ù‡ € ð 	Qð*Ð&ð 	˜/Ø% Ø% ðÐ÷ó ò*ò:ð
 Ø÷
ñ 
ó ó ð
÷B)÷ )ð )r6   rm  c                   ó‚   a a€ ] tR tRt oRR/tR.tV3R lV 3R lltR tR t]	]
RV3R	 lR
 ll4       4       tRtVtV ;t# )rn  i0  r°  r±  r»  c                ó    <€ V ^8„  d   QhRS[ /# rT   r$   )rV   rP   s   "€r4   rW   ÚT5EncoderModel.__annotate__5  s   ø€ ÷ 
ñ 
™xñ 
r6   c                óæ   <€ \         SV `  V4       \        P                  ! VP                  VP
                  4      V n        TpR Vn        R Vn        \        V4      V n
        V P                  4        R# r  )r)   r*   r   r½   r”  r^   rq  r¨  r§  r’  r¹  rš  )r0   rU   r½  r3   s   && €r4   r*   ÚT5EncoderModel.__init__5  sY   ø€ Ü‰Ñ˜Ô Ü—l’l 6×#4Ñ#4°f·n±nÓEˆŒàˆØ#(ˆÔ Ø,1ˆÔ)Ü˜~Ó.ˆŒð 	�‰Ör6   c                ó   € V P                   # rj   rÁ  rÂ  s   &r4   rÃ  Ú#T5EncoderModel.get_input_embeddingsA  rÅ  r6   c                óH   € Wn         V P                  P                  V4       R # rj   )rq  r¹  r   rž  s   &&r4   r   Ú#T5EncoderModel.set_input_embeddingsD  s   € Ø$ŒØ�‰×)Ñ)¨.Ö9r6   c          
      ó®   <€ V ^8„  d   QhRS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[S[,          RS[/# )r8   r]  Nr�   r¥  r’   rO  )r,   rÍ  rÎ  r   r   r   )rV   rP   s   "€r4   rW   rý  J  sd   ø€ ÷ %ñ %á×#Ñ# dÕ*ð%ñ ×)Ñ)¨DÕ0ð%ñ ×(Ñ(¨4Õ/ð	%ñ
 Ñ+Õ,ð%ñ 
ñ%r6   c           	     ó6   € V P                   ! RRVRVRV/VB pV# )aÁ  
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
    Indices of input sequence tokens in the vocabulary. T5 is a model with relative position embeddings so you
    should be able to pad the inputs on both the right and the left.

    Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
    [`PreTrainedTokenizer.__call__`] for detail.

    To know more on how to prepare `input_ids` for pretraining take a look a [T5 Training](./t5#training).

Example:

```python
>>> from transformers import AutoTokenizer, T5EncoderModel

>>> tokenizer = AutoTokenizer.from_pretrained("google-t5/t5-small")
>>> model = T5EncoderModel.from_pretrained("google-t5/t5-small")
>>> input_ids = tokenizer(
...     "Studies have been shown that owning a dog is good for you", return_tensors="pt"
... ).input_ids  # Batch size 1
>>> outputs = model(input_ids=input_ids)
>>> last_hidden_states = outputs.last_hidden_state
```r]  r�   r¥  r„  )r¹  )r0   r]  r�   r¥  r’   rË  s   &&&&, r4   rE   ÚT5EncoderModel.forwardH  s?   € ð@ ,0¯<ª<ñ ,
Øð,
à)ð,
ð (ð,
ð ñ	,
ˆð Ðr6   )r¹  rq  r  )rH   rI   rJ   rK   rÝ  rÜ  r*   rÃ  r   r    r   rE   rL   rM   rN   rO   s   @@r4   rn  rn  0  sR   ù‡ € à7¸ÐIÐØ*4¨Ð&÷
ó 
òò:ð Ø÷%ñ %ó ó ÷%ð %r6   rn  zƒ
    T5 model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
    tasks.
    c                   ón   a a€ ] tR tRt oR.tV3R lV 3R llt]]RV3R lR ll4       4       tRt	Vt
V ;t# )	ÚT5ForSequenceClassificationir  r¯  c                ó    <€ V ^8„  d   QhRS[ /# rT   r$   )rV   rP   s   "€r4   rW   Ú(T5ForSequenceClassification.__annotate__{  s   ø€ ÷ ñ ™xñ r6   c                ó†   <€ \         SV `  V4       \        V4      V n        \	        V4      V n        V P                  4        R # rj   )r)   r*   rl  rW  rE  Úclassification_headrš  rg   s   &&€r4   r*   Ú$T5ForSequenceClassification.__init__{  s5   ø€ Ü‰Ñ˜Ô Ü" 6›?ˆÔÜ#7¸Ó#?ˆÔ ð 	�‰Ör6   c                óš  <€ V ^8„  d   QhRS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[S[ P                  ,          R,          RS[ P                  R,          RS[ P                  R,          R	S[ P                  R,          R
S[R,          RS[S[,          RS[/# )r8   r]  Nr�   r\  r^  rË  r¥  rÌ  rê  r¨  r’   rO  )	r,   rÍ  rl   ÚlistrÎ  rª   r   r   r   )rV   rP   s   "€r4   rW   r
  …  së   ø€ ÷ }
ñ }
á×#Ñ# dÕ*ð}
ñ Ÿ™ tÕ+ð}
ñ !×+Ñ+¨dÕ2ð	}
ñ
 !&× 0Ñ 0°4Õ 7ð}
ñ ™e×/Ñ/Õ0°4Õ7ð}
ñ ×(Ñ(¨4Õ/ð}
ñ  %×0Ñ0°4Õ7ð}
ñ × Ñ  4Õ'ð}
ñ ˜$•;ð}
ñ Ñ+Õ,ð}
ñ 
)ñ}
r6   c
                óR  € Ve   Rp	Vf'   Ve#   \        RV P                  P                   24      hVf%   Vf!   Vf   \        R4      hV P	                  V4      pV P
                  ! V3RVRVRVRVR	VR
VRV	/V
B pV^ ,          pVP                  V P                  P                  4      P                  VP                  4      p\        \        P                  ! VP                  ^4      4      P                  4       ^8H  R4       VP                   w  rïpWÍR3,          p\        VP                   ^ ,          V,          ^8¬  R4       VP#                  VRV4      R,          pV P%                  V4      pRpVEeÝ   VP                  VP                  4      pV P                  P&                  fª   V P                  P(                  ^8X  d   RV P                  n        M|V P                  P(                  ^8”  dQ   VP*                  \        P,                  8X  g    VP*                  \        P.                  8X  d   RV P                  n        MRV P                  n        V P                  P&                  R8X  dV   \1        4       pV P                  P(                  ^8X  d'   V! VP3                  4       VP3                  4       4      pMšV! VV4      pM�V P                  P&                  R8X  dH   \5        4       pV! VP#                  RV P                  P(                  4      VP#                  R4      4      pM.V P                  P&                  R8X  d   \7        4       pV! VV4      p\9        VVVP:                  VP<                  VP>                  VP@                  VPB                  VPD                  VPF                  R7	      # )aì  
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
    Indices of input sequence tokens in the vocabulary. T5 is a model with relative position embeddings so you
    should be able to pad the inputs on both the right and the left.

    Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
    [`PreTrainedTokenizer.__call__`] for detail.

    [What are input IDs?](../glossary#input-ids)

    To know more on how to prepare `input_ids` for pretraining take a look a [T5 Training](./t5#training).
decoder_input_ids (`torch.LongTensor` of shape `(batch_size, target_sequence_length)`, *optional*):
    Indices of decoder input sequence tokens in the vocabulary.

    Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
    [`PreTrainedTokenizer.__call__`] for details.

    [What are decoder input IDs?](../glossary#decoder-input-ids)

    T5 uses the `pad_token_id` as the starting token for `decoder_input_ids` generation. If `past_key_values`
    is used, optionally only the last `decoder_input_ids` have to be input (see `past_key_values`).

    To know more on how to prepare `decoder_input_ids` for pretraining take a look at [T5
    Training](./t5#training).
decoder_attention_mask (`torch.BoolTensor` of shape `(batch_size, target_sequence_length)`, *optional*):
    Default behavior: generate a tensor that ignores pad tokens in `decoder_input_ids`. Causal mask will also
    be used by default.
labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
    Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
    config.num_labels - 1]`. If `config.num_labels > 1` a classification loss is computed (Cross-Entropy).
NFz8Passing input embeddings is currently not supported for ú°If no `decoder_input_ids` or `decoder_inputs_embeds` are passed, `input_ids` cannot be `None`. Please pass either `input_ids` or `decoder_input_ids` or `decoder_inputs_embeds`.r�   r\  r^  rË  r¥  rÌ  r¨  z7All examples must have the same number of <eos> tokens.rÖ   z3Each example must contain at least one <eos> token.Ú
regressionÚsingle_label_classificationÚmulti_label_classificationrî  r:   )rÖ   r:   rÖ   )$ÚNotImplementedErrorr3   rH   r|  r€  rW  ÚeqrU   Úeos_token_idr;   rÕ   r   r,   Úunique_consecutiveÚsumÚnumelrë   rî   r  Úproblem_typerK  r@   rÂ   r©   r   Úsqueezer   r   r   rý   rÓ  rÔ  rZ  rÕ  r;  rÖ  )r0   r]  r�   r\  r^  rË  r¥  rÌ  rê  r¨  r’   Úoutputsrò  Úeos_maskÚ
batch_sizer?  r1   ÚselectedÚsentence_representationrð  rï  rô  s   &&&&&&&&&&,           r4   rE   Ú#T5ForSequenceClassification.forwardƒ  sM  € ð\ ÒØˆIàÒ Ò!:Ü%ØJÈ4Ï>É>×KbÑKbÐJcÐdóð ð Ò$Ð)>Ò)FØÒ Ü ðUóð ð
 !%× 1Ñ 1°)Ó <Ðà&*×&6Ò&6Øñ
'
à)ð
'
ð 0ð
'
ð $:ð	
'
ð
 ,ð
'
ð (ð
'
ð #8ð
'
ð  ð
'
ð ñ
'
ˆð " !�*ˆà—<‘< §¡× 8Ñ 8Ó9×<Ñ<¸_×=SÑ=SÓTˆäÜ×$Ò$ X§\¡\°!£_Ó5×;Ñ;Ó=ÀÑBØEô	
ð &5×%:Ñ%:Ñ"ˆ
�{Ø"¨Q ;Õ/ˆÜØ�N‰N˜1Õ Õ+¨qÑ0ØAô	
ð #+§-¡-°
¸BÀÓ"LÈXÕ"VÐØ×)Ñ)Ð*AÓBˆàˆØÓØ—Y‘Y˜vŸ}™}Ó-ˆFØ�{‰{×'Ñ'Ò/Ø—;‘;×)Ñ)¨QÔ.Ø/;�D—K‘KÕ,Ø—[‘[×+Ñ+¨aÔ/°V·\±\ÄUÇZÁZÔ5OÐSY×S_ÑS_Ôch×clÑclÔSlØ/L�D—K‘KÕ,à/K�D—K‘KÔ,à�{‰{×'Ñ'¨<Ô7Ü"›9�Ø—;‘;×)Ñ)¨QÔ.Ù# F§N¡NÓ$4°f·n±nÓ6FÓG‘Dá# F¨FÓ3‘DØ—‘×)Ñ)Ð-JÔJÜ+Ó-�Ù §¡¨B°·±×0FÑ0FÓ GÈÏÉÐUWËÓY‘Ø—‘×)Ñ)Ð-IÔIÜ,Ó.�Ù ¨Ó/�ä.ØØØ#×3Ñ3Ø")×"?Ñ"?Ø&×9Ñ9Ø$×5Ñ5Ø&-×&GÑ&GØ")×"?Ñ"?Ø&×9Ñ9ô

ð 
	
r6   )r  rW  rÚ  )rH   rI   rJ   rK   rÜ  r*   r    r   rE   rL   rM   rN   rO   s   @@r4   r  r  r  sE   ù‡ € ð +sÐ)sÐ&÷ó ð Ø÷}
ñ }
ó ó ÷}
ð }
r6   r  c                   óh   a a€ ] tR tRt oV3R lV 3R llt]]RV3R lR ll4       4       tRtVt	V ;t
# )ru  i  c                ó    <€ V ^8„  d   QhRS[ /# rT   r$   )rV   rP   s   "€r4   rW   Ú%T5ForTokenClassification.__annotate__  s   ø€ ÷ 	ñ 	™xñ 	r6   c                ó2  <€ \         SV `  V4       VP                  V n        \        V4      V n        \
        P                  ! VP                  4      V n        \
        P                  ! VP                  VP                  4      V n        V P                  4        R # rj   )r)   r*   rK  rn  rW  r   rb   rJ  rd   r]   r1   rg  rš  rg   s   &&€r4   r*   Ú!T5ForTokenClassification.__init__  sj   ø€ Ü‰Ñ˜Ô Ø ×+Ñ+ˆŒä)¨&Ó1ˆÔÜ—z’z &×";Ñ";Ó<ˆŒÜŸ)š) F×$6Ñ$6¸×8IÑ8IÓJˆŒð 	�‰Ör6   c                óÖ   <€ V ^8„  d   QhRS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[S[,          RS[/# )r8   r]  Nr�   r¥  rê  r’   rO  )r,   rl   r   r   r   )rV   rP   s   "€r4   rW   r%    sq   ø€ ÷ +
ñ +
á—<‘< $Õ&ð+
ñ Ÿ™ tÕ+ð+
ñ —|‘| dÕ*ð	+
ñ
 —‘˜tÕ#ð+
ñ Ñ+Õ,ð+
ñ 
ñ+
r6   c                óP  € V P                   ! V3RVRV/VB pV^ ,          pV P                  V4      pV P                  V4      pRp	Ve=   \        4       p
V
! VP	                  RV P
                  4      VP	                  R4      4      p	\        V	VVP                  VP                  R7      # )aì  
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
    Indices of input sequence tokens in the vocabulary. T5 is a model with relative position embeddings so you
    should be able to pad the inputs on both the right and the left.

    Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
    [`PreTrainedTokenizer.__call__`] for detail.

    [What are input IDs?](../glossary#input-ids)

    To know more on how to prepare `input_ids` for pretraining take a look a [T5 Training](./t5#training).
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
    Labels for computing the token classification loss. Indices should be in `[0, ..., config.num_labels - 1]`.
r�   r¥  N)rï  rð  rC   rY  r:   )	rW  rd   rg  r   rî   rK  r   rC   rY  )r0   r]  r�   r¥  rê  r’   r  rC   rð  rï  rô  s   &&&&&,     r4   rE   Ú T5ForTokenClassification.forward  sµ   € ð0 $(×#3Ò#3Øñ$
à)ð$
ð (ð$
ð ñ	$
ˆð   �
ˆØŸ™ ]Ó3ˆØ—‘ Ó/ˆàˆØÒÜ'Ó)ˆHÙ˜FŸK™K¨¨D¯O©OÓ<¸f¿k¹kÈ"»oÓNˆDä$ØØØ!×/Ñ/Ø×)Ñ)ô	
ð 	
r6   )rg  rd   rK  rW  r  )rH   rI   rJ   rK   r*   r    r   rE   rL   rM   rN   rO   s   @@r4   ru  ru    s5   ù‡ € ÷	ó 	ð Ø÷+
ñ +
ó ó ÷+
ð +
r6   ru  c                   ó†   a a€ ] tR tRt oR.tRRRR/tV3R lV 3R lltR tR	 t]	]
RV3R
 lR ll4       4       tRtVtV ;t# )ro  iB  r¯  r°  r±  r²  c                ó    <€ V ^8„  d   QhRS[ /# rT   r$   )rV   rP   s   "€r4   rW   Ú#T5ForQuestionAnswering.__annotate__J  s   ø€ ÷ ñ ™xñ r6   c                ó.  <€ \         SV `  V4       VP                  V n        \        P
                  ! VP                  VP                  4      V n        \        P                  ! V4      pR Vn
        R Vn        \        V4      V n        \        P                  ! V4      pRVn
        VP                  Vn        \        V4      V n        VP"                  V n        \        P$                  ! VP&                  VP"                  4      V n        V P+                  4        R# r¶  )r)   r*   r^   rã  r   r½   r”  rq  r·  r¸  r®   r¨  r’  r¹  rº  r—  r»  rK  r]   r1   rf  rš  r¼  s   &&  €r4   r*   ÚT5ForQuestionAnswering.__init__J  sÈ   ø€ Ü‰Ñ˜Ô ØŸ™ˆŒä—l’l 6×#4Ñ#4°f·n±nÓEˆŒäŸš vÓ.ˆØ$)ˆÔ!Ø#(ˆÔ Ü˜~Ó.ˆŒäŸš vÓ.ˆØ$(ˆÔ!Ø$*×$=Ñ$=ˆÔ!Ü˜~Ó.ˆŒà ×+Ñ+ˆŒÜŸ)š) F×$6Ñ$6¸×8IÑ8IÓJˆŒð 	�‰Ör6   c                ó   € V P                   # rj   rÁ  rÂ  s   &r4   rÃ  Ú+T5ForQuestionAnswering.get_input_embeddings`  rÅ  r6   c                ó~   € Wn         V P                  P                  V4       V P                  P                  V4       R # rj   rÇ  rž  s   &&r4   r   Ú+T5ForQuestionAnswering.set_input_embeddingsc  rÉ  r6   c                óÒ  <€ V ^8„  d   QhRS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[S[S[ P
                  ,          ,          R,          RS[ P                  R,          RS[ P                  R,          R	S[ P                  R,          R
S[ P                  R,          RS[R,          RS[S[,          RS[	/# )r8   r]  Nr�   r\  r^  rË  Ústart_positionsÚend_positionsr¥  rÌ  r¨  r’   rO  )
r,   rÍ  rÎ  rÏ  rÐ  rl   rª   r   r   r   )rV   rP   s   "€r4   rW   r-  j  s  ø€ ÷ y
ñ y
á×#Ñ# dÕ*ðy
ñ ×)Ñ)¨DÕ0ðy
ñ !×+Ñ+¨dÕ2ð	y
ñ
 !&× 0Ñ 0°4Õ 7ðy
ñ ™u¡U§\¡\Õ2Õ3°dÕ:ðy
ñ ×)Ñ)¨DÕ0ðy
ñ ×'Ñ'¨$Õ.ðy
ñ ×(Ñ(¨4Õ/ðy
ñ  %×0Ñ0°4Õ7ðy
ñ ˜$•;ðy
ñ Ñ+Õ,ðy
ñ 
-ñy
r6   c                ó8  € Ve   Ve   Rp
Vf%   V	f!   Vf   \        R4      hV P                  V4      pVf   V P                  ! RRVRVRV/VB pM]\        V\        4      '       gH   \	        V^ ,          \        V4      ^8”  d
   V^,          MR\        V4      ^8”  d
   V^,          MRR7      pV^ ,          pV P                  ! RRVRVRV	RRR	VR
VRV
/VB pV^ ,          pV P                  V4      pVP                  ^RR7      w  ppVP                  R4      P                  4       pVP                  R4      P                  4       pRpVeø   Veô   \        VP                  4       4      ^8”  d+   VP                  R4      P                  VP                  4      p\        VP                  4       4      ^8”  d+   VP                  R4      P                  VP                  4      pVP                  ^4      pVP                  ^ V4      pVP                  ^ V4      p\        VR7      pV! VV4      pV! VV4      pVV,           ^,          p\!        VVVVP"                  VP$                  VP&                  VP(                  VP*                  VP$                  VP&                  R7
      # )aÚ  
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
    Indices of input sequence tokens in the vocabulary. T5 is a model with relative position embeddings so you
    should be able to pad the inputs on both the right and the left.

    Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
    [`PreTrainedTokenizer.__call__`] for detail.

    [What are input IDs?](../glossary#input-ids)

    To know more on how to prepare `input_ids` for pretraining take a look a [T5 Training](./t5#training).
decoder_input_ids (`torch.LongTensor` of shape `(batch_size, target_sequence_length)`, *optional*):
    Indices of decoder input sequence tokens in the vocabulary.

    Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
    [`PreTrainedTokenizer.__call__`] for details.

    [What are decoder input IDs?](../glossary#decoder-input-ids)

    T5 uses the `pad_token_id` as the starting token for `decoder_input_ids` generation. If `past_key_values`
    is used, optionally only the last `decoder_input_ids` have to be input (see `past_key_values`).

    To know more on how to prepare `decoder_input_ids` for pretraining take a look at [T5
    Training](./t5#training).
decoder_attention_mask (`torch.BoolTensor` of shape `(batch_size, target_sequence_length)`, *optional*):
    Default behavior: generate a tensor that ignores pad tokens in `decoder_input_ids`. Causal mask will also
    be used by default.
NFr  r]  r�   r¥  rÒ  rý   r;  r<  r¨  r–   rì  )
rï  Ústart_logitsÚ
end_logitsrý   rÓ  rÔ  rZ  rÕ  r;  rÖ  r„  r:   )r|  r€  r¹  rk   r   r×  r»  rf  Úsplitr  r    r›   r;   rÕ   r:  r   r   rý   rC   rY  rZ  r¦  )r0   r]  r�   r\  r^  rË  r5  r6  r¥  rÌ  r¨  r’   rC   rØ  rò  rð  r8  r9  Ú
total_lossÚignored_indexrô  Ú
start_lossÚend_losss   &&&&&&&&&&&,           r4   rE   ÚT5ForQuestionAnswering.forwardh  sÚ  € ðX Ò&¨=Ò+DØˆIð
 Ò$Ð)>Ò)FØÒ Ü ðUóð ð
 !%× 1Ñ 1°)Ó <Ðð Ò"Ø"Ÿlšlñ Ø#ðà-ðð ,ðð ñ	‰Oô ˜O¬_×=Ò=Ü-Ø"1°!Õ"4Ü47¸Ó4HÈ1Ô4L˜o¨aÖ0ÐRVÜ14°_Ó1EÈÔ1I˜?¨1Ö-ÈtôˆOð (¨Õ*ˆð Ÿ,š,ñ 	
Ø'ð	
à1ð	
ð 0ð	
ð !ð		
ð
 #0ð	
ð $2ð	
ð  ð	
ð ñ	
ˆð *¨!Õ,ˆà—‘ Ó1ˆØ#)§<¡<°°r <Ó#:Ñ ˆ�jØ#×+Ñ+¨BÓ/×:Ñ:Ó<ˆØ×'Ñ'¨Ó+×6Ñ6Ó8ˆ
àˆ
ØÒ&¨=Ò+Dä�?×'Ñ'Ó)Ó*¨QÔ.Ø"1×"9Ñ"9¸"Ó"=×"@Ñ"@À×ATÑATÓ"U�Ü�=×%Ñ%Ó'Ó(¨1Ô,Ø -× 5Ñ 5°bÓ 9× <Ñ <¸Z×=NÑ=NÓ O�à(×-Ñ-¨aÓ0ˆMØ-×3Ñ3°A°}ÓEˆOØ)×/Ñ/°°=ÓAˆMä'°]ÔCˆHÙ! ,°Ó@ˆJÙ 
¨MÓ:ˆHØ$ xÕ/°1Õ4ˆJä2ØØ%Ø!Ø+×;Ñ;Ø"1×"?Ñ"?Ø.×9Ñ9Ø,×=Ñ=Ø&5×&GÑ&GØ"1×"?Ñ"?Ø.×9Ñ9ô
ð 	
r6   )r»  r¹  rã  rK  rf  rq  rú  rÛ  rO   s   @@r4   ro  ro  B  s^   ù‡ € à*rÐ)sÐ&à% Ø% ðÐ÷
ó ò,ò:ð
 Ø÷y
ñ y
ó ó ÷y
ð y
r6   ro  )Nré   N)rn  rm  rl  rV  ro  r  ru  )NrT  r·  rÇ   Úcollections.abcr   r,   r   Útorch.nnr   r   r   Ú r   rj  Úactivationsr   Úcache_utilsr	   r
   r   Ú
generationr   Úmasking_utilsr   r   Úmodeling_layersr   Úmodeling_outputsr   r   r   r   r   r   r   Úmodeling_utilsr   r   Úprocessing_utilsr   Úutilsr   r   r   r   r   r   Úutils.genericr    r!   Úutils.output_capturingr"   r#   Úconfiguration_t5r%   Ú
get_loggerrH   r·   r“   r'   rR   rq   r}   r£   r¥   r  r   r+  rE  rV  r’  rl  rm  rn  r  ru  ro  Ú__all__r„  r6   r4   Ú<module>rQ     s  ðñ ã Û Ý $ã Ý ß AÑ Aå &Ý !ß CÑ CÝ )ß JÝ 9÷÷ ñ ÷ GÝ &ß r× rß Iß EÝ &ð 
×	Ò	˜HÓ	%€ô+�"—)‘)ô +ô2�b—i‘iô ô,˜2Ÿ9™9ô ô:�—	‘	ô ÷$%ô@A8�"—)‘)ô A8ôH=˜2Ÿ9™9ô =ô@9˜BŸI™Iô 9ô>JPÐ(ô JPôZ˜2Ÿ9™9ô ð$ ôj!˜ó j!ó ðj!ôZn
Ðô n
ðb ôH
Ðó H
ó ðH
ñV ðôô
k)Ð!2°Oó k)óð
k)ð\ ô>Ð&ó >ó ð>ñB ðôôJ
Ð"3ó J
óðJ
ðZ ô9
Ð0ó 9
ó ð9
ðx ô`
Ð.ó `
ó ð`
òF‚r6   