+
    œ°³j+ï  ã                   ób  € R 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 ^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I0H1t1 ^RI2H3t3H4t4 ^RI5H6t6 ].Pn                  ! ]84      t9R R lt: ! R R]Pv                  4      t< ! R R]Pv                  4      t=R8R R llt> ! R R]P~                  4      t@ ! R R]4      tA ! R R ]4      tB ! R! R"]P~                  4      tC]+ ! R# R$]&4      4       tD ! R% R&]D4      tE ! R' R(]D4      tF]+ ! R) R*]D4      4       tG]+! R+R,7       ! R- R.]D]4      4       tH]+! R/R,7       ! R0 R1]D4      4       tI]+ ! R2 R3]D4      4       tJ ! R4 R5]D4      tK ! R6 R7]D]4      tL. R9OtMR# ):zPyTorch MBART model.N)ÚCallable)Únn)ÚBCEWithLogitsLossÚCrossEntropyLossÚMSELoss)Úinitialization)ÚACT2FN)ÚCacheÚDynamicCacheÚEncoderDecoderCache)ÚGenerationMixin)Úcreate_bidirectional_maskÚcreate_causal_mask)ÚFlashAttentionKwargs)ÚGradientCheckpointingLayer)ÚBaseModelOutputÚ)BaseModelOutputWithPastAndCrossAttentionsÚ!CausalLMOutputWithCrossAttentionsÚSeq2SeqLMOutputÚSeq2SeqModelOutputÚ#Seq2SeqQuestionAnsweringModelOutputÚSeq2SeqSequenceClassifierOutput)ÚALL_ATTENTION_FUNCTIONSÚPreTrainedModel)ÚUnpack)ÚTransformersKwargsÚauto_docstringÚcan_return_tupleÚis_torchdynamo_compilingÚloggingÚtorch_compilable_check)Úmerge_with_config_defaults)ÚOutputRecorderÚcapture_outputs©ÚMBartConfigc                óD   € V ^8„  d   QhR\         P                  R\        /# )é   Ú	input_idsÚpad_token_id©ÚtorchÚTensorÚint)Úformats   "Úi/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/mbart/modeling_mbart.pyÚ__annotate__r0   ;   s   € ÷ ñ ¤%§,¡,ð ¼cñ ó    c                ó`  € V P                  4       pVf   \        R4      hVP                  VR8H  V4       VP                  V4      P	                  ^R7      ^,
          P                  R4      pVP                  ^V4      P                  4       pVRRR13,          P                  4       VR&   WBR&   V# )	zÂ
Shift input ids one token to the right, and wrap the last non pad token (the <LID> token) Note that MBart does not
have a single `decoder_start_token_id` in contrast to other Bart-like models.
Nz1self.model.config.pad_token_id has to be defined.©ÚdimºNNNiœÿÿÿéÿÿÿÿ)r5   ºé   NN)r5   é    )ÚcloneÚ
ValueErrorÚmasked_fill_ÚneÚsumÚ	unsqueezeÚgatherÚsqueeze)r(   r)   Úprev_output_tokensÚindex_of_eosÚdecoder_start_tokenss   &&   r/   Úshift_tokens_rightrE   ;   s³   € ð
 #Ÿ™Ó*ÐàÒÜÐLÓMÐMà×#Ñ#Ð$6¸$Ñ$>ÀÔMà&×)Ñ)¨,Ó7×;Ñ;ÀÐ;ÓBÀQÕF×QÑQÐRTÓU€LØ-×4Ñ4°Q¸ÓE×MÑMÓOÐØ 2°1°c°r°c°6Õ :× @Ñ @Ó BÐ�uÑØ3�tÑàÐr1   c                   ó^   a a€ ] tR t^Pt oRtV3R lV 3R lltRV3R lV 3R llltRtVtV ;t	# )ÚMBartLearnedPositionalEmbeddingzF
This module learns positional embeddings up to a fixed maximum size.
c                ó&   <€ V ^8„  d   QhRS[ RS[ /# )r'   Únum_embeddingsÚembedding_dim©r-   )r.   Ú__classdict__s   "€r/   r0   Ú,MBartLearnedPositionalEmbedding.__annotate__U   s   ø€ ÷ Fñ F¡sð F¹3ñ Fr1   c                óV   <€ ^V n         \        SV `	  WP                   ,           V4       R# ©r'   N)ÚoffsetÚsuperÚ__init__)ÚselfrI   rJ   Ú	__class__s   &&&€r/   rR   Ú(MBartLearnedPositionalEmbedding.__init__U   s"   ø€ ð ˆŒÜ‰Ñ˜¯+©+Õ5°}ÖEr1   c                ób   <€ V ^8„  d   QhRS[ P                  RS[RS[ P                  R,          /# )r'   r(   Úpast_key_values_lengthÚposition_idsNr*   )r.   rL   s   "€r/   r0   rM   [   s5   ø€ ÷ ;ñ ;ÙŸ™ð;Ù?Bð;ÙV[×VbÑVbÐeiÕViñ;r1   c                ó<  <€ Vfi   VP                   R,          w  rE\        P                  ! W"V,           \        P                  V P                  P
                  R7      P                  VR4      pMVP                  ^ 4      p\        SV `%  W0P                  ,           4      # )z3`input_ids' shape is expected to be [bsz x seqlen].:Nr'   N)ÚdtypeÚdevicer6   )Úshaper+   ÚarangeÚlongÚweightr[   Úexpandr?   rQ   ÚforwardrP   )rS   r(   rW   rX   ÚbszÚseq_lenrT   s   &&&&  €r/   ra   Ú'MBartLearnedPositionalEmbedding.forward[   s   ø€ ð
 ÒØ$Ÿ?™?¨2Õ.‰LˆCÜ Ÿ<š<Ø&ÀÕ(HÔPU×PZÑPZÐcg×cnÑcn×cuÑcuôç‰f�S˜"‹oñ ð (×1Ñ1°!Ó4ˆLä‰w‰˜|¯k©kÕ9Ó:Ð:r1   )rP   )r9   N©
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rR   ra   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©rT   rL   s   @@r/   rG   rG   P   s%   ù‡ € ñ÷Fó F÷;÷ ;õ ;r1   rG   c                   ó^   a a€ ] tR t^lt oRtRV3R lV 3R llltV3R lV 3R lltRtVtV ;t	# )ÚMBartScaledWordEmbeddingzT
This module overrides nn.Embeddings' forward by multiplying with embeddings scale.
c          	      ó@   <€ V ^8„  d   QhRS[ RS[ RS[ RS[R,          /# )r'   rI   rJ   Úpadding_idxÚembed_scaleN©r-   Úfloat)r.   rL   s   "€r/   r0   Ú%MBartScaledWordEmbedding.__annotate__q   s0   ø€ ÷ 'ñ '¡sð '¹3ð 'ÉSð 'Ñ_dÐgkÕ_kñ 'r1   c                ó4   <€ \         SV `  WV4       W@n        R # ©N)rQ   rR   rs   )rS   rI   rJ   rr   rs   rT   s   &&&&&€r/   rR   Ú!MBartScaledWordEmbedding.__init__q   s   ø€ Ü‰Ñ˜¸ÔDØ&Ör1   c                ó4   <€ V ^8„  d   QhRS[ P                  /# )r'   r(   ©r+   r,   )r.   rL   s   "€r/   r0   rv   u   s   ø€ ÷ =ñ =¡§¡ñ =r1   c                óD   <€ \         SV `  V4      V P                  ,          # rx   )rQ   ra   rs   )rS   r(   rT   s   &&€r/   ra   Ú MBartScaledWordEmbedding.forwardu   s   ø€ Ü‰w‰˜yÓ)¨D×,<Ñ,<Õ<Ð<r1   ©rs   )ç      ð?re   rn   s   @@r/   rp   rp   l   s#   ù‡ € ñ÷'õ '÷=÷ =ó =r1   rp   c                ó  € V ^8„  d   QhR\         P                  R\        P                  R\        P                  R\        P                  R\        P                  R,          R\        R,          R\        R	\
        \        ,          /# )
r'   ÚmoduleÚqueryÚkeyÚvalueÚattention_maskNÚscalingÚdropoutÚkwargs)r   ÚModuler+   r,   ru   r   r   )r.   s   "r/   r0   r0   z   s{   € ÷ %ñ %Ü�I‰Ið%ä�<‰<ð%ô 
�‰ð%ô �<‰<ð	%ô
 —L‘L 4Õ'ð%ô �T�\ð%ô ð%ô Ô'Õ(ñ%r1   c                 ó¶  € Vf   VP                  R4      R,          p\        P                  ! WP                  ^^4      4      V,          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# )Nr3   ©ÚpÚtrainingr6   ç      à¿)
Úsizer+   ÚmatmulÚ	transposer   Ú
functionalÚsoftmaxr‡   r�   Ú
contiguous)
r�   r‚   rƒ   r„   r…   r†   r‡   rˆ   Úattn_weightsÚattn_outputs
   &&&&&&&,  r/   Úeager_attention_forwardr—   z   s±   € ð ‚Ø—*‘*˜R“. DÕ(ˆô —<’< §}¡}°Q¸Ó':Ó;¸gÕE€LàÒ!Ø#Õ4ˆä—=‘=×(Ñ(¨¸2Ð(Ó>€LÜ—=‘=×(Ñ(¨È6Ï?É?Ð(Ó[€Lä—,’,˜|Ó3€KØ×'Ñ'¨¨1Ó-×8Ñ8Ó:€KàÐ$Ð$r1   c                   ó\   a a€ ] tR t^—t oRt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	# )	ÚMBartAttentionz=Multi-headed attention from 'Attention Is All You Need' paperc                óf   <€ V ^8„  d   QhRS[ RS[ RS[RS[RS[RS[RS[R,          R	S[ R,          /# )
r'   Ú	embed_dimÚ	num_headsr‡   Ú
is_decoderÚbiasÚ	is_causalÚconfigNÚ	layer_idx)r-   ru   Úboolr%   )r.   rL   s   "€r/   r0   ÚMBartAttention.__annotate__š   sn   ø€ ÷ %Cñ %Cáð%Cñ ð%Cñ ð	%Cñ
 ð%Cñ ð%Cñ ð%Cñ ˜dÕ"ð%Cñ ˜•:ñ%Cr1   c	                ó¬  <€ \         S	V `  4        Wn        W n        W0n        W,          V n        Wpn        V P
                  V,          V P                  8w  d   \        R V P                   RV R24      hV P
                  R,          V n        W@n	        W`n
        W€n        Vf@   V P                  '       d.   \        P                  RV P                  P                   R24       \         P"                  ! WVR7      V n        \         P"                  ! WVR7      V n        \         P"                  ! WVR7      V n        \         P"                  ! WVR7      V n        R# )z;embed_dim must be divisible by num_heads (got `embed_dim`: z and `num_heads`: z).NzInstantiating a decoder z¸ without passing `layer_idx` is not recommended and will lead to errors during the forward call, if caching is used. Please make sure to provide a `layer_idx` when creating this class.©rž   rŽ   )rQ   rR   r›   rœ   r‡   Úhead_dimr    r;   r†   r�   rŸ   r¡   ÚloggerÚwarning_oncerT   rf   r   ÚLinearÚk_projÚv_projÚq_projÚout_proj)
rS   r›   rœ   r‡   r�   rž   rŸ   r    r¡   rT   s
   &&&&&&&&&€r/   rR   ÚMBartAttention.__init__š   s  ø€ ô 	‰ÑÔØ"ŒØ"ŒØŒØ!Õ.ˆŒØŒà�M‰M˜IÕ%¨$¯.©.Ô8ÜØMÈdÏnÉnÐM]Ø$ Y K¨rð3óð ð —}‘} dÕ*ˆŒØ$ŒØ"ŒØ"ŒØÒ §§ Ü×ÑØ*¨4¯>©>×+BÑ+BÐ*Cð D,ð ,ôô —i’i 	¸4Ô@ˆŒÜ—i’i 	¸4Ô@ˆŒÜ—i’i 	¸4Ô@ˆŒÜŸ	š	 )¸TÔBˆŽr1   c                ó   <€ V ^8„  d   QhRS[ P                  RS[ P                  R,          RS[R,          RS[ P                  R,          RS[S[,          RS[S[ P                  S[ P                  R,          3,          /# )r'   Úhidden_statesÚkey_value_statesNÚpast_key_valuesr…   rˆ   Úreturn)r+   r,   r	   r   r   Útuple)r.   rL   s   "€r/   r0   r£   Á   s†   ø€ ÷ H)ñ H)á—|‘|ðH)ñ  Ÿ,™,¨Õ-ðH)ñ  �ð	H)ñ
 Ÿ™ tÕ+ðH)ñ Ñ-Õ.ðH)ñ 
‰u�|‰|™UŸ\™\¨DÕ0Ð0Õ	1ñH)r1   c                óV  € VRJpVP                   RR p. VORNV P                  N5pV P                  V4      P                  V4      P	                  ^^4      p	Rp
Ve`   \        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   XP                  V P                  ,          P                  pVP                  V P                  ,          P                  pMÝV P                  V4      pV P!                  V4      p. VP                   RR ORNV P                  N5pVP                  V4      P	                  ^^4      pVP                  V4      P	                  ^^4      pVeV   XP#                  WÞV P                  4      w  rÞV'       d0   \        V\        4      '       d   RVP                  V P                  &   \$        P&                  ! V P(                  P*                  \,        4      pT! V V	VVV3RV P.                  '       g   RMV P0                  RV P2                  /VB w  ppVP4                  ! . VORN5!  P7                  4       pV P9                  V4      pVV3# )z#Input shape: Batch x Time x ChannelNFTr‡   ç        r†   r6   )r\   r¦   r¬   Úviewr‘   Ú
isinstancer   Ú
is_updatedÚgetr¡   Úcross_attention_cacheÚself_attention_cacheÚlayersÚkeysÚvaluesrª   r«   Úupdater   Úget_interfacer    Ú_attn_implementationr—   r�   r‡   r†   Úreshaper”   r­   )rS   r°   r±   r²   r…   rˆ   Úis_cross_attentionÚinput_shapeÚhidden_shapeÚquery_statesr¹   Úcurr_past_key_valuesÚcurrent_statesÚ
key_statesÚvalue_statesÚkv_shapeÚattention_interfacer–   r•   s   &&&&&,             r/   ra   ÚMBartAttention.forwardÁ   sl  € ð .°TÐ9Ðð $×)Ñ)¨#¨2Ð.ˆà8˜Ð8 bÐ8¨$¯-©-Ñ8ˆð —{‘{ =Ó1×6Ñ6°|ÓD×NÑNÈqÐRSÓTˆàˆ
ØÒ&Ü˜/Ô+>×?Ò?Ø,×7Ñ7×;Ñ;¸D¿N¹NÓK�
ß%à+:×+PÑ+PÑ(à+:×+OÑ+OÑ(à'6Ð$ç-?Ñ)À]ˆß /Ò"=Ç*à-×4Ñ4°T·^±^ÕD×IÑIˆJØ/×6Ñ6°t·~±~ÕF×MÑM‰LàŸ™ ^Ó4ˆJØŸ;™; ~Ó6ˆLØF˜×-Ñ-¨c¨rÐ2ÐF°BÐF¸¿¹ÑFˆHØ#Ÿ™¨Ó2×<Ñ<¸QÀÓBˆJØ'×,Ñ,¨XÓ6×@Ñ@ÀÀAÓFˆLàÒ*Ø+?×+FÑ+FÀzÐae×aoÑaoÓ+pÑ(�
ç%¬*°_ÔFY×*ZÒ*ZØAE�O×.Ñ.¨t¯~©~Ñ>ä(?×(MÒ(MØ�K‰K×,Ñ,Ô.Eó)
Ðñ %8ØØØØØñ	%
ð  $Ÿ}Ÿ}˜}‘C°$·,±,ð	%
ð —L‘Lð	%
ð ñ	%
Ñ!ˆ�\ð "×)Ò)Ð;¨;Ð;¸Ó;×FÑFÓHˆØ—m‘m KÓ0ˆà˜LÐ(Ð(r1   )r    r‡   r›   r¦   rŸ   r�   rª   r¡   rœ   r­   r¬   r†   r«   )r¶   FTFNN©NNNre   rn   s   @@r/   r™   r™   —   s'   ù‡ € ÙG÷%Cõ %C÷NH)÷ H)ò H)r1   r™   c                   óP   a a€ ] tR tRt oV3R lV 3R lltV3R lR ltRtVtV ;t# )ÚMBartEncoderLayeri  c                ó    <€ V ^8„  d   QhRS[ /# ©r'   r    r$   )r.   rL   s   "€r/   r0   ÚMBartEncoderLayer.__annotate__  s   ø€ ÷ =ñ =™{ñ =r1   c                óz  <€ \         SV `  4        VP                  V n        \	        V P                  VP
                  VP                  VR 7      V n        \        P                  ! V P                  4      V n
        VP                  V n        \        VP                  ,          V n        VP                  V n        \        P                   ! V P                  VP"                  4      V n        \        P                   ! VP"                  V P                  4      V n        \        P                  ! V P                  4      V n        R# ))r›   rœ   r‡   r    N)rQ   rR   Úd_modelr›   r™   Úencoder_attention_headsÚattention_dropoutÚ	self_attnr   Ú	LayerNormÚself_attn_layer_normr‡   r   Úactivation_functionÚactivation_fnÚactivation_dropoutr©   Úencoder_ffn_dimÚfc1Úfc2Úfinal_layer_norm©rS   r    rT   s   &&€r/   rR   ÚMBartEncoderLayer.__init__  sÑ   ø€ Ü‰ÑÔØŸ™ˆŒä'Ø—n‘nØ×4Ñ4Ø×,Ñ,Øô	
ˆŒô %'§L¢L°·±Ó$@ˆÔ!Ø—~‘~ˆŒÜ# F×$>Ñ$>Õ?ˆÔØ"(×";Ñ";ˆÔÜ—9’9˜TŸ^™^¨V×-CÑ-CÓDˆŒÜ—9’9˜V×3Ñ3°T·^±^ÓDˆŒÜ "§¢¨T¯^©^Ó <ˆÖr1   c                ó~   <€ V ^8„  d   QhRS[ P                  RS[ P                  RS[S[,          RS[ P                  /# )r'   r°   r…   rˆ   r³   )r+   r,   r   r   )r.   rL   s   "€r/   r0   rÔ     sE   ø€ ÷ "ñ "á—|‘|ð"ñ Ÿ™ð"ñ Ñ+Õ,ð	"ñ
 
�‰ñ"r1   c                ó  € TpV P                  V4      pV P                  ! RRVRV/VB w  r\        P                  P	                  WP                  V P
                  R7      pWA,           pTpV P                  V4      pV P                  V P                  V4      4      p\        P                  P	                  WP                  V P
                  R7      pV P                  V4      p\        P                  P	                  WP                  V P
                  R7      pWA,           pVP                  \        P                  8X  dK   \        P                  ! VP                  4      P                  R,
          p\        P                   ! W) VR7      pV# )a  
Args:
    hidden_states (`torch.FloatTensor`): input to the layer of shape `(batch, seq_len, embed_dim)`
    attention_mask (`torch.FloatTensor`): attention mask of size
        `(batch, 1, tgt_len, src_len)` where padding elements are indicated by very large negative values.
r°   r…   r‹   iè  )ÚminÚmax© )rÛ   rÙ   r   r’   r‡   r�   râ   rÝ   rà   rÞ   rá   rZ   r+   Úfloat16Úfinforè   Úclamp)rS   r°   r…   rˆ   ÚresidualÚ_Úclamp_values   &&&,   r/   ra   ÚMBartEncoderLayer.forward  sI  € ð !ˆØ×1Ñ1°-Ó@ˆØŸ>š>ñ 
Ø'ð
à)ð
ð ñ
Ñˆô
 Ÿ™×-Ñ-¨m¿|¹|ÐVZ×VcÑVcÐ-ÓdˆØ Õ0ˆà ˆØ×-Ñ-¨mÓ<ˆØ×*Ñ*¨4¯8©8°MÓ+BÓCˆÜŸ™×-Ñ-¨m×?VÑ?VÐae×anÑanÐ-ÓoˆØŸ™ Ó/ˆÜŸ™×-Ñ-¨m¿|¹|ÐVZ×VcÑVcÐ-ÓdˆØ Õ0ˆà×Ñ¤%§-¡-Ô/ÜŸ+š+ m×&9Ñ&9Ó:×>Ñ>ÀÕEˆKÜ!ŸKšK¨¸<È[ÔYˆMàÐr1   )	rÞ   rÝ   r‡   r›   rà   rá   râ   rÙ   rÛ   ©	rf   rg   rh   ri   rR   ra   rk   rl   rm   rn   s   @@r/   rÑ   rÑ     s   ù‡ € ÷=ó =÷$"÷ "ð "r1   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# )	ÚMBartDecoderLayeriD  c                ó4   <€ V ^8„  d   QhRS[ RS[R,          /# )r'   r    r¡   N)r%   r-   )r.   rL   s   "€r/   r0   ÚMBartDecoderLayer.__annotate__E  s   ø€ ÷ =ñ =™{ð =±s¸Tµzñ =r1   c           
     ó2  <€ \         SV `  4        VP                  V n        \	        V P                  VP
                  VP                  R R VVR7      V n        VP                  V n        \        VP                  ,          V n        VP                  V n        \        P                  ! V P                  4      V n        \	        V P                  VP
                  VP                  R VVR7      V n        \        P                  ! V P                  4      V n        \        P$                  ! V P                  VP&                  4      V n        \        P$                  ! VP&                  V P                  4      V n        \        P                  ! V P                  4      V n        R# )T)r›   rœ   r‡   r�   rŸ   r    r¡   )r‡   r�   r    r¡   N)rQ   rR   rÖ   r›   r™   Údecoder_attention_headsrØ   rÙ   r‡   r   rÜ   rÝ   rÞ   r   rÚ   rÛ   Úencoder_attnÚencoder_attn_layer_normr©   Údecoder_ffn_dimrà   rá   râ   )rS   r    r¡   rT   s   &&&€r/   rR   ÚMBartDecoderLayer.__init__E  s   ø€ Ü‰ÑÔØŸ™ˆŒä'Ø—n‘nØ×4Ñ4Ø×,Ñ,ØØØØô
ˆŒð —~‘~ˆŒÜ# F×$>Ñ$>Õ?ˆÔØ"(×";Ñ";ˆÔä$&§L¢L°·±Ó$@ˆÔ!Ü*Ø�N‰NØ×*Ñ*Ø×,Ñ,ØØØô
ˆÔô (*§|¢|°D·N±NÓ'CˆÔ$Ü—9’9˜TŸ^™^¨V×-CÑ-CÓDˆŒÜ—9’9˜V×3Ñ3°T·^±^ÓDˆŒÜ "§¢¨T¯^©^Ó <ˆÖr1   c                ó  <€ V ^8„  d   QhRS[ P                  RS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[R,          RS[R,          RS[S[,          R	S[ P                  /# )
r'   r°   r…   NÚencoder_hidden_statesÚencoder_attention_maskr²   Ú	use_cacherˆ   r³   )r+   r,   r	   r¢   r   r   )r.   rL   s   "€r/   r0   rõ   d  sŒ   ø€ ÷ :ñ :á—|‘|ð:ñ Ÿ™ tÕ+ð:ñ  %Ÿ|™|¨dÕ2ð	:ñ
 !&§¡¨tÕ 3ð:ñ  �ð:ñ ˜$•;ð:ñ Ñ+Õ,ð:ñ 
�‰ñ:r1   c                ó&  € TpV P                  V4      pV P                  ! RRVRVRV/VB w  r\        P                  P	                  WP                  V P
                  R7      pW�,           pVem   TpV P                  V4      pV P                  ! RRVRVRVRV/VB w  r\        P                  P	                  WP                  V P
                  R7      pW�,           pTpV P                  V4      pV P                  V P                  V4      4      p\        P                  P	                  WP                  V P
                  R7      pV P                  V4      p\        P                  P	                  WP                  V P
                  R7      pW�,           pV# )a   
Args:
    hidden_states (`torch.FloatTensor`): input to the layer of shape `(batch, seq_len, embed_dim)`
    attention_mask (`torch.FloatTensor`): attention mask of size
        `(batch, 1, tgt_len, src_len)` where padding elements are indicated by very large negative values.
    encoder_hidden_states (`torch.FloatTensor`):
        cross attention input to the layer of shape `(batch, seq_len, embed_dim)`
    encoder_attention_mask (`torch.FloatTensor`): encoder attention mask of size
        `(batch, 1, tgt_len, src_len)` where padding elements are indicated by very large negative values.
    past_key_values (`Cache`): cached past key and value projection states
r°   r²   r…   r‹   r±   ré   )rÛ   rÙ   r   r’   r‡   r�   rù   rø   râ   rÝ   rà   rÞ   rá   )
rS   r°   r…   rý   rþ   r²   rÿ   rˆ   rí   rî   s
   &&&&&&&,  r/   ra   ÚMBartDecoderLayer.forwardd  s   € ð* !ˆØ×1Ñ1°-Ó@ˆð  Ÿ>š>ñ 
Ø'ð
à+ð
ð *ð
ð ñ	
Ñˆô Ÿ™×-Ñ-¨m¿|¹|ÐVZ×VcÑVcÐ-ÓdˆØ Õ0ˆð !Ò,Ø$ˆHØ ×8Ñ8¸ÓGˆMà#×0Ò0ñ  Ø+ð à!6ð ð  6ð ð !0ð	 ð
 ñ ÑˆMô ŸM™M×1Ñ1°-Ç<Á<ÐZ^×ZgÑZgÐ1ÓhˆMØ$Õ4ˆMð !ˆØ×-Ñ-¨mÓ<ˆØ×*Ñ*¨4¯8©8°MÓ+BÓCˆÜŸ™×-Ñ-¨m×?VÑ?VÐae×anÑanÐ-ÓoˆØŸ™ Ó/ˆÜŸ™×-Ñ-¨m¿|¹|ÐVZ×VcÑVcÐ-ÓdˆØ Õ0ˆàÐr1   )rÞ   rÝ   r‡   r›   rø   rù   rà   rá   râ   rÙ   rÛ   rx   )NNNNTrñ   rn   s   @@r/   ró   ró   D  s   ù‡ € ÷=õ =÷>:÷ :ò :r1   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	# )ÚMBartClassificationHeadi¢  z-Head for sentence-level classification tasks.c                ó2   <€ V ^8„  d   QhRS[ RS[ RS[ RS[/# )r'   Ú	input_dimÚ	inner_dimÚnum_classesÚpooler_dropoutrt   )r.   rL   s   "€r/   r0   Ú$MBartClassificationHead.__annotate__¥  s3   ø€ ÷ 
