+
    œ°³j6Ù  ã                   ó®  € 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 ^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/H0t0 ^RI1H2t2 ^RI3H4t4H5t5 ^RI6H7t7 ]/Pp                  ! ]94      t:R R lt; ! R R]Px                  4      t= ! R R]Px                  4      t>R=R R llt? ! R R]P€                  4      tA ! R R]4      tB ! R R ]4      tC ! R! R"]P€                  4      tD], ! R# R$]'4      4       tE ! R% R&]E4      tF ! R' R(]E4      tG ! R) R*]E4      tH ! R+ R,]E4      tI], ! R- R.]E4      4       tJ],! R/R07       ! R1 R2]E]4      4       tK],! R3R07       ! R4 R5]E4      4       tL], ! R6 R7]E4      4       tM ! R8 R9]E4      tN],! R:R07       ! R; R<]E]4      4       tO. R>OtPR# )?zPyTorch BART 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©Ú
BartConfigc                óP   € V ^8„  d   QhR\         P                  R\        R\        /# )é   Ú	input_idsÚpad_token_idÚdecoder_start_token_id©ÚtorchÚTensorÚint)Úformats   "Úg/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/bart/modeling_bart.pyÚ__annotate__r1   :   s&   € ÷ ñ ¤%§,¡,ð ¼cð Ô[^ñ ó    c                óÈ   € 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# )z)
Shift input ids one token to the right.
ºNNNNz1self.model.config.pad_token_id has to be defined.éÿÿÿÿ)r4   :é   NN)r4   é    iœÿÿÿ)Ú	new_zerosÚshapeÚcloneÚ
ValueErrorÚmasked_fill_)r(   r)   r*   Úshifted_input_idss   &&& r0   Úshift_tokens_rightr>   :   sp   € ð "×+Ñ+¨I¯O©OÓ<ÐØ(¨¨C¨R¨C¨Õ0×6Ñ6Ó8Ð�eÑØ4�dÑàÒÜÐLÓMÐMà×"Ñ"Ð#4¸Ñ#<¸lÔKàÐr2   c                   ó^   a a€ ] tR t^Jt 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	# )ÚBartLearnedPositionalEmbeddingzF
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   "€r0   r1   Ú+BartLearnedPositionalEmbedding.__annotate__O   s   ø€ ÷ Fñ F¡sð F¹3ñ Fr2   c                óV   <€ ^V n         \        SV `	  WP                   ,           V4       R# ©r'   N)ÚoffsetÚsuperÚ__init__)ÚselfrB   rC   Ú	__class__s   &&&€r0   rK   Ú'BartLearnedPositionalEmbedding.__init__O   s"   ø€ ð ˆŒÜ‰Ñ˜¯+©+Õ5°}ÖEr2   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/   rE   s   "€r0   r1   rF   U   s5   ø€ ÷ ;ñ ;ÙŸ™ð;Ù?Bð;ÙV[×VbÑVbÐeiÕViñ;r2   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Údevicer5   )r9   r,   ÚarangeÚlongÚweightrT   ÚexpandÚ	unsqueezerJ   ÚforwardrI   )rL   r(   rP   rQ   ÚbszÚseq_lenrM   s   &&&&  €r0   rZ   Ú&BartLearnedPositionalEmbedding.forwardU   s   ø€ ð
 ÒØ$Ÿ?™?¨2Õ.‰LˆCÜ Ÿ<š<Ø&ÀÕ(HÔPU×PZÑPZÐcg×cnÑcn×cuÑcuôç‰f�S˜"‹oñ ð (×1Ñ1°!Ó4ˆLä‰w‰˜|¯k©kÕ9Ó:Ð:r2   )rI   )r7   N©
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rK   rZ   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©rM   rE   s   @@r0   r@   r@   J   s%   ù‡ € ñ÷Fó F÷;÷ ;õ ;r2   r@   c                   ó^   a a€ ] tR t^et 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	# )ÚBartScaledWordEmbeddingzT
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'   rB   rC   Úpadding_idxÚembed_scaleN©r.   Úfloat)r/   rE   s   "€r0   r1   Ú$BartScaledWordEmbedding.__annotate__j   s0   ø€ ÷ 'ñ '¡sð '¹3ð 'ÉSð 'Ñ_dÐgkÕ_kñ 'r2   c                ó4   <€ \         SV `  WV4       W@n        R # ©N)rJ   rK   rl   )rL   rB   rC   rk   rl   rM   s   &&&&&€r0   rK   Ú BartScaledWordEmbedding.__init__j   s   ø€ Ü‰Ñ˜¸ÔDØ&Ör2   c                ó4   <€ V ^8„  d   QhRS[ P                  /# )r'   r(   ©r,   r-   )r/   rE   s   "€r0   r1   ro   n   s   ø€ ÷ =ñ =¡§¡ñ =r2   c                óD   <€ \         SV `  V4      V P                  ,          # rq   )rJ   rZ   rl   )rL   r(   rM   s   &&€r0   rZ   ÚBartScaledWordEmbedding.forwardn   s   ø€ Ü‰w‰˜yÓ)¨D×,<Ñ,<Õ<Ð<r2   ©rl   )ç      ð?r^   rg   s   @@r0   ri   ri   e   s#   ù‡ € ñ÷'õ '÷=÷ =ó =r2   ri   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-   rn   r   r   )r/   s   "r0   r1   r1   s   s{   € ÷ %ñ %Ü�I‰Ið%ä�<‰<ð%ô 
�‰ð%ô �<‰<ð	%ô
 —L‘L 4Õ'ð%ô �T�\ð%ô ð%ô Ô'Õ(ñ%r2   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# )N©Údim©ÚpÚtrainingr5   ç      à¿)
Úsizer,   ÚmatmulÚ	transposer   Ú
functionalÚsoftmaxr€   rˆ   Ú
contiguous)
rz   r{   r|   r}   r~   r   r€   r�   Úattn_weightsÚattn_outputs
   &&&&&&&,  r0   Úeager_attention_forwardr’   s   s±   € ð ‚Ø—*‘*˜R“. DÕ(ˆô —<’< §}¡}°Q¸Ó':Ó;¸gÕE€LàÒ!Ø#Õ4ˆä—=‘=×(Ñ(¨¸2Ð(Ó>€LÜ—=‘=×(Ñ(¨È6Ï?É?Ð(Ó[€Lä—,’,˜|Ó3€KØ×'Ñ'¨¨1Ó-×8Ñ8Ó:€KàÐ$Ð$r2   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	# )	ÚBartAttentionz=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.   rn   Úboolr%   )r/   rE   s   "€r0   r1   ÚBartAttention.__annotate__’   sn   ø€ ÷ %Cñ %Cáð%Cñ ð%Cñ ð	%Cñ
 ð%Cñ ð%Cñ ð%Cñ ˜TÕ!ð%Cñ ˜•:ñ%Cr2   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‰   )rJ   rK   r–   r—   r€   Úhead_dimr›   r;   r   r˜   rš   rœ   ÚloggerÚwarning_oncerM   r_   r   ÚLinearÚk_projÚv_projÚq_projÚout_proj)