:ñ 
:áð
:ñ ð
:ñ ð	
:ñ
 ñ
:r1   c                óÈ   <€ \         SV `  4        \        P                  ! W4      V n        \        P
                  ! VR 7      V n        \        P                  ! W#4      V n        R# ))rŒ   N)rQ   rR   r   r©   ÚdenseÚDropoutr‡   r­   )rS   r  r  r  r  rT   s   &&&&&€r/   rR   Ú MBartClassificationHead.__init__¥  s@   ø€ ô 	‰ÑÔÜ—Y’Y˜yÓ4ˆŒ
Ü—z’z NÔ3ˆŒÜŸ	š	 )Ó9ˆŽr1   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# )r'   r°   r³   r{   )r.   rL   s   "€r/   r0   r	  ±  s#   ø€ ÷ ñ ¡U§\¡\ð ±e·l±lñ r1   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# rx   )r‡   r  r+   Útanhr­   )rS   r°   s   &&r/   ra   ÚMBartClassificationHead.forward±  sN   € ØŸ™ ]Ó3ˆØŸ
™
 =Ó1ˆÜŸ
š
 =Ó1ˆØŸ™ ]Ó3ˆØŸ™ mÓ4ˆØÐr1   )r  r‡   r­   re   rn   s   @@r/   r  r  ¢  s!   ù‡ € Ù7÷
:ó 
:÷÷ ð r1   r  c                   ón   a a€ ] tR tRt oRtRt. ROtRtRtRt	Rt
V 3R lt]R 4       tV3R ltRtVtV ;t# )	ÚMBartPreTrainedModeliº  ÚmodelTc                ó–   <€ \         SV `  V4       \        V\        4      '       d#   \        P
                  ! VP                  4       R # R # rx   )rQ   Ú_init_weightsr¸   ÚMBartForConditionalGenerationÚinitÚzeros_Úfinal_logits_bias)rS   r�   rT   s   &&€r/   r  Ú"MBartPreTrainedModel._init_weightsÅ  s5   ø€ Ü‰Ñ˜fÔ%Ü�fÔ;×<Ò<Ü�KŠK˜×0Ñ0Ö1ñ =r1   c                ó²   € V P                   P                  p\        P                  ! . RO^ ^^^V..V P                  R7      pRVP                  V4      RV/pV# )r9   ©r[   r…   r(   )r9   é   é
   é   r'   )r    r)   r+   Útensorr[   r=   )rS   Ú	pad_tokenr(   Údummy_inputss   &   r/   r#  Ú!MBartPreTrainedModel.dummy_inputsÊ  s[   € à—K‘K×,Ñ,ˆ	Ü—L’LÒ"2°Q¸¸2¸qÀ)Ð4LÐ!MÐVZ×VaÑVaÔbˆ	à˜iŸl™l¨9Ó5Ø˜ð
ˆð Ðr1   c                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # rÓ   r$   )r.   rL   s   "€r/   r0   Ú!MBartPreTrainedModel.__annotate__º  s   ø‡ ‚ áÑò r1   ré   )ró   rÑ   r™   )rf   rg   rh   ri   Úbase_model_prefixÚsupports_gradient_checkpointingÚ_no_split_modulesÚ_supports_flash_attnÚ_supports_sdpaÚ_supports_flex_attnÚ_can_compile_fullgraphr  Úpropertyr#  Ú__annotate_func__rk   rl   rm   rn   s   @@r/   r  r  º  sP   ù‡ € ð  ÐØ&*Ð#ÚTÐØÐØ€NØÐØ!Ðõ2ð
 ñó ð÷# … r1   r  c            	       ó�   a a€ ] tR tRt oRtR]R]! ]^RR7      /tV3R lV 3R llt	R	 t
]]RV3R
 lR ll4       4       tRtVtV ;t# )ÚMBartEncoderiÕ  zÊ
Transformer encoder consisting of *config.encoder_layers* self attention layers. Each layer is a
[`MBartEncoderLayer`].

Args:
    config: MBartConfig
    embed_tokens (nn.Embedding): output embedding
r°   Ú
attentionsrÙ   ©ÚindexÚ
layer_namec                ó    <€ V ^8„  d   QhRS[ /# rÓ   r$   )r.   rL   s   "€r/   r0   ÚMBartEncoder.__annotate__ä  s   ø€ ÷ ñ ™{ñ r1   c                óð  <€ \         SV `  V4       VP                  V n        VP                  V n        VP
                  pVP                  V n        VP                  V n	        VP                  '       d   \        P                  ! V4      MR p\        VP                  W P                  VR7      V n        \!        VP                  V4      V n        \$        P&                  ! \)        VP*                  4       Uu. uF  p\-        V4      NK  	  up4      V n        Wn        \$        P2                  ! V4      V n        \$        P2                  ! VP
                  4      V n        RV n        V P;                  4        R# u upi )r   r~   FN)rQ   rR   r‡   Úencoder_layerdropÚ	layerdroprÖ   r)   rr   Úmax_position_embeddingsÚmax_source_positionsÚscale_embeddingÚmathÚsqrtrp   Ú
vocab_sizeÚembed_tokensrG   Úembed_positionsr   Ú
ModuleListÚrangeÚencoder_layersrÑ   r½   r    rÚ   Úlayernorm_embeddingÚ
layer_normÚgradient_checkpointingÚ	post_init)rS   r    r›   rs   rî   rT   s   &&   €r/   rR   ÚMBartEncoder.__init__ä  s  ø€ Ü‰Ñ˜Ô à—~‘~ˆŒØ×1Ñ1ˆŒà—N‘Nˆ	Ø!×.Ñ.ˆÔØ$*×$BÑ$BˆÔ!Ø.4×.D×.DÐ.D”d—i’i 	Ô*È#ˆä4Ø×Ñ˜y×*:Ñ*:Èô
ˆÔô  ?Ø×*Ñ*Øó 
ˆÔô —m’mÌÈf×NcÑNcÔHdÓ$eÑHdÀ1Ô%6°vÖ%>ÑHdÑ$eÓfˆŒØŒÜ#%§<¢<°	Ó#:ˆÔ ÜŸ,š, v§~¡~Ó6ˆŒà&+ˆÔ#à�‰Öùò %fs   Ã4E3c                óŒ   € V P                   '       d2   \        V P                  R R4      '       d   V P                  4        R# R# R# )rH  FN)r(  Úgetattrr    Úgradient_checkpointing_enable©rS   s   &r/   Ú._backward_compatibility_gradient_checkpointingÚ;MBartEncoder._backward_compatibility_gradient_checkpointing   s7   € à×/×/Ð/´G¸D¿K¹KÐIaÐch×4iÒ4iØ×.Ñ.Ö0ñ 5jÑ/r1   c                ó¾   <€ V ^8„  d   QhRS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[S[,          RS[S[,          /# )r'   r(   Nr…   Úinputs_embedsrˆ   r³   )r+   Ú
LongTensorr,   ÚFloatTensorr   r   r´   r   )r.   rL   s   "€r/   r0   r7    su   ø€ ÷ @@ñ @@á×#Ñ# dÕ*ð@@ñ Ÿ™ tÕ+ð@@ñ ×(Ñ(¨4Õ/ð	@@ñ
 Ñ+Õ,ð@@ñ 