rL   r–   r—   r€   r˜   r™   rš   r›   rœ   rM   s
   &&&&&&&&&€r0   rK   ÚBartAttention.__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ˆŽr2   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/   rE   s   "€r0   r1   rž   ¹   s†   ø€ ÷ H)ñ H)á—|‘|ðH)ñ  Ÿ,™,¨Õ-ðH)ñ  �ð	H)ñ
 Ÿ™ tÕ+ðH)ñ Ñ-Õ.ðH)ñ 
‰u�|‰|™UŸ\™\¨DÕ0Ð0Õ	1ñH)r2   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   r5   )r9   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¨   )rL   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   &&&&&,             r0   rZ   ÚBartAttention.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Ð(Ð(r2   )r›   r€   r–   r¡   rš   r˜   r¥   rœ   r—   r¨   r§   r   r¦   )r±   FTFNN©NNNr^   rg   s   @@r0   r”   r”   �   s'   ù‡ € ÙG÷%Cõ %C÷NH)÷ H)ò H)r2   r”   c                   óT   a a€ ] tR tRt oRV3R lV 3R llltV3R lR ltRtVtV ;t# )ÚBartEncoderLayeri  c                ó4   <€ V ^8„  d   QhRS[ RS[R,          /# ©r'   r›   rœ   N©r%   r.   )r/   rE   s   "€r0   r1   ÚBartEncoderLayer.__annotate__  s   ø€ ÷ =ñ =™zð =±c¸Dµjñ =r2   c                ó|  <€ \         SV `  4        VP                  V n        \	        V P                  VP
                  VP                  V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›   rœ   N)rJ   rK   Ú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©rL   r›   rœ   rM   s   &&&€r0   rK   ÚBartEncoderLayer.__init__  sÔ   ø€ Ü‰ÑÔØŸ™ˆŒä&Ø—n‘nØ×4Ñ4Ø×,Ñ,ØØô
ˆŒô %'§L¢L°·±Ó$@ˆÔ!Ø—~‘~ˆŒÜ# F×$>Ñ$>Õ?ˆÔØ"(×";Ñ";ˆÔÜ—9’9˜TŸ^™^¨V×-CÑ-CÓDˆŒÜ—9’9˜V×3Ñ3°T·^±^ÓDˆŒÜ "§¢¨T¯^©^Ó <ˆÖr2   c                ó~   <€ V ^8„  d   QhRS[ P                  RS[ P                  RS[S[,          RS[ P                  /# )r'   r«   r~   r�   r®   )r,   ÚFloatTensorr   r   r-   )r/   rE   s   "€r0   r1   rÐ     sI   ø€ ÷ ñ á×(Ñ(ðñ ×)Ñ)ðñ Ñ+Õ,ð	ñ
 
�‰ñr2   c                óf  € TpV P                   ! V3R V/VB w  r\        P                  P                  WP                  V P                  R7      pWA,           pV P                  V4      pT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                  V4      pVP                  \        P                  8X  du   \        P                  ! V4      P                  4       '       gK   \        P                   ! VP                  4      P"                  R,
          p\        P$                  ! W) VR7      pV# )r~   r†   iè  )ÚminÚmax)rÕ   r   r�   r€   rˆ   r×   rÙ   rÜ   rÚ   rÝ   rÞ   rS   r,   Úfloat16ÚisfiniteÚallÚfinforå   Úclamp)rL   r«   r~   r�   ÚresidualÚ_Úclamp_values   &&&,   r0   rZ   ÚBartEncoderLayer.forward  s[  € ð !ˆØŸ>š>Øñ
à)ð
ð ñ
Ñˆô
 Ÿ™×-Ñ-¨m¿|¹|ÐVZ×VcÑVcÐ-ÓdˆØ Õ0ˆØ×1Ñ1°-Ó@ˆà ˆØ×*Ñ*¨4¯8©8°MÓ+BÓCˆÜŸ™×-Ñ-¨m×?VÑ?VÐae×anÑanÐ-ÓoˆØŸ™ Ó/ˆÜŸ™×-Ñ-¨m¿|¹|ÐVZ×VcÑVcÐ-ÓdˆØ Õ0ˆØ×-Ñ-¨mÓ<ˆà×Ñ¤%§-¡-Ô/¼¿ºÀ}Ó8U×8YÑ8Y×8[Ò8[ÜŸ+š+ m×&9Ñ&9Ó:×>Ñ>ÀÕEˆKÜ!ŸKšK¨¸<È[ÔYˆMàÐr2   )	rÚ   rÙ   r€   r–   rÜ   rÝ   rÞ   rÕ   r×   rq   ©	r_   r`   ra   rb   rK   rZ   rd   re   rf   rg   s   @@r0   rÌ   rÌ     s   ù‡ € ÷=õ =÷&÷ ð r2   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# )	ÚBartDecoderLayeri7  c                ó4   <€ V ^8„  d   QhRS[ RS[R,          /# rÎ   rÏ   )r/   rE   s   "€r0   r1   ÚBartDecoderLayer.__annotate__8  s   ø€ ÷ =ñ =™zð =±c¸Dµjñ =r2   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)rJ   rK   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Þ   rß   s   &&&€r0   rK   ÚBartDecoderLayer.__init__8  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¯^©^Ó <ˆÖr2   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/   rE   s   "€r0   r1   ró   W  sŒ   ø€ ÷ /ñ /á—|‘|ð/ñ Ÿ™ tÕ+ð/ñ  %Ÿ|™|¨dÕ2ð	/ñ
 !&§¡¨tÕ 3ð/ñ  �ð/ñ ˜$•;ð/ñ Ñ+Õ,ð/ñ 
�‰ñ/r2   c           	     ó"  € TpV P                   ! V3R VRV/VB w  r\        P                  P                  WP                  V P                  R7      pW�,           pV P                  V4      pVel   TpV P                  ! V3RVRVR V/VB w  r\        P                  P                  WP                  V P                  R7      pW�,           pV P                  V4      pT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 P                  V4      pV# )r­   r~   r†   r¬   )rÕ   r   r�   r€   rˆ   r×   rö   r÷   rÙ   rÜ   rÚ   rÝ   rÞ   )
rL   r«   r~   rû   rü   r­   rý   r�   rë   rì   s
   &&&&&&&,  r0   rZ   ÚBartDecoderLayer.forwardW  s–  € ð !ˆð  Ÿ>š>Øñ
à+ð
ð *ð
ð ñ	
Ñˆô Ÿ™×-Ñ-¨m¿|¹|ÐVZ×VcÑVcÐ-ÓdˆØ Õ0ˆØ×1Ñ1°-Ó@ˆð !Ò,Ø$ˆHà#×0Ò0Øñ à!6ð ð  6ð ð !0ð	 ð
 ñ ÑˆMô ŸM™M×1Ñ1°-Ç<Á<ÐZ^×ZgÑZgÐ1ÓhˆMØ$Õ4ˆMØ ×8Ñ8¸ÓGˆMð !ˆØ×*Ñ*¨4¯8©8°MÓ+BÓCˆÜŸ™×-Ñ-¨m×?VÑ?VÐae×anÑanÐ-ÓoˆØŸ™ Ó/ˆÜŸ™×-Ñ-¨m¿|¹|ÐVZ×VcÑVcÐ-ÓdˆØ Õ0ˆØ×-Ñ-¨mÓ<ˆàÐr2   )rÚ   rÙ   r€   r–   rö   r÷   rÜ   rÝ   rÞ   rÕ   r×   rq   )NNNNTrï   rg   s   @@r0   rñ   rñ   7  s   ù‡ € ÷=õ =÷>/÷ /ò /r2   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	# )ÚBartClassificationHeadi‰  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_dropoutrm   )r/   rE   s   "€r0   r1   Ú#BartClassificationHead.__annotate__Œ  s3   ø€ ÷ 
:ñ 
:áð
:ñ ð
:ñ ð	
:ñ
 ñ
:r2   c                óÈ   <€ \         SV `  4        \        P                  ! W4      V n        \        P
                  ! VR 7      V n        \        P                  ! W#4      V n        R# ))r‡   N)rJ   rK   r   r¤   ÚdenseÚDropoutr€   r¨   )rL   r  r  r  r  rM   s   &&&&&€r0   rK   ÚBartClassificationHead.__init__Œ  s@   ø€ ô 	‰ÑÔÜ—Y’Y˜yÓ4ˆŒ
Ü—z’z NÔ3ˆŒÜŸ	š	 )Ó9ˆŽr2   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# )r'   r«   r®   rt   )r/   rE   s   "€r0   r1   r  ˜  s#   ø€ ÷ ñ ¡U§\¡\ð ±e·l±lñ r2   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# rq   )r€   r	  r,   Útanhr¨   )rL   r«   s   &&r0   rZ   ÚBartClassificationHead.forward˜  sN   € ØŸ™ ]Ó3ˆØŸ
™
 =Ó1ˆÜŸ
š
 =Ó1ˆØŸ™ ]Ó3ˆØŸ™ mÓ4ˆØÐr2   )r	  r€   r¨   r^   rg   s   @@r0   r  r  ‰  s!   ù‡ € Ù7÷
:ó 
:÷÷ ð r2   r  c                   ó|   a a€ ] tR tRt oRtRtRR.tRR.tR.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# )ÚBartPreTrainedModeli¡  ÚmodelTzencoder.versionzdecoder.versionrÌ   rñ   r­   c                ó–   <€ \         SV `  V4       \        V\        4      '       d#   \        P
                  ! VP                  4       R # R # rq   )rJ   Ú_init_weightsr³   ÚBartForConditionalGenerationÚinitÚzeros_Úfinal_logits_bias)rL   rz   rM   s   &&€r0   r  Ú!BartPreTrainedModel._init_weights¯  s5   ø€ Ü‰Ñ˜fÔ%Ü�fÔ:×;Ò;Ü�KŠK˜×0Ñ0Ö1ñ <r2   c                ó²   € V P                   P                  p\        P                  ! . RO^ ^^^V..V P                  R7      pRVP                  V4      RV/pV# )r7   ©rT   r~   r(   )r7   é   é
   é   r'   )r›   r)   r,   ÚtensorrT   Úne)rL   Ú	pad_tokenr(   Údummy_inputss   &   r0   r"  Ú BartPreTrainedModel.dummy_inputs´  s[   € à—K‘K×,Ñ,ˆ	Ü—L’LÒ"2°Q¸¸2¸qÀ)Ð4LÐ!MÐVZ×VaÑVaÔbˆ	à˜iŸl™l¨9Ó5Ø˜ð
ˆð Ðr2   c                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # ©r'   r›   r$   )r/   rE   s   "€r0   r1   Ú BartPreTrainedModel.__annotate__¡  s   ø‡ ‚ áÑò r2   © )r_   r`   ra   rb   Úbase_model_prefixÚsupports_gradient_checkpointingÚ"_keys_to_ignore_on_load_unexpectedÚ_no_split_modulesÚ_skip_keys_device_placementÚ_supports_flash_attnÚ_supports_sdpaÚ_supports_flex_attnÚ_can_compile_fullgraphr  Úpropertyr"  Ú__annotate_func__rd   re   rf   rg   s   @@r0   r  r  ¡  sk   ù‡ € ð  ÐØ&*Ð#Ø*;Ð=NÐ)OÐ&Ø,Ð.AÐBÐØ#4Ð"5ÐØÐØ€NØÐà!Ðõ2ð
 ñó ð÷) … r2   r  c                   ó&   a € ] tR tRt o R tRtV tR# )ÚPretrainedBartModeli¿  c                ó<   € \         P                  ! R \        4       R# ©z_The class `PretrainedBartModel` has been depreciated, please use `BartPreTrainedModel` instead.N©ÚwarningsÚwarnÚFutureWarning©rL   s   &r0   Ú__init_subclass__Ú%PretrainedBartModel.__init_subclass__À  ó   € Ü�ŠØmÜö	