‘Õ	 ñ@@r1   c                ó¬  € VRJ VRJ,          '       d   \        R4      hVf   V P                  V4      pV P                  VR,          4      pW5P                  VP                  4      ,           pV P                  V4      p\        P                  P                  W`P                  V P                  R7      p\        V P                  VVR7      p\        V P                  4       FU  w  rxRp	V P                  '       d)   \        P                  ! . 4      p
W P                   8  d   Rp	V	'       d   KK  V! VV3/ VB pKW  	  V P#                  V4      p\%        VR7      # )	aƒ  
Args:
    input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
        Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you
        provide it.

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

        [What are input IDs?](../glossary#input-ids)
    attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
        Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:

        - 1 for tokens that are **not masked**,
        - 0 for tokens that are **masked**.

        [What are attention masks?](../glossary#attention-mask)
    inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
        Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation.
        This is useful if you want more control over how to convert `input_ids` indices into associated vectors
        than the model's internal embedding lookup matrix.
Nz:You must specify exactly one of input_ids or inputs_embedsr‹   )r    rR  r…   FT)Úlast_hidden_state).r6   )r;   rA  rB  Útor[   rF  r   r’   r‡   r�   r   r    Ú	enumerater½   r+   Úrandr:  rG  r   )rS   r(   r…   rR  rˆ   Ú	embed_posr°   ÚidxÚencoder_layerÚto_dropÚdropout_probabilitys   &&&&,      r/   ra   ÚMBartEncoder.forward  s/  € ð> ˜Ð -°tÐ";×<Ô<ÜÐYÓZÐZàÒ Ø ×-Ñ-¨iÓ8ˆMà×(Ñ(¨°wÕ)?Ó@ˆ	à%¯©°]×5IÑ5IÓ(JÕJˆØ×0Ñ0°Ó?ˆÜŸ™×-Ñ-¨m¿|¹|ÐVZ×VcÑVcÐ-Ódˆä2Ø—;‘;Ø'Ø)ô
ˆô #,¨D¯K©KÖ"8ÑˆCàˆGØ�}�}ˆ}Ü&+§j¢j°£nÐ#Ø&¯©Ô7Ø"�Gç‘7Ù -Ø!Ø"ñ!ð ñ!’ñ #9ð Ÿ™¨Ó6ˆä°Ô?Ð?r1   )r    r‡   rB  rA  rH  rG  r:  rF  r½   r<  rr   rÏ   )rf   rg   rh   ri   rj   rÑ   r"   r™   Ú_can_record_outputsrR   rO  r!   r#   ra   rk   rl   rm   rn   s   @@r/   r1  r1  Õ  se   ù‡ € ñð 	Ð*Ø‘n ^¸1ÈÔUðÐ÷
ó ò81ð
  Ø÷@@ñ @@ó ó  ÷@@ð @@r1   r1  c                   ó    a a€ ] tR tRt oRtR]R]! ]^RR7      R]! ]^RR7      /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# )ÚMBartDecoderiJ  zº
Transformer decoder consisting of *config.decoder_layers* layers. Each layer is a [`MBartDecoderLayer`]

Args:
    config: MBartConfig
    embed_tokens (nn.Embedding): output embedding
r°   r2  rÙ   r3  Úcross_attentionsrø   c                ó    <€ V ^8„  d   QhRS[ /# rÓ   r$   )r.   rL   s   "€r/   r0   ÚMBartDecoder.__annotate__Y  s   ø€ ÷ ñ ™{ñ r1   c           
     ó,  <€ \         SV `  V4       VP                  V n        VP                  V n        VP
                  V n        VP                  V n        VP                  '       d!   \        P                  ! VP                  4      MR p\        VP                  VP                  V P                  VR7      V n        \!        VP                  VP                  4      V n        \$        P&                  ! \)        VP*                  4       Uu. uF  p\-        WR7      NK  	  up4      V n        Wn        \$        P2                  ! VP                  4      V n        \$        P2                  ! VP                  4      V n        RV n        V P;                  4        R# u upi )r   r~   )r¡   FN)rQ   rR   r‡   Údecoder_layerdropr:  r)   rr   r;  Úmax_target_positionsr=  r>  r?  rÖ   rp   r@  rA  rG   rB  r   rC  rD  Údecoder_layersró   r½   r    rÚ   rF  rG  rH  rI  )rS   r    rs   ÚirT   s   &&  €r/   rR   ÚMBartDecoder.__init__Y  s%  ø€ Ü‰Ñ˜Ô Ø—~‘~ˆŒØ×1Ñ1ˆŒØ!×.Ñ.ˆÔØ$*×$BÑ$BˆÔ!Ø39×3I×3IÐ3I”d—i’i §¡Ô/Èsˆä4Ø×Ñ˜vŸ~™~¨t×/?Ñ/?È[ô
ˆÔô  ?Ø×*Ñ*Ø�N‰Nó 
ˆÔô —m’mÔUZÐ[a×[pÑ[pÔUqÓ$rÑUqÐPQÔ%6°v×%KÑUqÑ$rÓsˆŒØŒä#%§<¢<°·±Ó#?ˆÔ ÜŸ,š, v§~¡~Ó6ˆŒà&+ˆÔ#à�‰Öùò %ss   ÄFc                ó6  <€ V ^8„  d   QhRS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[R,          RS[ P                  R,          RS[R,          R	S[S[,          R
S[S[	,          /	# )r'   r(   Nr…   rý   rþ   r²   rR  rÿ   rˆ   r³   )
r+   rS  r,   rT  r	   r¢   r   r   r´   r   )r.   rL   s   "€r/   r0   re  u  s¹   ø€ ÷ }
ñ }
á×#Ñ# dÕ*ð}
ñ Ÿ™ tÕ+ð}
ñ  %×0Ñ0°4Õ7ð	}
ñ
 !&× 0Ñ 0°4Õ 7ð}
ñ  �ð}
ñ ×(Ñ(¨4Õ/ð}
ñ ˜$•;ð}
ñ Ñ+Õ,ð}
ñ 
Ñ:Õ	:ñ}
r1   c           
     ó*  € VRJ VRJ,          '       d   \        R4      hVf   V P                  V4      pV'       do   Vfk   Vf   V P                  P                  '       d5   \	        \        V P                  R7      \        V P                  R7      4      M\        V P                  R7      pVP                  4       RR w  ršVe   VP                  4       M^ p\        P                  ! W¦P                  R7      V,           pVf;   \        4       '       g+   Wº,           p\        P                  ! W�VP                  R7      p\        V\        4      '       d   VP                  MTp\        V P                  VVVR7      p\!        V P                  VVVR7      pV P#                  WVR7      pWlP%                  VP                  4      ,           pV P'                  V4      p\(        P*                  P-                  VV P,                  V P.                  R7      p\1        V P2                  4       FR  w  ppV P.                  '       d*   \        P4                  ! . 4      pVV P6                  8  d   KA  V! VVV3R	VR
VRV/VB pKT  	  V P9                  V4      p\;        VVR7      # )a 
  
Args:
    input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
        Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you
        provide it.

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

        [What are input IDs?](../glossary#input-ids)
    attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
        Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:

        - 1 for tokens that are **not masked**,
        - 0 for tokens that are **masked**.

        [What are attention masks?](../glossary#attention-mask)
    encoder_hidden_states (`torch.FloatTensor` of shape `(batch_size, encoder_sequence_length, hidden_size)`, *optional*):
        Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention
        of the decoder.
    encoder_attention_mask (`torch.LongTensor` of shape `(batch_size, encoder_sequence_length)`, *optional*):
        Mask to avoid performing cross-attention on padding tokens indices of encoder input_ids. Mask values
        selected in `[0, 1]`:

        - 1 for tokens that are **not masked**,
        - 0 for tokens that are **masked**.

        [What are attention masks?](../glossary#attention-mask)
    past_key_values (`Cache`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
        It is a [`~cache_utils.Cache`] instance. For more details, see our [kv cache guide](https://huggingface.co/docs/transformers/en/kv_cache).

        Contains pre-computed hidden-states (key and values in the self-attention blocks and in the
        cross-attention blocks) that can be used (see `past_key_values` input) to speed up sequential decoding.

        If `past_key_values` are used, the user can optionally input only the last `decoder_input_ids` (those
        that don't have their past key value states given to this model) of shape `(batch_size, 1)` instead of
        all `decoder_input_ids` of shape `(batch_size, sequence_length)`.
    inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
        Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation.
        This is useful if you want more control over how to convert `input_ids` indices into associated vectors
        than the model's internal embedding lookup matrix.
NzTYou cannot specify both decoder_input_ids and decoder_inputs_embeds at the same time)r    r  )r    rR  r…   r²   )r    rR  r…   rý   )rX   r‹   rþ   r²   rÿ   )rV  r²   r6   )r;   rA  r    Úis_encoder_decoderr   r
   r�   Úget_seq_lengthr+   r]   r[   r   Úonesr¸   r¼   r   r   rB  rW  rF  r   r’   r‡   r�   rX  r½   rY  r:  rG  r   )rS   r(   r…   rý   rþ   r²   rR  rÿ   rˆ   Ú
batch_sizeÚ
seq_lengthrW   rX   Úmask_seq_lengthÚself_attn_cacheÚcausal_maskr°   r[  Údecoder_layerr^  s   &&&&&&&&,           r/   ra   ÚMBartDecoder.forwards  sd  € ðn ˜Ð -°tÐ";×<Ô<ÜÐsÓtÐtàÒ Ø ×-Ñ-¨iÓ8ˆM÷ ˜Ò0ð )Ò4¸¿¹×8V×8VÐ8Vô $¤L¸¿¹Ô$DÄlÐZ^×ZeÑZeÔFfÔgä!¨¯©Ô5ð ð "/×!3Ñ!3Ó!5°c°rÐ!:Ñˆ
ØETÒE` ×!?Ñ!?Ô!AÐfgÐÜ—|’| J×7KÑ7KÔLÐOeÕeˆàÒ!Ô*B×*DÒ*Dà4ÕAˆOÜ"ŸZšZ¨
ÈM×L`ÑL`ÔaˆNô ˜/Ô+>×?Ò?ð ×0Ò0à ð 	ô )Ø—;‘;Ø'Ø)Ø+ô	
ˆô ";Ø—;‘;Ø'Ø1Ø"7ô	"
Ðð ×+Ñ+¨IÐ\hÐ+Óiˆà%¯©¸×8LÑ8LÓ(MÕMˆØ×0Ñ0°Ó?ˆäŸ™×-Ñ-¨m¸t¿|¹|ÐVZ×VcÑVcÐ-Ódˆä"+¨D¯K©KÖ"8ÑˆC�à�}�}ˆ}Ü&+§j¢j°£nÐ#Ø&¨¯©Ô7Ùá)ØØØ%ñð (>ð	ð
 !0ðð $ðð ñŠMñ #9ð" Ÿ™¨Ó6ˆä8Ø+Ø+ô
ð 	
r1   )r    r‡   rB  rA  rH  rG  r:  rF  r½   rh  rr   )NNNNNNN)rf   rg   rh   ri   rj   ró   r"   r™   r`  rR   r!   r#   ra   rk   rl   rm   rn   s   @@r/   rb  rb  J  sj   ù‡ € ñð 	Ð*Ø‘n ^¸1ÈÔUØ™N¨>ÀÈ~Ô^ðÐ÷ó ð4  Ø÷}
ñ }
ó ó  ÷}
ð }
r1   rb  c                   ó€   a a€ ] tR tRt o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# )Ú
MBartModeliõ  zdecoder.embed_tokens.weightzshared.weightzencoder.embed_tokens.weightc                ó    <€ V ^8„  d   QhRS[ /# rÓ   r$   )r.   rL   s   "€r/   r0   ÚMBartModel.__annotate__ü  ó   ø€ ÷ ñ ™{ñ r1   c                óT  <€ \         SV `  V4       VP                  VP                  r2VP                  '       d!   \
        P                  ! VP                  4      MR p\        W1P                  W$R7      V n	        \        V4      V n        \        V4      V n        V P                  4        R# )r   r~   N)rQ   rR   r)   r@  r=  r>  r?  rÖ   rp   Úsharedr1  Úencoderrb  ÚdecoderrI  )rS   r    rr   r@  rs   rT   s   &&   €r/   rR   ÚMBartModel.__init__ü  sx   ø€ Ü‰Ñ˜Ô à"(×"5Ñ"5°v×7HÑ7H�ZØ39×3I×3IÐ3I”d—i’i §¡Ô/ÈsˆÜ.¨z¿>¹>È;ÔpˆŒä# FÓ+ˆŒÜ# FÓ+ˆŒð 	�‰Ör1   c                ó   € V P                   # rx   )r~  rN  s   &r/   Úget_input_embeddingsÚMBartModel.get_input_embeddings	  s   € Ø�{‰{Ðr1   c                ó~   € Wn         V P                   V P                  n        V P                   V P                  n        R # rx   )r~  r  rA  r€  ©rS   r„   s   &&r/   Úset_input_embeddingsÚMBartModel.set_input_embeddings  s'   € ØŒØ$(§K¡Kˆ�‰Ô!Ø$(§K¡Kˆ�‰Ö!r1   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[R,          RS[S[,          RS[	S[S[ P                  ,          ,          /# )r'   r(   Nr…   Údecoder_input_idsÚdecoder_attention_maskÚencoder_outputsr²   rR  Údecoder_inputs_embedsrÿ   Úreturn_dictrˆ   r³   )
r+   rS  r,   r´   rT  r	   r¢   r   r   r   )r.   rL   s   "€r/   r0   r{    s  ø€ ÷ S
ñ S
á×#Ñ# dÕ*ðS
ñ Ÿ™ tÕ+ðS
ñ !×+Ñ+¨dÕ2ð	S
ñ
 !&× 0Ñ 0°4Õ 7ðS
ñ ™u¡U×%6Ñ%6Õ7Õ8¸4Õ?ðS
ñ  �ðS
ñ ×(Ñ(¨4Õ/ðS
ñ  %×0Ñ0°4Õ7ðS
ñ ˜$•;ðS
ñ ˜D•[ðS
ñ Ñ+Õ,ðS
ñ 
™e¡E×$5Ñ$5Õ6Õ	6ñS
r1   c                óÈ  € V
e   T
MV P                   P                  p
Vf$   Vf    \        WP                   P                  4      pVf   V P                  ! RRVRVRVRV
/VB pMeV
'       d^   \        V\        4      '       gH   \        V^ ,          \        V4      ^8”  d
   V^,          MR\        V4      ^8”  d
   V^,          MRR7      pV P                  ! RRVRVRV^ ,          RVR	VRVR
V	RV
/VB pV
'       g	   WÅ,           # \        VP                  VP                  VP                  VP                  VP                  VP                  VP                  VP                  R7      # )aµ  
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)

    MBart uses a specific language id token as the starting token for `decoder_input_ids` generation that
    varies according to source and target language, *e.g.* 25004 for *en_XX*, and 25003 for *de_DE*. If
    `past_key_values` is used, optionally only the last `decoder_input_ids` have to be input (see
    `past_key_values`).

    For translation and summarization training, `decoder_input_ids` should be provided. If no
    `decoder_input_ids` is provided, the model will create this tensor by shifting the `input_ids` to the right
    for denoising pre-training following the paper.
decoder_attention_mask (`torch.LongTensor` 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.
Nr(   r…   rR  rŽ  )rV  r°   r2  rý   rþ   r²   rÿ   )rV  r²   Údecoder_hidden_statesÚdecoder_attentionsrc  Úencoder_last_hidden_staterý   Úencoder_attentionsré   )r    rŽ  rE   r)   r  r¸   r   Úlenr€  r   rV  r²   r°   r2  rc  )rS   r(   r…   rŠ  r‹  rŒ  r²   rR  r�  rÿ   rŽ  rˆ   Údecoder_outputss   &&&&&&&&&&&, r/   ra   ÚMBartModel.forward  sž  € ðJ &1Ò%<‘kÀ$Ç+Á+×BYÑBYˆð Ò$Ð)>Ò)FÜ 2°9¿k¹k×>VÑ>VÓ WÐàÒ"Ø"Ÿlšlñ Ø#ðà-ðð ,ðð (ð	ð
 ñ‰O÷ ¤¨O¼_×!MÒ!MÜ-Ø"1°!Õ"4Ü47¸Ó4HÈ1Ô4L˜o¨aÖ0ÐRVÜ14°_Ó1EÈÔ1I˜?¨1Ö-ÈtôˆOð Ÿ,š,ñ 