r2   r'  N©r_   r`   ra   rb   r<  rd   re   ©rE   s   @r0   r4  r4  ¿  ó   ø‡ € ÷
ð 
r2   r4  c                   ó&   a € ] tR tRt o R tRtV tR# )ÚBartPretrainedModeliÇ  c                ó<   € \         P                  ! R \        4       R# r6  r7  r;  s   &r0   r<  Ú%BartPretrainedModel.__init_subclass__È  r>  r2   r'  Nr?  r@  s   @r0   rC  rC  Ç  rA  r2   rC  c                   ó‚   a a€ ] tR tRt oRtR]R]/tV3R lV 3R llt]	]
]R
V3R lR ll4       4       4       tR	tVtV ;t# )ÚBartEncoderiÏ  zÈ
Transformer encoder consisting of *config.encoder_layers* self attention layers. Each layer is a
[`BartEncoderLayer`].

Args:
    config: BartConfig
    embed_tokens (nn.Embedding): output embedding
r«   Ú
attentionsc                ó    <€ V ^8„  d   QhRS[ /# r%  r$   )r/   rE   s   "€r0   r1   ÚBartEncoder.__annotate__Þ  s   ø€ ÷ ñ ™zñ r2   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\-        WR7      NK  	  up4      V n        \$        P0                  ! V4      V n        RV n        V P7                  4        R# u upi ©rx   rw   )rœ   FN)rJ   rK   r€   Úencoder_layerdropÚ	layerdroprÒ   r)   rk   Úmax_position_embeddingsÚmax_source_positionsÚscale_embeddingÚmathÚsqrtri   Ú
vocab_sizeÚembed_tokensr@   Úembed_positionsr   Ú
ModuleListÚrangeÚencoder_layersrÌ   r¸   rÖ   Úlayernorm_embeddingÚgradient_checkpointingÚ	post_init)rL   r›   r–   rl   ÚirM   s   &&   €r0   rK   ÚBartEncoder.__init__Þ  s  ø€ Ü‰Ñ˜Ô à—~‘~ˆŒØ×1Ñ1ˆŒà—N‘Nˆ	Ø!×.Ñ.ˆÔØ$*×$BÑ$BˆÔ!Ø.4×.D×.DÐ.D”d—i’i 	Ô*È#ˆä3Ø×Ñ˜y×*:Ñ*:Èô
ˆÔô  >Ø×*Ñ*Øó 
ˆÔô —m’mÔTYÐZ`×ZoÑZoÔTpÓ$qÑTpÈqÔ%5°f×%JÑTpÑ$qÓrˆŒÜ#%§<¢<°	Ó#:ˆÔ à&+ˆÔ#à�‰Öùò %rs   Ã4E	c          
      ó®   <€ V ^8„  d   QhRS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[S[,          RS[/# )r'   r(   Nr~   Úinputs_embedsr�   r®   )r,   Ú
LongTensorr-   râ   r   r   r   )r/   rE   s   "€r0   r1   rJ  û  sb   ø€ ÷ *
ñ *
á×#Ñ# dÕ*ð*
ñ Ÿ™ tÕ+ð*
ñ ×(Ñ(¨4Õ/ð	*
ñ
 Ñ+Õ,ð*
ñ 
ñ*
r2   c                óŽ  € VR J VR J,          '       d   \        R4      hVf   V P                  V4      pV P                  VR,          4      pVP                  VP                  4      pW5,           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R7      # )Nz:You must specify exactly one of input_ids or inputs_embedsr†   )r›   r`  r~   FT)Úlast_hidden_state)r4   r4   r5   )r;   rU  rV  ÚtorT   rZ  r   r�   r€   rˆ   r   r›   Ú	enumerater¸   r,   ÚrandrN  r   )rL   r(   r~   r`  r�   Ú	embed_posr«   ÚidxÚencoder_layerÚto_dropÚdropout_probabilitys   &&&&,      r0   rZ   ÚBartEncoder.forwardø  s+  € ð ˜Ð -°tÐ";×<Ô<ÜÐYÓZÐZàÒ Ø ×-Ñ-¨iÓ8ˆMà×(Ñ(¨°xÕ)@ÓAˆ	Ø—L‘L ×!5Ñ!5Ó6ˆ	à%Õ1ˆØ×0Ñ0°Ó?ˆÜŸ™×-Ñ-¨m¿|¹|ÐVZ×VcÑVcÐ-Ódˆä2Ø—;‘;Ø'Ø)ô
ˆô
 #,¨D¯K©KÖ"8ÑˆCàˆGØ�}�}ˆ}Ü&+§j¢j°£nÐ#Ø&¯©Ô7Ø"�Gç‘7Ù -Ø!Ø"ñ!ð ñ!’ñ #9ô Ø+ô
ð 	
r2   )	r€   rV  rU  r[  rN  rZ  r¸   rP  rk   rÊ   )r_   r`   ra   rb   rc   rÌ   r”   Ú_can_record_outputsrK   r!   r#   r   rZ   rd   re   rf   rg   s   @@r0   rG  rG  Ï  sW   ù‡ € ñð 	Ð)Ø�mðÐ÷
ó ð4  ØØ÷*
ñ *
ó ó ó  ÷*
ð *
r2   rG  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       4       tRtVtV ;t# )ÚBartDecoderi(  z¸
Transformer decoder consisting of *config.decoder_layers* layers. Each layer is a [`BartDecoderLayer`]

Args:
    config: BartConfig
    embed_tokens (nn.Embedding): output embedding
r«   rH  rÕ   )ÚindexÚ
layer_nameÚcross_attentionsrö   c                ó    <€ V ^8„  d   QhRS[ /# r%  r$   )r/   rE   s   "€r0   r1   ÚBartDecoder.__annotate__7  s   ø€ ÷ ñ ™zñ r2   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        \$        P0                  ! VP                  4      V n        RV n        V P7                  4        R# u upi rL  )rJ   rK   r€   Údecoder_layerdroprN  r)   rk   rO  Úmax_target_positionsrQ  rR  rS  rÒ   ri   rT  rU  r@   rV  r   rW  rX  Údecoder_layersrñ   r¸   rÖ   rZ  r[  r\  )rL   r›   rl   r]  rM   s   &&  €r0   rK   ÚBartDecoder.__init__7  s  ø€ Ü‰Ñ˜Ô Ø—~‘~ˆŒØ×1Ñ1ˆŒØ!×.Ñ.ˆÔØ$*×$BÑ$BˆÔ!Ø39×3I×3IÐ3I”d—i’i §¡Ô/Èsˆä3Ø×Ñ˜vŸ~™~¨t×/?Ñ/?È[ô
ˆÔô  >Ø×*Ñ*Ø�N‰Nó 
ˆÔô —m’mÔTYÐZ`×ZoÑZoÔTpÓ$qÑTpÈqÔ%5°f×%JÑTpÑ$qÓrˆŒä#%§<¢<°·±Ó#?ˆÔ à&+ˆÔ#à�‰Öùò %rs   ÄE&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[R,          R	S[S[,          R
S[/	# )r'   r(   Nr~   rû   rü   r­   r`  rý   r�   r®   )	r,   ra  r-   râ   r	   r�   r   r   r   )r/   rE   s   "€r0   r1   rt  R  s³   ø€ ÷ R
ñ R
á×#Ñ# dÕ*ðR
ñ Ÿ™ tÕ+ðR
ñ  %×0Ñ0°4Õ7ð	R
ñ
 !&× 0Ñ 0°4Õ 7ðR