Ø'ð

à1ð

ð #2°!Õ"4ð

ð $2ð	

ð
 ,ð

ð 0ð

ð  ð

ð $ð

ð ñ

ˆ÷ Ø"Õ4Ð4ä!Ø-×?Ñ?Ø+×;Ñ;Ø"1×"?Ñ"?Ø.×9Ñ9Ø,×=Ñ=Ø&5×&GÑ&GØ"1×"?Ñ"?Ø.×9Ñ9ô	
ð 		
r1   )r€  r  r~  ©
NNNNNNNNNN©rf   rg   rh   ri   Ú_tied_weights_keysrR   rƒ  r‡  r   r   ra   rk   rl   rm   rn   s   @@r/   ry  ry  õ  sW   ù‡ € ð 	& Ø% ðÐ÷
ó òò0ð
 Ø÷S
ñ S
ó ó ÷S
ð S
r1   ry  z€
    The MBART Model with a language modeling head. Can be used for summarization, after fine-tuning the pretrained models.
    )Úcustom_introc                   ó°   a a€ ] tR tRt oRtR.tRR/tV3R lV 3R lltRV3R lV 3R	 llltV3R
 lR lt	]
RV3R lR ll4       tV3R lR ltRtVtV ;t# )r  ii  r  r  úlm_head.weightzmodel.shared.weightc                ó    <€ V ^8„  d   QhRS[ /# rÓ   r$   )r.   rL   s   "€r/   r0   Ú*MBartForConditionalGeneration.__annotate__s  s   ø€ ÷ ñ ™{ñ r1   c                ó�  <€ \         SV `  V4       \        V4      V n        \        P
                  ! \        P                  ! ^V P                  P                  P                  34      4      V n
        \        P                  ! VP                  V P                  P                  P                  RR7      V n        V P                  4        R# )r8   Fr¥   N)rQ   rR   ry  r  r   ÚBufferr+   Úzerosr~  rI   r  r©   rÖ   Úlm_headrI  rã   s   &&€r/   rR   Ú&MBartForConditionalGeneration.__init__s  s€   ø€ Ü‰Ñ˜Ô Ü Ó'ˆŒ
Ü!#§¢¬5¯;ª;¸¸4¿:¹:×;LÑ;L×;[Ñ;[Ð7\Ó+]Ó!^ˆÔÜ—y’y §¡°·±×1BÑ1B×1QÑ1QÐX]Ô^ˆŒð 	�‰Ör1   c                óT   <€ V ^8„  d   QhRS[ RS[ R,          RS[RS[P                  /# )r'   Únew_num_tokensÚpad_to_multiple_ofNÚmean_resizingr³   )r-   r¢   r   Ú	Embedding)r.   rL   s   "€r/   r0   rž  |  s5   ø€ ÷ ñ Ù!ðÙ7:¸TµzðÙY]ðá	�‰ñr1   c                ó€   <€ \         SV `  WV4      pV P                  VP                  P                  ^ ,          4       V# )r9   )rQ   Úresize_token_embeddingsÚ_resize_final_logits_biasr_   r\   )rS   r¥  r¦  r§  Únew_embeddingsrT   s   &&&& €r/   rª  Ú5MBartForConditionalGeneration.resize_token_embeddings|  s<   ø€ ô ™Ñ8¸Ð]jÓkˆØ×&Ñ& ~×'<Ñ'<×'BÑ'BÀ1Õ'EÔFØÐr1   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r'   r¥  r³   NrK   )r.   rL   s   "€r/   r0   rž  ƒ  s   ø€ ÷ 5ñ 5¹ð 5Àñ 5r1   c                ób  € V P                   P                  R,          pW8:  d   V P                   RRV13,          pMX\        P                  ! ^W,
          3V P                   P                  R7      p\        P
                  ! V P                   V.^R7      p\        P                  ! V4      V n         R# )r8   r5   Nr  r3   r6   )r  r\   r+   r¡  r[   Úcatr   r   )rS   r¥  Úold_num_tokensÚnew_biasÚ
extra_biass   &&   r/   r«  Ú7MBartForConditionalGeneration._resize_final_logits_biasƒ  sˆ   € Ø×/Ñ/×5Ñ5°bÕ9ˆØÔ+Ø×-Ñ-¨a°°.°Ð.@ÕA‰HäŸš a¨Õ)HÐ%IÐRV×RhÑRh×RoÑRoÔpˆJÜ—y’y $×"8Ñ"8¸*Ð!EÈ1ÔMˆHÜ!#§¢¨8Ó!4ˆÖr1   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[R,          RS[S[,          RS[	S[S[ P                  ,          ,          /# )r'   r(   Nr…   rŠ  r‹  rŒ  r²   rR  r�  Úlabelsrÿ   rŽ  rˆ   r³   )
r+   rS  r,   r´   rT  r	   r¢   r   r   r   )r.   rL   s   "€r/   r0   rž  �  s  ø€ ÷ z
ñ z
á×#Ñ# dÕ*ðz
ñ Ÿ™ tÕ+ðz
ñ !×+Ñ+¨dÕ2ð	z
ñ
 !&× 0Ñ 0°4Õ 7ðz
ñ ™u¡U×%6Ñ%6Õ7Õ8¸4Õ?ðz
ñ  �ðz
ñ ×(Ñ(¨4Õ/ðz
ñ  %×0Ñ0°4Õ7ðz
ñ × Ñ  4Õ'ðz
ñ ˜$•;ðz
ñ ˜D•[ðz
ñ Ñ+Õ,ðz
ñ 
™5¡×!2Ñ!2Õ3Õ	3ñz
r1   c                ó  € Ve   TMV P                   P                  pV	eG   V
'       d   \        P                  R4       Rp
Vf$   Vf    \	        W�P                   P
                  4      pV P                  ! V3RVRVRVRVRVR	VR
VRV
RV/	VB pV P                  V^ ,          4      V P                  ,           pRpV	eG   \        4       pV! VP                  RV P                   P                  4      V	P                  R4      4      pV'       g"   V3VR,          ,           pVe   V3V,           # T# \        VVVP                  VP                  VP                  VP                   VP"                  VP$                  VP&                  R7	      # )u¾  
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)

    MBart uses a specific language id token as the starting token for `decoder_input_ids` generation that
    varies according to source and target language, *e.g.* 25004 for *en_XX*, and 25003 for *de_DE*. If
    `past_key_values` is used, optionally only the last `decoder_input_ids` have to be input (see
    `past_key_values`).

    For translation and summarization training, `decoder_input_ids` should be provided. If no
    `decoder_input_ids` is provided, the model will create this tensor by shifting the `input_ids` to the right
    for denoising pre-training following the paper.
decoder_attention_mask (`torch.LongTensor` 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, sequence_length)`, *optional*):
    Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
    config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
    (masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.

Example Translation:

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

>>> model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-en-ro")
>>> tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-en-ro")

>>> example_english_phrase = "42 is the answer"
>>> inputs = tokenizer(example_english_phrase, return_tensors="pt")

>>> # Translate
>>> generated_ids = model.generate(**inputs, num_beams=4, max_length=5)
>>> tokenizer.batch_decode(generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
'42 este rÄƒspuns'
```

Mask filling example:

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

>>> model = MBartForConditionalGeneration.from_pretrained("facebook/mbart-large-cc25")
>>> tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")

>>> # de_DE is the language symbol id <LID> for German
>>> TXT = "</s> Meine Freunde sind <mask> nett aber sie essen zu viel Kuchen. </s> de_DE"

>>> input_ids = tokenizer([TXT], add_special_tokens=False, return_tensors="pt")["input_ids"]
>>> logits = model(input_ids).logits

>>> masked_index = (input_ids[0] == tokenizer.mask_token_id).nonzero().item()
>>> probs = logits[0, masked_index].softmax(dim=0)
>>> values, predictions = probs.topk(5)

>>> tokenizer.decode(predictions).split()
['nett', 'sehr', 'ganz', 'nicht', 'so']
```
NzJThe `use_cache` argument is changed to `False` since `labels` is provided.Fr…   rŠ  rŒ  r‹  r²   rR  r�  rÿ   rŽ  r7   ©	ÚlossÚlogitsr²   r�  r‘  rc  r’  rý   r“  r6   )r    rŽ  r§   ÚwarningrE   r)   r  r¢  r  r   r·   r@  r   r²   r�  r‘  rc  r’  rý   r“  )rS   r(   r…   rŠ  r‹  rŒ  r²   rR  r�  r¶  rÿ   rŽ  rˆ   ÚoutputsÚ	lm_logitsÚmasked_lm_lossÚloss_fctÚoutputs   &&&&&&&&&&&&,     r/   ra   Ú%MBartForConditionalGeneration.forwardŒ  s¨  € ð` &1Ò%<‘kÀ$Ç+Á+×BYÑBYˆàÒßÜ—‘ÐkÔlØˆIØ Ò(Ð-BÒ-JÜ$6°v¿{¹{×?WÑ?WÓ$XÐ!à—*’*Øñ
à)ð
ð 0ð
ð ,ð	
ð
 $:ð
ð ,ð
ð (ð
ð #8ð
ð  ð
ð $ð
ð ñ
ˆð —L‘L ¨¥Ó,¨t×/EÑ/EÕEˆ	àˆØÒÜ'Ó)ˆHÙ% i§n¡n°R¸¿¹×9OÑ9OÓ&PÐRX×R]ÑR]Ð^`ÓRaÓbˆNçØ�\ G¨B¥KÕ/ˆFØ3AÒ3M�^Ð%¨Õ.ÐYÐSYÐYäØØØ#×3Ñ3Ø")×"?Ñ"?Ø&×9Ñ9Ø$×5Ñ5Ø&-×&GÑ&GØ")×"?Ñ"?Ø&×9Ñ9ô

ð 
	
r1   c                ó4   <€ V ^8„  d   QhRS[ P                  /# )r'   r¶  r{   )r.   rL   s   "€r/   r0   rž  	  s   ø€ ÷ Dñ D¹E¿L¹Lñ Dr1   c                ó@   € \        WP                  P                  4      # rx   )rE   r    r)   )rS   r¶  s   &&r/   Ú%prepare_decoder_input_ids_from_labelsÚCMBartForConditionalGeneration.prepare_decoder_input_ids_from_labels	  s   € Ü! &¯+©+×*BÑ*BÓCÐCr1   )r  r¢  r  )NT)NNNNNNNNNNN)rf   rg   rh   ri   r'  Ú_keys_to_ignore_on_load_missingr™  rR   rª  r«  r   ra   rÄ  rk   rl   rm   rn   s   @@r/   r  r  i  so   ù‡ € ð  ÐØ':Ð&;Ð#Ø*Ð,AÐBÐ÷ó ÷õ ÷5ð 5ð ÷z
ñ z
ó ðz
÷xD÷ Dð Dr1   r  z†
    MBart model with a sequence classification/head on top (a linear layer on top of the pooled output) e.g. for GLUE
    tasks.
    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
# )ÚMBartForSequenceClassificationi  c                ó    <€ V ^8„  d   QhRS[ /# rÓ   r$   )r.   rL   s   "€r/   r0   Ú+MBartForSequenceClassification.__annotate__  r|  r1   c                óà   <€ \         SV `  ! V3/ VB  \        V4      V n        \	        VP
                  VP
                  VP                  VP                  4      V n        V P                  4        R # rx   )
rQ   rR   ry  r  r  rÖ   Ú
num_labelsÚclassifier_dropoutÚclassification_headrI  )rS   r    rˆ   rT   s   &&,€r/   rR   Ú'MBartForSequenceClassification.__init__  sZ   ø€ Ü‰Ò˜Ñ* 6Ò*Ü Ó'ˆŒ
Ü#:Ø�N‰NØ�N‰NØ×ÑØ×%Ñ%ó	$
ˆÔ ð 	�‰Ör1   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[S[	,          /# )r'   r(   Nr…   rŠ  r‹  rŒ  rR  r�  r¶  rÿ   rˆ   r³   )
r+   rS  r,   ÚlistrT  r¢   r   r   r´   r   )r.   rL   s   "€r/   r0   rÊ  $  sñ   ø€ ÷ l
ñ l
á×#Ñ# dÕ*ðl
ñ Ÿ™ tÕ+ðl
ñ !×+Ñ+¨dÕ2ð	l
ñ
 !&× 0Ñ 0°4Õ 7ðl
ñ ™e×/Ñ/Õ0°4Õ7ðl
ñ ×(Ñ(¨4Õ/ðl
ñ  %×0Ñ0°4Õ7ðl
ñ × Ñ  4Õ'ðl
ñ ˜$•;ðl
ñ Ñ+Õ,ðl
ñ 
Ñ0Õ	0ñl
r1   c
                óB  € Ve   Rp	Vf'   Ve#   \        RV P                  P                   24      h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       WÍR3,          p\        VP                  ^ ,          VP                  ^ ,          ,          ^8¬  R4       VP                  VP!                  ^ 4      RVP!                  R4      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   \/        4       pV P
                  P&                  ^8X  d'   V! VP1                  4       VP1                  4       4      pMšV! VV4      pM�V P
                  P$                  R8X  dH   \3        4       pV! VP                  RV P
                  P&                  4      VP                  R4      4      pM.V P
                  P$                  R8X  d   \5        4       pV! VV4      p\7        VVVP8                  VP:                  VP<                  VP>                  VP@                  VPB                  VPD                  R7	      # )aU  
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)

    Bart uses the `eos_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`).

    For translation and summarization training, `decoder_input_ids` should be provided. If no
    `decoder_input_ids` is provided, the model will create this tensor by shifting the `input_ids` to the right
    for denoising pre-training following the paper.
decoder_attention_mask (`torch.LongTensor` 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.

    If you want to change padding behavior, you should read [`modeling_bart._prepare_decoder_attention_mask`]
    and modify to your needs. See diagram 1 in [the paper](https://huggingface.co/papers/1910.13461) for more
    information on the default strategy.
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 r…   rŠ  r‹  rŒ  rR  r�  rÿ   z7All examples must have the same number of <eos> tokens.r5   z3Each example must contain at least one <eos> token.Ú
regressionÚsingle_label_classificationÚmulti_label_classificationr¸  r6   )r5   r6   r5   )#ÚNotImplementedErrorrT   rf   r  Úeqr    Úeos_token_idrW  r[   r    r+   Úunique_consecutiver>   Únumelr\   r·   r�   rÎ  Úproblem_typerÌ  rZ   r^   r-   r   rA   r   r   r   r²   r�  r‘  rc  r’  rý   r“  )rS   r(   r…   rŠ  r‹  rŒ  rR  r�  r¶  rÿ   rˆ   r¼  r°   Úeos_maskÚselectedÚsentence_representationrº  r¹  r¿  s   &&&&&&&&&&,        r/   ra   Ú&MBartForSequenceClassification.forward!  s&  € ðT ÒØˆIàÒ Ò!:Ü%ØJÈ4Ï>É>×KbÑKbÐJcÐdóð ð '+§j¢jØñ
'
à)ð
'
ð 0ð
'
ð $:ð	
'
ð
 ,ð
'
ð (ð
'
ð #8ð
'
ð  ð
'
ð ñ
'
ˆð   �
ˆà—<‘< §¡× 8Ñ 8Ó9×<Ñ<¸]×=QÑ=QÓRˆäÜ×$Ò$ X§\¡\°!£_Ó5×;Ñ;Ó=ÀÑBØEô	
ð !¨1 Õ-ˆÜØ�N‰N˜1Õ ×!4Ñ!4°QÕ!7Õ7¸1Ñ<ØAô	
ð #+§-¡-°×0BÑ0BÀ1Ó0EÀrÈ=×K]ÑK]Ð^`ÓKaÓ"bÐckÕ"lÐØ×)Ñ)Ð*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ô

ð 
	
r1   )rÎ  r  )	NNNNNNNNN©rf   rg   rh   ri   rR   r   r   ra   rk   rl   rm   rn   s   @@r/   rÈ  rÈ    s9   ù‡ € ÷ó ð Ø÷l
ñ l
ó ó ÷l
ð l
r1   rÈ  c                   ó\   a a€ ] tR tRt oV 3R lt]]RV3R lR ll4       4       tRtVt	V ;t
# )ÚMBartForQuestionAnsweringi“  c                óö   <€ \         SV `  V4       ^Vn        VP                  V n        \        V4      V n        \
        P                  ! VP                  VP                  4      V n        V P                  4        R# rO   )