ñ  �ðR
ñ ×(Ñ(¨4Õ/ðR
ñ ˜$•;ðR
ñ Ñ+Õ,ðR
ñ 
3ñR
r2   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VP%                  VP                  4      pWo,           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  	  \9        VVR7      # )NzJYou must specify exactly one of decoder_input_ids or decoder_inputs_embeds)r›   r  )r›   r`  r~   r­   )r›   r`  r~   rû   )rQ   r†   rü   r­   rý   )rc  r­   r5   )r;   rU  r›   Úis_encoder_decoderr   r
   rŠ   Úget_seq_lengthr,   rU   rT   r   Úonesr³   r·   r   r   rV  rd  rZ  r   r�   r€   rˆ   re  r¸   rf  rN  r   )rL   r(   r~   rû   rü   r­   r`  rý   r�   Ú
batch_sizeÚ
seq_lengthrP   rQ   Úmask_seq_lengthÚself_attn_cacheÚ	positionsr«   rh  Údecoder_layerrk  s   &&&&&&&&,           r0   rZ   ÚBartDecoder.forwardO  sZ  € ð ˜Ð -°tÐ";×<Ô<ÜÐiÓjÐjàÒ Ø ×-Ñ-¨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ô	"
Ðð ×(Ñ(¨ÐYeÐ(Ófˆ	Ø—L‘L ×!5Ñ!5Ó6ˆ	à%Õ1ˆØ×0Ñ0°Ó?ˆäŸ™×-Ñ-¨m¸t¿|¹|ÐVZ×VcÑVcÐ-Ódˆä"+¨D¯K©KÖ"8ÑˆC�à�}�}ˆ}Ü&+§j¢j°£nÐ#Ø&¨¯©Ô7Ùá)ØØØ%ñð (>ð	ð
 !0ðð $ðð ñŠMñ #9ô" 9Ø+Ø+ô
ð 	
r2   )	r€   rV  rU  r[  rN  rZ  r¸   rw  rk   )NNNNNNN)r_   r`   ra   rb   rc   rñ   r"   r”   rm  rK   r!   r#   r   rZ   rd   re   rf   rg   s   @@r0   ro  ro  (  sr   ù‡ € ñð 	Ð)Ø‘n ]¸!ÈÔTØ™N¨=ÀÈnÔ]ðÐ÷ó ð0  ØØ÷R
ñ R
ó ó ó  ÷R
ð R
r2   ro  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# )Ú	BartModeli§  zdecoder.embed_tokens.weightzshared.weightzencoder.embed_tokens.weightc                ó    <€ V ^8„  d   QhRS[ /# r%  r$   )r/   rE   s   "€r0   r1   ÚBartModel.__annotate__®  ó   ø€ ÷ ñ ™zñ r2   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# )rx   rw   N)rJ   rK   r)   rT  rQ  rR  rS  rÒ   ri   ÚsharedrG  Úencoderro  Údecoderr\  )rL   r›   rk   rT  rl   rM   s   &&   €r0   rK   ÚBartModel.__init__®  sx   ø€ Ü‰Ñ˜Ô à"(×"5Ñ"5°v×7HÑ7H�ZØ39×3I×3IÐ3I”d—i’i §¡Ô/ÈsˆÜ-¨j¿.¹.È+ÔoˆŒä" 6Ó*ˆŒÜ" 6Ó*ˆŒð 	�‰Ör2   c                ó   € V P                   # rq   )rŒ  r;  s   &r0   Úget_input_embeddingsÚBartModel.get_input_embeddings»  s   € Ø�{‰{Ðr2   c                ó~   € Wn         V P                   V P                  n        V P                   V P                  n        R # rq   )rŒ  r�  rU  rŽ  ©rL   r}   s   &&r0   Úset_input_embeddingsÚBartModel.set_input_embeddings¾  s'   € ØŒØ$(§K¡Kˆ�‰Ô!Ø$(§K¡Kˆ�‰Ö!r2   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[R,          RS[ P                  R,          R	S[ P                  R,          R
S[R,          RS[S[,          RS[	S[
,          /# )r'   r(   Nr~   Údecoder_input_idsÚdecoder_attention_maskÚencoder_outputsr­   r`  Údecoder_inputs_embedsrý   r�   r®   )r,   ra  r-   Úlistrâ   r	   r�   r   r   r¯   r   )r/   rE   s   "€r0   r1   r‰  Å  sê   ø€ ÷ T
ñ T
á×#Ñ# dÕ*ðT
ñ Ÿ™ tÕ+ðT
ñ !×+Ñ+¨dÕ2ð	T
ñ
 !&× 0Ñ 0°4Õ 7ðT
ñ ™e×/Ñ/Õ0°4Õ7ðT
ñ  �ðT
ñ ×(Ñ(¨4Õ/ðT
ñ  %×0Ñ0°4Õ7ðT
ñ ˜$•;ðT
ñ Ñ+Õ,ðT
ñ 
Ñ#Õ	#ñT
r2   c
                ó   € VfH   VfD   Vf   \        R4      h\        WP                  P                  V P                  P                  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                  ! 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      # )áC  
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.
Nz°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`  )rc  r«   rH  rû   rü   r­   rý   )rc  r­   Údecoder_hidden_statesÚdecoder_attentionsrr  Úencoder_last_hidden_staterû   Úencoder_attentionsr'  )r;   r>   r›   r)   r*   r�  r³   r   ÚlenrŽ  r   rc  r­   r«   rH  rr  )rL   r(   r~   r˜  r™  rš  r­   r`  r›  rý   r�   Údecoder_outputss   &&&&&&&&&&, r0   rZ   ÚBartModel.forwardÃ  s›  € ðP Ò$Ð)>Ò)FØÒ Ü ðUóð ô !3ØŸ;™;×3Ñ3°T·[±[×5WÑ5Wó!Ðð Ò"Ø/3¯|ª|ñ 0Ø#ð0à-ð0ð ,ð0ð ñ	0‰Oô ˜O¬_×=Ò=Ü-Ø"1°!Õ"4Ü47¸Ó4HÈ1Ô4L˜o¨aÖ0ÐRVÜ14°_Ó1EÈÔ1I˜?¨1Ö-ÈtôˆOð FJÇ\Â\ñ 	F
Ø'ð	F
à1ð	F
ð #2°!Õ"4ð	F
ð $2ð		F
ð
 ,ð	F
ð 0ð	F
ð  ð	F
ð ñ	F
ˆô "Ø-×?Ñ?Ø+×;Ñ;Ø"1×"?Ñ"?Ø.×9Ñ9Ø,×=Ñ=Ø&5×&GÑ&GØ"1×"?Ñ"?Ø.×9Ñ9ô	
ð 		
r2   )rŽ  r�  rŒ  ©	NNNNNNNNN©r_   r`   ra   rb   Ú_tied_weights_keysrK   r‘  r•  r   r   rZ   rd   re   rf   rg   s   @@r0   r‡  r‡  §  sW   ù‡ € ð 	& Ø% ðÐ÷
ó òò0ð
 Ø÷T
ñ T
ó ó ÷T
ð T
r2   r‡  zV
    The BART Model with a language modeling head. Can be used for summarization.
    )Úcustom_introc                   óº   a a€ ] tR tRt oRtRR/t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       4       tV3R lR ltRtVtV ;t# )r  i  r  úlm_head.weightzmodel.shared.weightr  c                ó    <€ V ^8„  d   QhRS[ /# r%  r$   )r/   rE   s   "€r0   r1   Ú)BartForConditionalGeneration.__annotate__(  s   ø€ ÷ ñ ™zñ r2   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# )r6   Fr    N)rJ   rK   r‡  r  r   ÚBufferr,   ÚzerosrŒ  rB   r  r¤   rÒ   Úlm_headr\  ©rL   r›   rM   s   &&€r0   rK   Ú%BartForConditionalGeneration.__init__(  s€   ø€ Ü‰Ñ˜Ô Ü˜vÓ&ˆŒ
Ü!#§¢¬5¯;ª;¸¸4¿:¹:×;LÑ;L×;[Ñ;[Ð7\Ó+]Ó!^ˆÔÜ—y’y §¡°·±×1BÑ1B×1QÑ1QÐX]Ô^ˆŒð 	�‰Ör2   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/   rE   s   "€r0   r1   r­  1  s5   ø€ ÷ ñ Ù!ðÙ7:¸TµzðÙY]ðá	�‰ñr2   c                ó€   <€ \         SV `  WV4      pV P                  VP                  P                  ^ ,          4       V# )r7   )rJ   Úresize_token_embeddingsÚ_resize_final_logits_biasrW   r9   )rL   rµ  r¶  r·  Únew_embeddingsrM   s   &&&& €r0   rº  Ú4BartForConditionalGeneration.resize_token_embeddings1  s<   ø€ ô ™Ñ8¸Ð]jÓkˆØ×&Ñ& ~×'<Ñ'<×'BÑ'BÀ1Õ'EÔFØÐr2   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r'   rµ  r®   NrD   )r/   rE   s   "€r0   r1   r­  8  s   ø€ ÷ 5ñ 5¹ð 5Àñ 5r2   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# )r6   r4   Nr  r„   r5   )r  r9   r,   r°  rT   Úcatr   r¯  )rL   rµ  Úold_num_tokensÚnew_biasÚ
extra_biass   &&   r0   r»  Ú6BartForConditionalGeneration._resize_final_logits_bias8  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ˆÖr2   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[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š  r­   r`  r›  Úlabelsrý   r�   r®   )r,   ra  r-   rœ  râ   r	   r�   r   r   r¯   r   )r/   rE   s   "€r0   r1   r­  C  sÿ   ø€ ÷ {
ñ {
á×#Ñ# dÕ*ð{
ñ Ÿ™ tÕ+ð{
ñ !×+Ñ+¨dÕ2ð	{
ñ
 !&× 0Ñ 0°4Õ 7ð{
ñ ™e×/Ñ/Õ0°4Õ7ð{
ñ  �ð{
ñ ×(Ñ(¨4Õ/ð{
ñ  %×0Ñ0°4Õ7ð{
ñ × Ñ  4Õ'ð{
ñ ˜$•;ð{
ñ Ñ+Õ,ð{
ñ 
‘Õ	 ñ{
r2   c                ó  € V	e\   V
'       d   \         P                  R4       Rp
Vf9   Vf5   \        W�P                  P                  V P                  P
                  4      pV P                  ! V3RVRVRVRVRVR	VR
VRV
/VB pV P                  V^ ,          4      pWÐP                  P                  VP                  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$                  VP&                  VP(                  VP*                  R7	      # )ap  
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, 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 summarization:

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

>>> model = BartForConditionalGeneration.from_pretrained("facebook/bart-large-cnn")
>>> tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-cnn")

>>> ARTICLE_TO_SUMMARIZE = (
...     "PG&E stated it scheduled the blackouts in response to forecasts for high winds "
...     "amid dry conditions. The aim is to reduce the risk of wildfires. Nearly 800 thousand customers were "
...     "scheduled to be affected by the shutoffs which were expected to last through at least midday tomorrow."
... )
>>> inputs = tokenizer([ARTICLE_TO_SUMMARIZE], max_length=1024, return_tensors="pt")

>>> # Generate Summary
>>> summary_ids = model.generate(inputs["input_ids"], num_beams=2, min_length=0, max_length=20)
>>> tokenizer.batch_decode(summary_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
'PG&E scheduled the blackouts in response to forecasts for high winds amid dry conditions'
```

Mask filling example:

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

>>> tokenizer = AutoTokenizer.from_pretrained("facebook/bart-base")
>>> model = BartForConditionalGeneration.from_pretrained("facebook/bart-base")

>>> TXT = "My friends are <mask> but they eat too many carbs."
>>> input_ids = tokenizer([TXT], 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()
['not', 'good', 'healthy', 'great', 'very']
```
NzJThe `use_cache` argument is changed to `False` since `labels` is provided.Fr~   r˜  rš  r™  r­   r`  r›  rý   ©	ÚlossÚlogitsr­   rŸ  r   rr  r¡  rû   r¢  r5   )r¢   Úwarningr>   r›   r)   r*   r  r±  r  rd  rT   r   r²   rT  r   r­   rŸ  r   rr  r¡  rû   r¢  )rL   r(   r~   r˜  r™  rš  r­   r`  r›  rÆ  rý   r�   ÚoutputsÚ	lm_logitsÚmasked_lm_lossÚloss_fcts   &&&&&&&&&&&,    r0   rZ   Ú$BartForConditionalGeneration.forwardA  s•  € ðh ÒßÜ—‘ÐkÔlØˆIØ Ò(Ð-BÒ-JÜ$6ØŸK™K×4Ñ4°d·k±k×6XÑ6Xó%Ð!ð '+§j¢jØñ'
à)ð'
ð 0ð'
ð ,ð	'
ð
 $:ð'
ð ,ð'
ð (ð'
ð #8ð'
ð  ð'
ð ñ'
ˆð —L‘L ¨¥Ó,ˆ	Ø× 6Ñ 6× 9Ñ 9¸)×:JÑ:JÓ KÕKˆ	àˆØÒØ—Y‘Y˜y×/Ñ/Ó0ˆFÜ'Ó)ˆHÙ% i§n¡n°R¸¿¹×9OÑ9OÓ&PÐRX×R]ÑR]Ð^`ÓRaÓbˆNäØØØ#×3Ñ3Ø")×"?Ñ"?Ø&×9Ñ9Ø$×5Ñ5Ø&-×&GÑ&GØ")×"?Ñ"?Ø&×9Ñ9ô

ð 
	
r2   c                ó4   <€ V ^8„  d   QhRS[ P                  /# )r'   rÆ  rt   )r/   rE   s   "€r0   r1   r­  À  s   ø€ ÷ hñ h¹E¿L¹Lñ hr2   c                ój   € \        WP                  P                  V P                  P                  4      # rq   )r>   r›   r)   r*   )rL   rÆ  s   &&r0   Ú%prepare_decoder_input_ids_from_labelsÚBBartForConditionalGeneration.prepare_decoder_input_ids_from_labelsÀ  s#   € Ü! &¯+©+×*BÑ*BÀDÇKÁK×DfÑDfÓgÐgr2   )r  r±  r  )NT©
NNNNNNNNNN)r_   r`   ra   rb   r(  r¨  Ú_keys_to_ignore_on_load_missingrK   rº  r»  r   r   rZ   rÓ  rd   re   rf   rg   s   @@r0   r  r    s{   ù‡ € ð  ÐàÐ/ðÐð (;Ð&;Ð#÷ó ÷õ ÷5ð 5ð Ø÷{
ñ {
ó ó ð{
÷zh÷ hð hr2   r  z…
    Bart 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
# )ÚBartForSequenceClassificationiÄ  c                ó    <€ V ^8„  d   QhRS[ /# r%  r$   )r/   rE   s   "€r0   r1   Ú*BartForSequenceClassification.__annotate__Ë  rŠ  r2   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 # rq   )
rJ   rK   r‡  r  r  rÒ   Ú
num_labelsÚclassifier_dropoutÚclassification_headr\  )rL   r›   r�   rM   s   &&,€r0   rK   Ú&BartForSequenceClassification.__init__Ë  sZ   ø€ Ü‰Ò˜Ñ* 6Ò*Ü˜vÓ&ˆŒ
Ü#9Ø�N‰NØ�N‰NØ×ÑØ×%Ñ%ó	$
ˆÔ ð 	�‰Ör2   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š  r`  r›  rÆ  rý   r�   r®   )
r,   ra  r-   rœ  râ   r�   r   r   r¯   r   )r/   rE   s   "€r0   r1   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
r2   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š  r`  r›  rý   z7All examples must have the same number of <eos> tokens.r4   z3Each example must contain at least one <eos> token.Ú
regressionÚsingle_label_classificationÚmulti_label_classificationrÈ  r5   )r4   r5   r4   )#ÚNotImplementedErrorrM   r_   r  Úeqr›   Úeos_token_idrd  rT   r    r,   Úunique_consecutiveÚsumÚnumelr9   r²   rŠ   rÞ  Úproblem_typerÜ  rS   rV   r.   r   Úsqueezer   r   r   r­   rŸ  r   rr  r¡  rû   r¢  )rL   r(   r~   r˜  r™  rš  r`  r›  rÆ  rý   r�   rÌ  r«   Úeos_maskÚselectedÚsentence_representationrÊ  rÉ  rÏ  s   &&&&&&&&&&,        r0   rZ   Ú%BartForSequenceClassification.forwardØ  s&  € ðR ÒØˆ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ô

ð 
	
r2   )rÞ  r  r¦  ©r_   r`   ra   rb   rK   r   r   rZ   rd   re   rf   rg   s   @@r0   rØ  rØ  Ä  s9   ù‡ € ÷ó ð Ø÷l
ñ l
ó ó ÷l
ð l
r2   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
# )ÚBartForQuestionAnsweringiI  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# rH   )
rJ   rK   rÜ  r‡  r  r   r¤   Úhidden_sizeÚ
qa_outputsr\  r²  s   &&€r0   rK   Ú!BartForQuestionAnswering.__init__K  s[   ø€ Ü‰Ñ˜Ô àˆÔØ ×+Ñ+ˆŒä˜vÓ&ˆŒ
ÜŸ)š) F×$6Ñ$6¸×8IÑ8IÓJˆŒð 	�‰Ör2   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_positionsr`  r›  rý   r�   r®   )
r,   r-   ra  rœ  râ   r�   r   r   r¯   r   )r/   rE   s   "€r0   r1   Ú%BartForQuestionAnswering.__annotate__Y  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
r2   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
      # )rž  NFr~   r˜  r™  rš  r`  r›  rý   r„   )Úignore_index)
rÉ  Ústart_logitsÚ
end_logitsr­   rŸ  r   rr  r¡  rû   r¢  r5   )r  rö  Úsplitrì  r�   r£  rŠ   rê   r   r   r­   rŸ  r   rr  r¡  rû   r¢  )rL   r(   r~   r˜  r™  rš  rù  rú  r`  r›  rý   r�   rÌ  Úsequence_outputrÊ  rþ  rÿ  Ú
total_lossÚignored_indexrÏ  Ú
start_lossÚend_losss   &&&&&&&&&&&,          r0   rZ   Ú BartForQuestionAnswering.forwardW  sê  € ðN Ò&¨=Ò+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ô
ð 	
r2   )r  rÜ  rö  rÕ  rñ  rg   s   @@r0   ró  ró  I  s4   ù‡ € õ
ð Ø÷W
ñ W
ó ó ÷W
ð W
r2   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	# )ÚBartDecoderWrapperi³  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 # rq   )rJ   rK   ro  rŽ  r\  r²  s   &&€r0   rK   ÚBartDecoderWrapper.__init__¹  s&   ø€ Ü‰Ñ˜Ô Ü" 6Ó*ˆŒØ�‰Ör2   c                ó&   € V P                   ! V/ VB # rq   ©rŽ  )rL   Úargsr�   s   &*,r0   rZ   ÚBartDecoderWrapper.forward¾  s   € Ø�|Š|˜TÐ, VÑ,Ð,r2   r  r^   rg   s   @@r0   r  r  ³  s   ù‡ € ñõ
÷
-ò -r2   r  zu
    BART decoder with a language modeling head on top (linear layer with weights tied to the input embeddings).
    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# )ÚBartForCausalLMiÂ  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˜   r|  rJ   rK   r  r  r   r¤   rõ  rT  r±  r\  r²  s   &&€r0   rK   ÚBartForCausalLM.__init__Ì  sX   ø€ Ø ˆÔØ$)ˆÔ!Ü‰Ñ˜Ô Ü'¨Ó/ˆŒ
ä—y’y ×!3Ñ!3°V×5FÑ5FÈUÔSˆŒð 	�‰Ör2   c                óB   € V P                   P                  P                  # rq   ©r  rŽ  rU  r;  s   &r0   r‘  Ú$BartForCausalLM.get_input_embeddings×  s   € Ø�z‰z×!Ñ!×.Ñ.Ð.r2   c                ó:   € WP                   P                  n        R # rq   r  r”  s   &&r0   r•  Ú$BartForCausalLM.set_input_embeddingsÚ  s   € Ø*/�
‰
×ÑÖ'r2   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­   r`  rÆ  rý   Úlogits_to_keepr�   r®   )r,   ra  r-   râ   r	   r�   r.   r   r   r¯   r   )r/   rE   s   "€r0   r1   ÚBartForCausalLM.__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
r2   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, BartForCausalLM