rQ   rR   rÌ  ry  r  r   r©   Úhidden_sizeÚ
qa_outputsrI  rã   s   &&€r/   rR   Ú"MBartForQuestionAnswering.__init__•  s[   ø€ Ü‰Ñ˜Ô àˆÔØ ×+Ñ+ˆŒä Ó'ˆŒ
ÜŸ)š) F×$6Ñ$6¸×8IÑ8IÓJˆŒð 	�‰Ör1   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[ P                  R,          RS[R,          RS[S[,          RS[S[	,          /# )r'   r(   Nr…   rŠ  r‹  rŒ  Ústart_positionsÚend_positionsrR  r�  rÿ   rˆ   r³   )
r+   r,   rS  rÑ  rT  r¢   r   r   r´   r   )r.   rL   s   "€r/   r0   Ú&MBartForQuestionAnswering.__annotate__¤  s  ø€ ÷ W
ñ W
á—<‘< $Õ&ðW
ñ Ÿ™ tÕ+ðW
ñ !×+Ñ+¨dÕ2ð	W
ñ
 !&× 0Ñ 0°4Õ 7ðW
ñ ™e×/Ñ/Õ0°4Õ7ðW
ñ ×)Ñ)¨DÕ0ðW
ñ ×'Ñ'¨$Õ.ðW
ñ ×(Ñ(¨4Õ/ðW
ñ  %×0Ñ0°4Õ7ðW
ñ ˜$•;ðW
ñ Ñ+Õ,ðW
ñ 
Ñ4Õ	4ñW
r1   c                ó~  € Ve   Ve   R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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       4      ^8”  d   VP                  R4      pVP                  ^4      pVP                  ^ V4      pVP                  ^ V4      p\        VR7      pV! Wö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
      # )aC  
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)

    Bart uses the `eos_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`).

    For translation and summarization training, `decoder_input_ids` should be provided. If no
    `decoder_input_ids` is provided, the model will create this tensor by shifting the `input_ids` to the right
    for denoising pre-training following the paper.
decoder_attention_mask (`torch.LongTensor` 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.

    If you want to change padding behavior, you should read [`modeling_bart._prepare_decoder_attention_mask`]
    and modify to your needs. See diagram 1 in [the paper](https://huggingface.co/papers/1910.13461) for more
    information on the default strategy.
NFr…   rŠ  r‹  rŒ  rR  r�  rÿ   r3   )Úignore_index)
r¹  Ústart_logitsÚ
end_logitsr²   r�  r‘  rc  r’  rý   r“  r6   )r  rå  ÚsplitrA   r”   r”  r�   rì   r   r   r²   r�  r‘  rc  r’  rý   r“  )rS   r(   r…   rŠ  r‹  rŒ  rè  ré  rR  r�  rÿ   rˆ   r¼  Úsequence_outputrº  rí  rî  Ú
total_lossÚignored_indexr¿  Ú
start_lossÚend_losss   &&&&&&&&&&&,          r/   ra   Ú!MBartForQuestionAnswering.forward¡  sê  € ðP Ò&¨=Ò+DØˆIà&*§j¢jØñ
'
à)ð
'
ð 0ð
'
ð $:ð	
'
ð
 ,ð
'
ð (ð
'
ð #8ð
'
ð  ð
'
ð ñ
'
ˆð " !�*ˆà—‘ Ó1ˆØ#)§<¡<°°r <Ó#:Ñ ˆ�jØ#×+Ñ+¨BÓ/×:Ñ:Ó<ˆØ×'Ñ'¨Ó+×6Ñ6Ó8ˆ
àˆ
ØÒ&¨=Ò+Dä�?×'Ñ'Ó)Ó*¨QÔ.Ø"1×"9Ñ"9¸"Ó"=�Ü�=×%Ñ%Ó'Ó(¨1Ô,Ø -× 5Ñ 5°bÓ 9�à(×-Ñ-¨aÓ0ˆMØ-×3Ñ3°A°}ÓEˆOØ)×/Ñ/°°=ÓAˆMä'°]ÔCˆHÙ! ,Ó@ˆJÙ 
¨MÓ:ˆHØ$ xÕ/°1Õ4ˆJä2ØØ%Ø!Ø#×3Ñ3Ø")×"?Ñ"?Ø&×9Ñ9Ø$×5Ñ5Ø&-×&GÑ&GØ")×"?Ñ"?Ø&×9Ñ9ô
ð 	
r1   )r  rÌ  rå  r—  rà  rn   s   @@r/   râ  râ  “  s4   ù‡ € õ
ð Ø÷W
ñ W
ó ó ÷W
ð W
r1   râ  c                   ó<   a a€ ] tR tRt oRtV 3R ltR tRtVtV ;t	# )ÚMBartDecoderWrapperiÿ  z±
This wrapper class is a helper class to correctly load pretrained checkpoints when the causal language model is
used in combination with the [`EncoderDecoderModel`] framework.
c                óf   <€ \         SV `  V4       \        V4      V n        V P	                  4        R # rx   )rQ   rR   rb  r€  rI  rã   s   &&€r/   rR   ÚMBartDecoderWrapper.__init__  s&   ø€ Ü‰Ñ˜Ô Ü# FÓ+ˆŒØ�‰Ör1   c                ó&   € V P                   ! V/ VB # rx   ©r€  )rS   Úargsrˆ   s   &*,r/   ra   ÚMBartDecoderWrapper.forward
  s   € Ø�|Š|˜TÐ, VÑ,Ð,r1   rû  re   rn   s   @@r/   r÷  r÷  ÿ  s   ù‡ € ñõ
÷
-ò -r1   r÷  c                   óp   a a€ ] tR tRt oRR/tV 3R ltR tR t]]	R
V3R lR ll4       4       t
R	tVtV ;t# )ÚMBartForCausalLMi  rœ  z!model.decoder.embed_tokens.weightc                óæ   <€ R Vn         RVn        \        SV `  V4       \	        V4      V n        \        P                  ! VP                  VP                  RR7      V n
        V P                  4        R# )TFr¥   N)r�   rn  rQ   rR   r÷  r  r   r©   rä  r@  r¢  rI  rã   s   &&€r/   rR   ÚMBartForCausalLM.__init__  sX   ø€ Ø ˆÔØ$)ˆÔ!Ü‰Ñ˜Ô Ü(¨Ó0ˆŒ
ä—y’y ×!3Ñ!3°V×5FÑ5FÈUÔSˆŒð 	�‰Ör1   c                óB   € V P                   P                  P                  # rx   ©r  r€  rA  rN  s   &r/   rƒ  Ú%MBartForCausalLM.get_input_embeddings  s   € Ø�z‰z×!Ñ!×.Ñ.Ð.r1   c                ó:   € WP                   P                  n        R # rx   r  r†  s   &&r/   r‡  Ú%MBartForCausalLM.set_input_embeddings"  s   € Ø*/�
‰
×ÑÖ'r1   c                óˆ  <€ V ^8„  d   QhRS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[R,          RS[ P                  R,          RS[ P                  R,          R	S[R,          R
S[S[ P                  ,          RS[S[,          RS[	S[
,          /# )r'   r(   Nr…   rý   rþ   r²   rR  r¶  rÿ   Úlogits_to_keeprˆ   r³   )r+   rS  r,   rT  r	   r¢   r-   r   r   r´   r   )r.   rL   s   "€r/   r0   ÚMBartForCausalLM.__annotate__'  sã   ø€ ÷ A
ñ A
á×#Ñ# dÕ*ðA
ñ Ÿ™ tÕ+ðA
ñ  %×0Ñ0°4Õ7ð	A
ñ
 !&× 1Ñ 1°DÕ 8ðA
ñ  �ðA
ñ ×(Ñ(¨4Õ/ðA
ñ × Ñ  4Õ'ðA
ñ ˜$•;ðA
ñ ™eŸl™lÕ*ðA
ñ Ñ+Õ,ðA
ñ 
Ñ2Õ	2ñA
r1   c
                ó(  € V P                   P                  ! RRVRVRVRVRVRVRV/V
B pV^ ,          p\        V	\        4      '       d   \	        V	) R4      MT	pV P                  VR	VR	3,          4      pRpVeb   VP                  VP                  4      p\        4       pV! VP                  RV P                  P                  4      VP                  R4      4      p\        VVVP                  VP                  VP                  VP                   R
7      # )aÈ  
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
    Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
    config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
    (masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.

Example:

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

>>> tokenizer = AutoTokenizer.from_pretrained("facebook/mbart-large-cc25")
>>> model = MBartForCausalLM.from_pretrained("facebook/mbart-large-cc25")
>>> assert model.config.is_decoder, f"{model.__class__} has to be configured as a decoder."
>>> inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
>>> outputs = model(**inputs)

>>> logits = outputs.logits
>>> expected_shape = [1, inputs.input_ids.shape[-1], model.config.vocab_size]
>>> list(logits.shape) == expected_shape
True
```r(   r…   rý   rþ   r²   rR  rÿ   Nr5   )r¹  rº  r²   r°   r2  rc  ré   r6   )r  r€  r¸   r-   Úslicer¢  rW  r[   r   r·   r    r@  r   r²   r°   r2  rc  )rS   r(   r…   rý   rþ   r²   rR  r¶  rÿ   r  rˆ   r¼  r°   Úslice_indicesrº  r¹  r¿  s   &&&&&&&&&&,      r/   ra   ÚMBartForCausalLM.forward%  s/  € ðL >B¿Z¹Z×=OÒ=Oñ 	>
Øð	>
à)ð	>
ð #8ð	>
ð $:ð		>
ð
 ,ð	>
ð (ð	>
ð  ð	>
ð ñ	>
ˆð   �
ˆä8BÀ>ÔSV×8WÒ8Wœ˜~˜o¨tÔ4Ð]kˆØ—‘˜m¨A¨}¸aÐ,?Õ@ÓAˆàˆØÒØ—Y‘Y˜vŸ}™}Ó-ˆFÜ'Ó)ˆHÙ˜FŸK™K¨¨D¯K©K×,BÑ,BÓCÀVÇ[Á[ÐQSÃ_ÓUˆDä0ØØØ#×3Ñ3Ø!×/Ñ/Ø×)Ñ)Ø$×5Ñ5ô
ð 	
r1   )r¢  r  )	NNNNNNNNr9   r˜  rn   s   @@r/   rÿ  rÿ    sL   ù‡ € àÐ=ðÐõ	ò/ò0ð Ø÷A
ñ A
ó ó ÷A
ð A
r1   rÿ  )Nr¶   )rÿ  r  râ  rÈ  ry  r  )Nrj   r>  Úcollections.abcr   r+   r   Útorch.nnr   r   r   Ú r   r  Úactivationsr   Úcache_utilsr	   r
   r   Ú
generationr   Úmasking_utilsr   r   Úmodeling_flash_attention_utilsr   Úmodeling_layersr   Úmodeling_outputsr   r   r   r   r   r   r   Úmodeling_utilsr   r   Úprocessing_utilsr   Úutilsr   r   r   r   r   r    Úutils.genericr!   Úutils.output_capturingr"   r#   Úconfiguration_mbartr%   Ú
get_loggerrf   r§   rE   r¨  rG   rp   r—   r‰   r™   rÑ   ró   r  r  r1  rb  ry  r  rÈ  râ  r÷  rÿ  Ú__all__ré   r1   r/   Ú<module>r      sÞ  ðñ ã Ý $ã Ý ß AÑ Aå &Ý !ß CÑ CÝ )ß Jõõ :÷÷ ñ ÷ GÝ &÷÷ õ 8ß EÝ ,ð 
×	Ò	˜HÓ	%€õô*; b§l¡lô ;ô8
=˜rŸ|™|ô 
=÷%ô:r)�R—Y‘Yô r)ôj5Ð2ô 5ôpZÐ2ô Zô|˜bŸi™iô ð0 ô˜?ó ó ðô4r@Ð'ô r@ôjh
Ð'ô h
ðV ôp
Ð%ó p
ó ðp
ñf ðôô
\DÐ$8¸/ó \Dóð
\Dñ~ ðôô}
Ð%9ó }
óð}
ð@ ôg
Ð 4ó g
ó ðg
ôV-Ð.ô -ô Y
Ð+¨_ô Y
òx‚r1   