>>> tokenizer = AutoTokenizer.from_pretrained("facebook/bart-base")
>>> model = BartForCausalLM.from_pretrained("facebook/bart-base")
>>> 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­   r`  rý   Nr4   )rÉ  rÊ  r­   r«   rH  rr  r'  r5   )r  rŽ  r³   r.   Úslicer±  rd  rT   r   r²   r›   rT  r   r­   r«   rH  rr  )rL   r(   r~   rû   rü   r­   r`  rÆ  rý   r  r�   rÌ  r«   Úslice_indicesrÊ  rÉ  rÏ  s   &&&&&&&&&&,      r0   rZ   ÚBartForCausalLM.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ô
ð 	
r2   )r±  r  )	NNNNNNNNr7   r§  rg   s   @@r0   r  r  Â  sN   ù‡ € ð 	Ð=ðÐõ	ò/ò0ð Ø÷A
ñ A
ó ó ÷A
ð A
r2   r  )Nr±   )r  r  ró  rØ  r‡  r  rC  r4  )Qrc   rR  r8  Ú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_bartr%   Ú
get_loggerr_   r¢   r>   r¸  r@   ri   r’   r‚   r”   rÌ   rñ   r  r  r4  rC  rG  ro  r‡  r  rØ  ró  r  r  Ú__all__r'  r2   r0   Ú<module>r1     s  ðñ ã Û Ý $ã Ý ß AÑ Aå &Ý !ß CÑ CÝ )ß JÝ BÝ 9÷÷ ñ ÷ GÝ &÷÷ õ 8ß EÝ *ð 
×	Ò	˜HÓ	%€õô ; R§\¡\ô ;ô6
=˜bŸl™lô 
=÷%ô8r)�B—I‘Iô r)ôj0Ð1ô 0ôfOÐ1ô Oôd˜RŸY™Yô ð0 ô˜/ó ó ðô:
Ð-ô 
ô
Ð-ô 
ôV
Ð%ô V
ôr|
Ð%ô |
ð~ ôq
Ð#ó q
ó ðq
ñh ðôô
`hÐ#6¸ó `hóð
`hñF ðôô|
Ð$7ó |
óð|
ð~ ôf
Ð2ó f
ó ðf
ôR-Ð,ô -ñ ðôô
Y
Ð)¨?ó Y
óð
Y
òx	‚r2   