+
    œ°³j·›  ã                   ó   € R t ^ RIHt ^ RI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 ^RIHt ^R	IHt ^R
IHt ^RI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% ^RI&H't'H(t(H)t) ^RI*H+t+H,t, ^RI-H.t. ^RI/H0t0 ])Pb                  ! ]24      t3R R lt4R R lt5 ! R R]Pl                  4      t7R4R R llt8 ! R R]Pl                  4      t9 ! R R]Pl                  4      t: ! R R ]4      t; ! R! R"]Pl                  4      t<]( ! R# R$]!4      4       t=]( ! R% R&]=4      4       t>](! R'R(7       ! R) R*]=4      4       t?](! R+R(7       ! R, R-]=4      4       t@]( ! R. R/]=4      4       tA]( ! R0 R1]=4      4       tB]( ! R2 R3]=4      4       tC. R5OtDR# )6zà
PyTorch DistilBERT model adapted in part from Facebook, Inc XLM model (https://github.com/facebookresearch/XLM) and in
part from HuggingFace PyTorch version of Google AI Bert model (https://github.com/google-research/bert)
)ÚCallableN)Únn)ÚBCEWithLogitsLossÚCrossEntropyLossÚMSELoss)Úinitialization)Úget_activation©ÚPreTrainedConfig)Úis_deepspeed_zero3_enabled)Úcreate_bidirectional_mask)ÚGradientCheckpointingLayer)ÚBaseModelOutputÚMaskedLMOutputÚMultipleChoiceModelOutputÚQuestionAnsweringModelOutputÚSequenceClassifierOutputÚTokenClassifierOutput)ÚALL_ATTENTION_FUNCTIONSÚPreTrainedModel)ÚUnpack)Úapply_chunking_to_forward)ÚTransformersKwargsÚauto_docstringÚlogging)Úcan_return_tupleÚmerge_with_config_defaults)Úcapture_outputs©ÚDistilBertConfigc                óP   € V ^8„  d   QhR\         R\         R\        P                  /# ©é   Ún_posÚdimÚout©ÚintÚtorchÚTensor)Úformats   "Ús/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/distilbert/modeling_distilbert.pyÚ__annotate__r,   >   s*   € ÷ Lñ L¬ð L´#ð L¼E¿L¹Lñ Ló    c                 óB  € \        4       '       dp   ^ RIpVP                  P                  V^ R7      ;_uu_ 4        \        P
                  P                  4       ^ 8X  d   \        WVR7      uuRRR4       #  RRR4       R# \        WVR7      #   + '       g   i     R# ; i)é    N)Úmodifier_rank©r#   r$   r%   )r   Ú	deepspeedÚzeroÚGatheredParametersr(   ÚdistributedÚget_rankÚ_create_sinusoidal_embeddings)r#   r$   r%   r2   s   &&& r+   Úcreate_sinusoidal_embeddingsr8   >   sz   € Ü!×#Ò#Ûà�^‰^×.Ñ.¨sÀ!Ð.×DÕDÜ× Ñ ×)Ñ)Ó+¨qÔ0Ü4¸5ÈsÔS÷ EÒDØ0÷ EÑDô -°5ÀsÔKÐK÷	 E×DÐDús   º0BÂB	c                óP   € V ^8„  d   QhR\         R\         R\        P                  /# r!   r&   )r*   s   "r+   r,   r,   I   s%   € ÷ ñ ¬ð ´3ð ¼U¿\¹\ñ r-   c                 ó  € \         P                  ! \        V 4       UUu. uFN  p\        V4       Uu. uF5  qC\         P                  ! R ^V^,          ,          V,          4      ,          NK7  	  upNKP  	  upp4      pRVn        \
        P                  ! \         P                  ! VR,          4      4      VR&   \
        P                  ! \         P                  ! VR,          4      4      VR&   VP                  4        V# u upi u uppi )i'  F)ºNNN:r/   Nr"   )r;   :é   Nr"   )
ÚnpÚarrayÚrangeÚpowerÚrequires_gradr(   ÚFloatTensorÚsinÚcosÚdetach_)r#   r$   r%   ÚposÚjÚposition_encs   &&&   r+   r7   r7   I   sÂ   € Ü—8’8ÔhmÐnsÔhtÔuÑhtÐadÔQVÐWZÔQ[Ó\ÑQ[ÈA¤B§H¢H¨U°A¸¸a½µLÀ3Õ4FÓ$G×GÐGÑQ[Ô\ÑhtÒuÓv€LØ€CÔÜ×$Ò$¤R§V¢V¨L¸Õ,AÓ%BÓC€Cˆ�LÜ×$Ò$¤R§V¢V¨L¸Õ,AÓ%BÓC€Cˆ�LØ‡K�K„MØ€Jùò ]ùÓus   ŸD
±;C<Á,D
Ã<D
c                   óT   a a€ ] tR t^Rt oV3R lV 3R lltRV3R lR lltRtVtV ;t# )Ú
Embeddingsc                ó    <€ V ^8„  d   QhRS[ /# ©r"   Úconfigr	   )r*   Ú__classdict__s   "€r+   r,   ÚEmbeddings.__annotate__S   s   ø€ ÷ vñ vÑ/ñ vr-   c                ó(  <€ \         SV `  4        \        P                  ! VP                  VP
                  VP                  R 7      V n        \        P                  ! VP                  VP
                  4      V n	        \        P                  ! VP
                  RR7      V n
        \        P                  ! VP                  4      V n        \        P                  ! \        P                  ! VP                  4      P!                  R4      RR7      V n        R# ))Úpadding_idxçê-�™—q=©ÚepsF)Ú
persistentN©r<   éÿÿÿÿ)ÚsuperÚ__init__r   Ú	EmbeddingÚ
vocab_sizer$   Úpad_token_idÚword_embeddingsÚmax_position_embeddingsÚposition_embeddingsÚ	LayerNormÚDropoutÚdropoutÚBufferr(   ÚarangeÚexpandÚposition_ids©ÚselfrM   Ú	__class__s   &&€r+   rY   ÚEmbeddings.__init__S   s­   ø€ Ü‰ÑÔÜ!Ÿ|š|¨F×,=Ñ,=¸v¿z¹zÐW]×WjÑWjÔkˆÔÜ#%§<¢<°×0NÑ0NÐPV×PZÑPZÓ#[ˆÔ äŸš f§j¡j°eÔ<ˆŒÜ—z’z &§.¡.Ó1ˆŒÜŸIšI¤e§l¢l°6×3QÑ3QÓ&R×&YÑ&YÐZaÓ&bÐotÔuˆÖr-   c                óž   <€ V ^8„  d   QhRS[ P                  RS[ P                  R,          RS[ P                  R,          RS[ P                  /# )r"   Ú	input_idsÚinputs_embedsNrf   Úreturn)r(   r)   Ú
LongTensor)r*   rN   s   "€r+   r,   rO   \   sO   ø€ ÷ ñ á—<‘<ðñ —|‘| dÕ*ðñ ×&Ñ&¨Õ-ð	ñ
 
�‰ñr-   c                óÆ  € Ve   V P                  V4      pVP                  ^4      pVf|   \        V R4      '       d   V P                  RR V13,          pMQ\        P
                  ! V\        P                  VP                  R7      pVP                  ^ 4      P                  V4      pV P                  V4      pW%,           pV P                  V4      pV P                  V4      pV# )Nrf   r;   )ÚdtypeÚdevice)r]   ÚsizeÚhasattrrf   r(   rd   Úlongrr   Ú	unsqueezeÚ	expand_asr_   r`   rb   )rh   rl   rm   rf   Ú
seq_lengthr_   Ú
embeddingss   &&&&   r+   ÚforwardÚEmbeddings.forward\   sÊ   € ð Ò Ø ×0Ñ0°Ó;ˆMà"×'Ñ'¨Ó*ˆ
àÒô �t˜^×,Ò,Ø#×0Ñ0°°K°Z°K°Õ@‘ä$Ÿ|š|¨J¼e¿j¹jÐQZ×QaÑQaÔb�Ø+×5Ñ5°aÓ8×BÑBÀ9ÓM�à"×6Ñ6°|ÓDÐà"Õ8ˆ
Ø—^‘^ JÓ/ˆ
Ø—\‘\ *Ó-ˆ
ØÐr-   )r`   rb   r_   rf   r]   )NN©	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__rY   rz   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©ri   rN   s   @@r+   rJ   rJ   R   s    ù‡ € ÷vó v÷÷ ò r-   rJ   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Úscalingrb   Úkwargs)r   ÚModuler(   r)   Úfloatr   r   )r*   s   "r+   r,   r,   z   s{   € ÷ %ñ %Ü�I‰Ið%ä�<‰<ð%ô 
�‰ð%ô �<‰<ð	%ô
 —L‘L 4Õ'ð%ô �T�\ð%ô ð%ô Ô'Õ(ñ%r-   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©r$   )ÚpÚtrainingrW   ç      à¿)
rs   r(   ÚmatmulÚ	transposer   Ú
functionalÚsoftmaxrb   r’   Ú
contiguous)
r†   r‡   rˆ   r‰   rŠ   r‹   rb   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àÐ$Ð$r-   c                   óT   a a€ ] tR t^–t oV3R lV 3R lltRV3R lR lltRtVtV ;t# )ÚDistilBertSelfAttentionc                ó    <€ V ^8„  d   QhRS[ /# rL   r	   )r*   rN   s   "€r+   r,   Ú$DistilBertSelfAttention.__annotate__—   s   ø€ ÷ ñ Ñ/ñ r-   c                óZ  <€ \         SV `  4        Wn        VP                  V n        VP                  V n        V P                  V P                  ,          V n        V P
                  R,          V n        V P                  V P                  ,          ^ 8w  d'   \        RV P                   RV P                   R24      h\        P                  ! VP                  VP                  R7      V n
        \        P                  ! VP                  VP                  R7      V n        \        P                  ! VP                  VP                  R7      V n        \        P                  ! VP                  VP                  R7      V n        \        P                  ! VP                  R7      V n        RV n        R# )	g      à?zself.n_heads: z must divide self.dim: ú evenly©Úin_featuresÚout_features©r‘   FNr“   )rX   rY   rM   Ún_headsr$   Úattention_head_sizer‹   Ú
ValueErrorr   ÚLinearÚq_linÚk_linÚv_linÚout_linra   Úattention_dropoutrb   Ú	is_causalrg   s   &&€r+   rY   Ú DistilBertSelfAttention.__init__—   s  ø€ Ü‰ÑÔØŒà—~‘~ˆŒØ—:‘:ˆŒØ#'§8¡8¨t¯|©|Õ#;ˆÔ Ø×/Ñ/°Õ5ˆŒð �8‰8�d—l‘lÕ" aÔ'ä˜~¨d¯l©l¨^Ð;RÐSW×S[ÑS[ÐR\Ð\cÐdÓeÐeä—Y’Y¨6¯:©:ÀFÇJÁJÔOˆŒ
Ü—Y’Y¨6¯:©:ÀFÇJÁJÔOˆŒ
Ü—Y’Y¨6¯:©:ÀFÇJÁJÔOˆŒ
Ü—y’y¨V¯Z©ZÀfÇjÁjÔQˆŒä—z’z F×$<Ñ$<Ô=ˆŒØˆŽr-   c          	      óœ   <€ V ^8„  d   QhRS[ P                  RS[ P                  R,          RS[S[,          RS[S[ P                  ,          /# ©r"   Úhidden_statesrŠ   NrŒ   rn   )r(   r)   rB   r   r   Útuple)r*   rN   s   "€r+   r,   rŸ   ­   sQ   ø€ ÷ )ñ )á—|‘|ð)ñ ×)Ñ)¨DÕ0ð)ñ Ñ+Õ,ð	)ñ
 
‰u�|‰|Õ	ñ)r-   c                ó¶  € VP                   R R p. VORNV P                  N5pV P                  V4      P                  ! V!  P	                  ^^4      pV P                  V4      P                  ! V!  P	                  ^^4      pV P                  V4      P                  ! V!  P	                  ^^4      p\        P                  ! V P                  P                  \        4      p	T	! V VVVV3RV P                  '       g   RMV P                  P                  RV P                  /VB w  r«V
P                   ! . VORN5!  P#                  4       p
V P%                  V
4      p
W«3# )Nrb   ç        r‹   rW   )Úshaper§   rª   Úviewr•   r«   r¬   r   Úget_interfacerM   Ú_attn_implementationr›   r’   rb   r‘   r‹   Úreshaper˜   r­   )rh   r³   rŠ   rŒ   Úinput_shapeÚhidden_shapeÚquery_layerÚ	key_layerÚvalue_layerÚattention_interfacerš   r™   s   &&&,        r+   rz   ÚDistilBertSelfAttention.forward­   sS  € ð $×)Ñ)¨#¨2Ð.ˆØC˜ÐC bÐC¨$×*BÑ*BÑCˆð —j‘j Ó/×4Ò4°lÑC×MÑMÈaÐQRÓSˆØ—J‘J˜}Ó-×2Ò2°LÑA×KÑKÈAÈqÓQˆ	Ø—j‘j Ó/×4Ò4°lÑC×MÑMÈaÐQRÓSˆä(?×(MÒ(MØ�K‰K×,Ñ,Ô.Eó)
Ðñ %8ØØØØØñ	%
ð  $Ÿ}Ÿ}˜}‘C°$·,±,·.±.ð	%
ð —L‘Lð	%
ð ñ	%
Ñ!ˆð "×)Ò)Ð;¨;Ð;¸Ó;×FÑFÓHˆØ—l‘l ;Ó/ˆØÐ(Ð(r-   )r§   rM   r$   rb   r¯   r«   r¦   r­   rª   r‹   r¬   ©Nr|   r„   s   @@r+   r�   r�   –   s   ù‡ € ÷ó ÷,)÷ )ò )r-   r�   c                   ób   a a€ ] tR t^Ît oV3R lV 3R lltV3R lR ltV3R lR ltRtVtV ;t	# )ÚFFNc                ó    <€ V ^8„  d   QhRS[ /# rL   r	   )r*   rN   s   "€r+   r,   ÚFFN.__annotate__Ï   s   ø€ ÷ <ñ <Ñ/ñ <r-   c                ó˜  <€ \         SV `  4        \        P                  ! VP                  R 7      V n        VP
                  V n        ^V n        \        P                  ! VP                  VP                  R7      V n
        \        P                  ! VP                  VP                  R7      V n        \        VP                  4      V n        R# )r¥   r¢   N)rX   rY   r   ra   rb   Úchunk_size_feed_forwardÚseq_len_dimr©   r$   Ú
hidden_dimÚlin1Úlin2r   Ú
activationrg   s   &&€r+   rY   ÚFFN.__init__Ï   s‚   ø€ Ü‰ÑÔÜ—z’z F§N¡NÔ3ˆŒØ'-×'EÑ'EˆÔ$ØˆÔÜ—I’I¨&¯*©*À6×CTÑCTÔUˆŒ	Ü—I’I¨&×*;Ñ*;È&Ï*É*ÔUˆŒ	Ü(¨×):Ñ):Ó;ˆŽr-   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# ©r"   Úinputrn   ©r(   r)   )r*   rN   s   "€r+   r,   rÇ   Ø   s'   ø€ ÷ oñ o™UŸ\™\ð o©e¯l©lñ or-   c                óZ   € \        V P                  V P                  V P                  V4      # rÃ   )r   Úff_chunkrÉ   rÊ   )rh   rÒ   s   &&r+   rz   ÚFFN.forwardØ   s%   € Ü(¨¯©¸×8TÑ8TÐVZ×VfÑVfÐhmÓnÐnr-   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# rÑ   rÓ   )r*   rN   s   "€r+   r,   rÇ   Û   s#   ø€ ÷ ñ ™eŸl™lð ©u¯|©|ñ r-   c                óŽ   € V P                  V4      pV P                  V4      pV P                  V4      pV P                  V4      pV# rÃ   )rÌ   rÎ   rÍ   rb   )rh   rÒ   Úxs   && r+   rÕ   ÚFFN.ff_chunkÛ   s=   € Ø�I‰I�eÓˆØ�O‰O˜AÓˆØ�I‰I�a‹LˆØ�L‰L˜‹OˆØˆr-   )rÎ   rÉ   rb   rÌ   rÍ   rÊ   )
r}   r~   r   r€   rY   rz   rÕ   r�   r‚   rƒ   r„   s   @@r+   rÅ   rÅ   Î   s*   ù‡ € ÷<ó <÷oð o÷÷ ð r-   rÅ   c                   óT   a a€ ] tR t^ãt oV3R lV 3R lltRV3R lR lltRtVtV ;t# )ÚTransformerBlockc                ó    <€ V ^8„  d   QhRS[ /# rL   r	   )r*   rN   s   "€r+   r,   ÚTransformerBlock.__annotate__ä   s   ø€ ÷ Vñ VÑ/ñ Vr-   c                ó�  <€ \         SV `  4        VP                  VP                  ,          ^ 8w  d'   \	        RVP                   RVP                   R24      h\        V4      V n        \        P                  ! VP                  RR7      V n	        \        V4      V n        \        P                  ! VP                  RR7      V n        R# )r/   zconfig.n_heads z must divide config.dim r¡   rR   )Únormalized_shaperT   N)rX   rY   r$   r¦   r¨   r�   Ú	attentionr   r`   Úsa_layer_normrÅ   ÚffnÚoutput_layer_normrg   s   &&€r+   rY   ÚTransformerBlock.__init__ä   s“   ø€ Ü‰ÑÔð �:‰:˜Ÿ™Õ&¨!Ô+Ü˜¨v¯~©~Ð.>Ð>VÐW]×WaÑWaÐVbÐbiÐjÓkÐkä0°Ó8ˆŒÜŸ\š\¸6¿:¹:È5ÔQˆÔä�v“;ˆŒÜ!#§¢¸v¿z¹zÈuÔ!UˆÖr-   c                óŒ   <€ V ^8„  d   QhRS[ P                  RS[ P                  R,          RS[S[,          RS[ P                  /# r²   )r(   r)   r   r   )r*   rN   s   "€r+   r,   rÞ   ñ   sJ   ø€ ÷ ñ á—|‘|ðñ Ÿ™ tÕ+ðñ Ñ+Õ,ð	ñ
 
�‰ñr-   c                ó²   € V P                   ! V3R V/VB w  rEV P                  WA,           4      pV P                  V4      pV P                  Wd,           4      pV# )rŠ   )rá   râ   rã   rä   )rh   r³   rŠ   rŒ   Úattention_outputÚ_Ú
ffn_outputs   &&&,   r+   rz   ÚTransformerBlock.forwardñ   sl   € ð #ŸnšnØñ
à)ð
ð ñ
ÑÐð
  ×-Ñ-Ð.>Õ.NÓOÐð —X‘XÐ.Ó/ˆ
Ø×+Ñ+¨JÕ,IÓJˆ
àÐr-   )rá   rã   rä   râ   rÃ   r|   r„   s   @@r+   rÜ   rÜ   ã   s    ù‡ € ÷Vó V÷÷ ò r-   rÜ   c                   óT   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tRtVtV ;t# )ÚTransformeri  c                ó    <€ V ^8„  d   QhRS[ /# rL   r	   )r*   rN   s   "€r+   r,   ÚTransformer.__annotate__  s   ø€ ÷ ,ñ ,Ñ/ñ ,r-   c                óì   <€ \         SV `  4        VP                  V n        \        P                  ! \        VP                  4       Uu. uF  p\        V4      NK  	  up4      V n        R V n        R# u upi )FN)	rX   rY   Ún_layersr   Ú
ModuleListr?   rÜ   ÚlayerÚgradient_checkpointing)rh   rM   ré   ri   s   && €r+   rY   ÚTransformer.__init__  sW   ø€ Ü‰ÑÔØŸ™ˆŒÜ—]’]ÄeÈFÏOÉOÔF\Ó#]ÑF\ÀÔ$4°VÖ$<ÑF\Ñ#]Ó^ˆŒ
Ø&+ˆÖ#ùò $^s   ÁA1c                óx   <€ V ^8„  d   QhRS[ P                  RS[ P                  R,          RS[S[,          RS[/# r²   )r(   r)   r   r   r   )r*   rN   s   "€r+   r,   rï     sL   ø€ ÷ @ñ @á—|‘|ð@ñ Ÿ™ tÕ+ð@ñ Ñ+Õ,ð	@ñ
 
ñ@r-   c                óT   € V P                    F  pV! VV3/ VB pK  	  \        VR 7      # ))Úlast_hidden_state)ró   r   )rh   r³   rŠ   rŒ   Úlayer_modules   &&&, r+   rz   ÚTransformer.forward  s9   € ð !ŸJœJˆLÙ(ØØñð ñŠMñ 'ô °Ô?Ð?r-   )rô   ró   rñ   rÃ   r|   r„   s   @@r+   rí   rí     s!   ù‡ € ÷,ó ,÷@÷ @ò @r-   rí   c                   ó–   a a€ ] tR tRt oRtRtRtRtRtRt	R]
R]/t]P                  ! 4       V3R lV 3R ll4       tV3R ltR	tVtV ;t# )
ÚDistilBertPreTrainedModeli  Ú
distilbertTr³   Ú
attentionsc                ó4   <€ V ^8„  d   QhRS[ P                  /# )r"   r†   ©r   r�   )r*   rN   s   "€r+   r,   Ú&DistilBertPreTrainedModel.__annotate__-  s   ø€ ÷ iñ i¡B§I¡Iñ ir-   c           
     óZ  <€ \         SV `  V4       \        V\        4      '       Ed   V P                  P
                  '       d‡   \        P                  ! VP                  P                  \        V P                  P                  V P                  P                  \        P                  ! VP                  P                  4      4      4       \        P                  ! VP                  \        P                   ! VP                  P"                  R,          4      P%                  R4      4       R# R# )zInitialize the weights.NrW   rV   )rX   Ú_init_weightsÚ
isinstancerJ   rM   Úsinusoidal_pos_embdsÚinitÚcopy_r_   Úweightr8   r^   r$   r(   Ú
empty_likerf   rd   r·   re   )rh   r†   ri   s   &&€r+   r  Ú'DistilBertPreTrainedModel._init_weights,  sÆ   ø€ ô 	‰Ñ˜fÔ%Ü�fœj×)Ó)Ø�{‰{×/×/Ð/Ü—
’
Ø×.Ñ.×5Ñ5Ü0ØŸ™×;Ñ;ØŸ™Ÿ™Ü×(Ò(¨×)CÑ)C×)JÑ)JÓKóôô �JŠJ�v×*Ñ*¬E¯LªL¸×9LÑ9L×9RÑ9RÐSUÕ9VÓ,W×,^Ñ,^Ð_fÓ,gÖhñ *r-   c                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # rL   r   )r*   rN   s   "€r+   r,   r    s   ø‡ ‚ áÑò r-   © )r}   r~   r   r€   Úbase_model_prefixÚsupports_gradient_checkpointingÚ_supports_flash_attnÚ_supports_sdpaÚ_supports_flex_attnÚ_supports_attention_backendrÜ   r�   Ú_can_record_outputsr(   Úno_gradr  Ú__annotate_func__r�   r‚   rƒ   r„   s   @@r+   rü   rü     sg   ù‡ € ð %ÐØ&*Ð#ØÐØ€NØÐØ"&ÐàÐ)ØÐ-ðÐð
 ‡]‚]ƒ_÷iò ió ði÷ … r-   rü   c                   óº   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V3R lR ltV3R lR	 ltV3R
 lR lt]	]
]RV3R lR ll4       4       4       tRtVtV ;t# )ÚDistilBertModeli=  c                ó    <€ V ^8„  d   QhRS[ /# rL   r	   )r*   rN   s   "€r+   r,   ÚDistilBertModel.__annotate__?  s   ø€ ÷ ñ Ñ/ñ r-   c                ó†   <€ \         SV `  V4       \        V4      V n        \	        V4      V n        V P                  4        R # rÃ   )rX   rY   rJ   ry   rí   ÚtransformerÚ	post_initrg   s   &&€r+   rY   ÚDistilBertModel.__init__?  s5   ø€ Ü‰Ñ˜Ô ä$ VÓ,ˆŒÜ& vÓ.ˆÔð 	�‰Ör-   c                ó4   <€ V ^8„  d   QhRS[ P                  /# ©r"   rn   ©r   rZ   )r*   rN   s   "€r+   r,   r  H  s   ø€ ÷ 3ñ 3©¯©ñ 3r-   c                ó.   € V P                   P                  # ©z!
Returns the position embeddings
)ry   r_   ©rh   s   &r+   Úget_position_embeddingsÚ'DistilBertModel.get_position_embeddingsH  s   € ð �‰×2Ñ2Ð2r-   c                ó    <€ V ^8„  d   QhRS[ /# ©r"   Únew_num_position_embeddings©r'   )r*   rN   s   "€r+   r,   r  N  s   ø€ ÷ (<ñ (<Ácñ (<r-   c                ó  € WP                   P                  ,
          pV^ 8X  d   R# \        P                  RV R24       WP                   n        V P                  P
                  P                  P                  4       p\        P                  ! V P                   P                  V P                   P                  4      V P                  n        V P                   P                  '       dL   \        V P                   P                  V P                   P                  V P
                  P                  R7       M˜\        P                  ! 4       ;_uu_ 4        V^ 8”  d:   \        P                  ! V4      V P                  P
                  P                  RV) % M2\        P                  ! VRV 4      V P                  P
                  n        RRR4       V P                  P
                  P!                  V P"                  4       R#   + '       g   i     LA; i)áŠ  
Resizes position embeddings of the model if `new_num_position_embeddings != config.max_position_embeddings`.

Arguments:
    new_num_position_embeddings (`int`):
        The number of new position embedding matrix. If position embeddings are learned, increasing the size
        will add newly initialized vectors at the end, whereas reducing the size will remove vectors from the
        end. If position embeddings are not learned (*e.g.* sinusoidal position embeddings), increasing the
        size will add correct vectors at the end following the position encoding algorithm, whereas reducing
        the size will remove vectors from the end.
Nz(Setting `config.max_position_embeddings=z`...r1   )rM   r^   ÚloggerÚinfory   r_   r  Úcloner   rZ   r$   r  r8   r(   r  Ú	ParameterÚtorr   )rh   r(  Únum_position_embeds_diffÚold_position_embeddings_weights   &&  r+   Úresize_position_embeddingsÚ*DistilBertModel.resize_position_embeddingsN  sn  € ð $?ÇÁ×AdÑAdÕ#dÐ ð $ qÔ(Ùä�‰Ð>Ð?ZÐ>[Ð[_Ð`ÔaØ.I�‰Ô+à)-¯©×)LÑ)L×)SÑ)S×)YÑ)YÓ)[Ð&ä.0¯lªl¸4¿;¹;×;^Ñ;^Ð`d×`kÑ`k×`oÑ`oÓ.pˆ�‰Ô+à�;‰;×+×+Ð+Ü(Ø—k‘k×9Ñ9¸t¿{¹{¿¹ÐTX×TlÑTl×TsÑTsöô —’—•Ø+¨aÔ/Ü]_×]iÒ]iØ6ó^�D—O‘O×7Ñ7×>Ñ>Ð?YÐAYÐ@YÑZô BDÇÂØ6Ð7PÐ8PÐQóB�D—O‘O×7Ñ7Ô>÷ !ð 	�‰×+Ñ+×.Ñ.¨t¯{©{Ö;÷ !—ús   ÅA3G;Ç;H	c                ó4   <€ V ^8„  d   QhRS[ P                  /# r  r   )r*   rN   s   "€r+   r,   r  x  s   ø€ ÷ /ñ /¡b§l¡lñ /r-   c                ó.   € V P                   P                  # rÃ   ©ry   r]   r#  s   &r+   Úget_input_embeddingsÚ$DistilBertModel.get_input_embeddingsx  s   € Ø�‰×.Ñ.Ð.r-   c                ó4   <€ V ^8„  d   QhRS[ P                  /# ©r"   Únew_embeddingsr   )r*   rN   s   "€r+   r,   r  {  s   ø€ ÷ 9ñ 9±2·<±<ñ 9r-   c                ó&   € WP                   n        R # rÃ   r7  ©rh   r<  s   &&r+   Úset_input_embeddingsÚ$DistilBertModel.set_input_embeddings{  s   € Ø*8�‰Ö'r-   c                ó  <€ V ^8„  d   QhRS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[S[,          RS[S[S[ P                  R3,          ,          /# )	r"   rl   NrŠ   rm   rf   rŒ   rn   .)r(   r)   r   r   r   r´   )r*   rN   s   "€r+   r,   r  �  s„   ø€ ÷ $
ñ $
á—<‘< $Õ&ð$
ñ Ÿ™ tÕ+ð$
ñ —|‘| dÕ*ð	$
ñ
 —l‘l TÕ)ð$
ñ Ñ+Õ,ð$
ñ 
™5¡§¡¨sÐ!2Õ3Õ	3ñ$
r-   c                ó¾   € VRJ VRJ,          '       d   \        R4      hV P                  WV4      p\        V P                  VVR7      pV P                  ! RRVRV/VB # )á°  
input_ids (`torch.LongTensor` of shape `(batch_size, num_choices)`):
    Indices of input sequence tokens in the vocabulary.

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

    [What are input IDs?](../glossary#input-ids)
inputs_embeds (`torch.FloatTensor` of shape `(batch_size, num_choices, 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_embeds)rM   rm   rŠ   r³   rŠ   r  )r¨   ry   r   rM   r  )rh   rl   rŠ   rm   rf   rŒ   ry   s   &&&&&, r+   rz   ÚDistilBertModel.forward~  s{   € ð0 ˜Ð -°tÐ";×<Ô<ÜÐYÓZÐZà—_‘_ Y¸|ÓLˆ
ä2Ø—;‘;Ø$Ø)ô
ˆð ×Òñ 
Ø$ð
à)ð
ð ñ
ð 	
r-   )ry   r  )NNNN)r}   r~   r   r€   rY   r$  r3  r8  r?  r   r   r   rz   r�   r‚   rƒ   r„   s   @@r+   r  r  =  sf   ù‡ € ÷ó ÷3ð 3÷(<ð (<÷T/ð /÷9ð 9ð  ØØ÷$
ñ $
ó ó ó  ÷$
ð $
r-   r  zI
    DistilBert Model with a `masked language modeling` head on top.
    )Úcustom_introc                   ó¸   a a€ ] tR tRt oRR/tV3R lV 3R lltV3R lR ltV3R lR	 ltV3R
 lR ltV3R lR lt	]
]RV3R lR ll4       4       tRtVtV ;t# )ÚDistilBertForMaskedLMi¨  zvocab_projector.weightz,distilbert.embeddings.word_embeddings.weightc                ó    <€ V ^8„  d   QhRS[ /# rL   r	   )r*   rN   s   "€r+   r,   Ú"DistilBertForMaskedLM.__annotate__°  s   ø€ ÷ 2ñ 2Ñ/ñ 2r-   c                óÜ  <€ \         SV `  V4       \        VP                  4      V n        \	        V4      V n        \        P                  ! VP                  VP                  4      V n	        \        P                  ! VP                  R R7      V n        \        P                  ! VP                  VP                  4      V n        V P                  4        \        P                  ! 4       V n        R# )rR   rS   N)rX   rY   r   rÎ   r  rý   r   r©   r$   Úvocab_transformr`   Úvocab_layer_normr[   Úvocab_projectorr  r   Úmlm_loss_fctrg   s   &&€r+   rY   ÚDistilBertForMaskedLM.__init__°  sš   ø€ Ü‰Ñ˜Ô ä(¨×):Ñ):Ó;ˆŒä)¨&Ó1ˆŒÜ!Ÿyšy¨¯©°V·Z±ZÓ@ˆÔÜ "§¢¨V¯Z©Z¸UÔ CˆÔÜ!Ÿyšy¨¯©°V×5FÑ5FÓGˆÔð 	�‰Ôä×/Ò/Ó1ˆÖr-   c                ó4   <€ V ^8„  d   QhRS[ P                  /# r  r   )r*   rN   s   "€r+   r,   rI  ¿  ó   ø€ ÷ 9ñ 9©¯©ñ 9r-   c                ó6   € V P                   P                  4       # r"  ©rý   r$  r#  s   &r+   r$  Ú-DistilBertForMaskedLM.get_position_embeddings¿  ó   € ð �‰×6Ñ6Ó8Ð8r-   c                ó    <€ V ^8„  d   QhRS[ /# r'  r)  )r*   rN   s   "€r+   r,   rI  Å  ó   ø€ ÷ Pñ PÁcñ Pr-   c                ó<   € V P                   P                  V4       R# ©r+  N©rý   r3  ©rh   r(  s   &&r+   r3  Ú0DistilBertForMaskedLM.resize_position_embeddingsÅ  ó   € ð 	�‰×2Ñ2Ð3NÖOr-   c                ó4   <€ V ^8„  d   QhRS[ P                  /# r  r   )r*   rN   s   "€r+   r,   rI  Ó  s   ø€ ÷ $ñ $¡r§y¡yñ $r-   c                ó   € V P                   # rÃ   ©rM  r#  s   &r+   Úget_output_embeddingsÚ+DistilBertForMaskedLM.get_output_embeddingsÓ  s   € Ø×#Ñ#Ð#r-   c                ó4   <€ V ^8„  d   QhRS[ P                  /# r;  r   )r*   rN   s   "€r+   r,   rI  Ö  s   ø€ ÷ .ñ .±B·I±Iñ .r-   c                ó   € Wn         R # rÃ   r`  r>  s   &&r+   Úset_output_embeddingsÚ+DistilBertForMaskedLM.set_output_embeddingsÖ  s   € Ø-Ör-   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[ P                  R,          RS[S[,          RS[S[S[ P                  R	3,          ,          /# ©
r"   rl   NrŠ   rm   Úlabelsrf   rŒ   rn   .)r(   r)   ro   r   r   r   r´   )r*   rN   s   "€r+   r,   rI  Û  s™   ø€ ÷ 1
ñ 1
á—<‘< $Õ&ð1
ñ Ÿ™ tÕ+ð1
ñ —|‘| dÕ*ð	1
ñ
 × Ñ  4Õ'ð1
ñ —l‘l TÕ)ð1
ñ Ñ+Õ,ð1
ñ 
™%¡§¡¨cÐ 1Õ2Õ	2ñ1
r-   c                ó¦  € V P                   ! R	RVRVRVRVRR/VB pV^ ,          pV P                  V4      p	V P                  V	4      p	V P                  V	4      p	V P	                  V	4      p	Rp
VeA   V P                  V	P                  R
V	P                  R
4      4      VP                  R
4      4      p
\        V
V	VP                  VP                  R7      # )a*  
input_ids (`torch.LongTensor` of shape `(batch_size, num_choices)`):
    Indices of input sequence tokens in the vocabulary.

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

    [What are input IDs?](../glossary#input-ids)
inputs_embeds (`torch.FloatTensor` of shape `(batch_size, num_choices, 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.
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
    Labels for computing the masked language modeling loss. Indices should be in `[-100, 0, ...,
    config.vocab_size]` (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]`.
rl   rŠ   rm   rf   Úreturn_dictTN©ÚlossÚlogitsr³   rþ   r  rW   )rý   rK  rÎ   rL  rM  rN  r¸   rs   r   r³   rþ   )rh   rl   rŠ   rm   ri  rf   rŒ   Údlbrt_outputr³   Úprediction_logitsÚmlm_losss   &&&&&&,    r+   rz   ÚDistilBertForMaskedLM.forwardÙ  s  € ð8 —’ñ 
Øð
à)ð
ð (ð
ð &ð	
ð
 ð
ð ñ
ˆð % Q�ˆØ ×0Ñ0°Ó?ÐØ ŸO™OÐ,=Ó>ÐØ ×1Ñ1Ð2CÓDÐØ ×0Ñ0Ð1BÓCÐàˆØÒØ×(Ñ(Ð):×)?Ñ)?ÀÐDU×DZÑDZÐ[]ÓD^Ó)_Ðag×alÑalÐmoÓapÓqˆHäØØ$Ø&×4Ñ4Ø#×.Ñ.ô	
ð 	
r-   )rÎ   rý   rN  rL  rM  rK  ©NNNNN)r}   r~   r   r€   Ú_tied_weights_keysrY   r$  r3  ra  re  r   r   rz   r�   r‚   rƒ   r„   s   @@r+   rG  rG  ¨  sm   ù‡ € ð 3Ð4bÐcÐ÷2ó 2÷9ð 9÷Pð P÷$ð $÷.ð .ð Ø÷1
ñ 1
ó ó ÷1
ð 1
r-   rG  z¢
    DistilBert Model transformer with a sequence classification/regression head on top (a linear layer on top of the
    pooled output) e.g. for GLUE tasks.
    c                   óŒ   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V3R lR lt]]RV3R lR	 ll4       4       t	R
t
VtV ;t# )Ú#DistilBertForSequenceClassificationi  c                ó    <€ V ^8„  d   QhRS[ /# rL   r	   )r*   rN   s   "€r+   r,   Ú0DistilBertForSequenceClassification.__annotate__  ó   ø€ ÷ ñ Ñ/ñ r-   c                óž  <€ \         SV `  V4       VP                  V n        Wn        \	        V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        V P                  4        R # rÃ   )rX   rY   Ú
num_labelsrM   r  rý   r   r©   r$   Úpre_classifierÚ
classifierra   Úseq_classif_dropoutrb   r  rg   s   &&€r+   rY   Ú,DistilBertForSequenceClassification.__init__  s‡   ø€ Ü‰Ñ˜Ô Ø ×+Ñ+ˆŒØŒä)¨&Ó1ˆŒÜ Ÿiši¨¯
©
°F·J±JÓ?ˆÔÜŸ)š) F§J¡J°×0AÑ0AÓBˆŒÜ—z’z &×"<Ñ"<Ó=ˆŒð 	�‰Ör-   c                ó4   <€ V ^8„  d   QhRS[ P                  /# r  r   )r*   rN   s   "€r+   r,   rx  #  rQ  r-   c                ó6   € V P                   P                  4       # r"  rS  r#  s   &r+   r$  Ú;DistilBertForSequenceClassification.get_position_embeddings#  rU  r-   c                ó    <€ V ^8„  d   QhRS[ /# r'  r)  )r*   rN   s   "€r+   r,   rx  )  rW  r-   c                ó<   € V P                   P                  V4       R# rY  rZ  r[  s   &&r+   r3  Ú>DistilBertForSequenceClassification.resize_position_embeddings)  r]  r-   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[ P                  R,          RS[S[,          RS[S[S[ P                  R	3,          ,          /# rh  )r(   r)   ro   r   r   r   r´   )r*   rN   s   "€r+   r,   rx  9  s™   ø€ ÷ :
ñ :
á—<‘< $Õ&ð:
ñ Ÿ™ tÕ+ð:
ñ —|‘| dÕ*ð	:
ñ
 × Ñ  4Õ'ð:
ñ —l‘l TÕ)ð:
ñ Ñ+Õ,ð:
ñ 
"¡E©%¯,©,¸Ð*;Õ$<Õ	<ñ:
r-   c                ó|  € V P                   ! RRVRVRVRVRR/VB pV^ ,          pVR,          p	V P                  V	4      p	\        P                  ! 4       ! V	4      p	V P	                  V	4      p	V P                  V	4      p
RpVEe˜   V P                  P                  f–   V P                  ^8X  d   RV P                  n        MrV 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  dK   \        4       pV P                  ^8X  d'   V! V
P                  4       VP                  4       4      pMŽV! W¤4      pM…V P                  P                  R	8X  d>   \        4       pV! V
P!                  RV P                  4      VP!                  R4      4      pM-V P                  P                  R
8X  d   \#        4       pV! W¤4      p\%        VV
VP&                  VP(                  R7      # )ae  
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 regression loss is computed (Mean-Square loss), If
    `config.num_labels > 1` a classification loss is computed (Cross-Entropy).
rl   rŠ   rm   rf   rk  TNÚ
regressionÚsingle_label_classificationÚmulti_label_classificationrl  r  ©r;   r/   rW   )rý   r|  r   ÚReLUrb   r}  rM   Úproblem_typer{  rq   r(   ru   r'   r   Úsqueezer   r¸   r   r   r³   rþ   )rh   rl   rŠ   rm   ri  rf   rŒ   Údistilbert_outputÚhidden_stateÚpooled_outputrn  rm  Úloss_fcts   &&&&&&,      r+   rz   Ú+DistilBertForSequenceClassification.forward7  sæ  € ð" !ŸOšOñ 
Øð
à)ð
ð (ð
ð &ð	
ð
 ð
ð ñ
Ðð )¨Õ+ˆØ$ TÕ*ˆØ×+Ñ+¨MÓ:ˆÜŸšœ	 -Ó0ˆØŸ™ ]Ó3ˆØ—‘ Ó/ˆàˆØÓØ�{‰{×'Ñ'Ò/Ø—?‘? aÔ'Ø/;�D—K‘KÕ,Ø—_‘_ qÔ(¨f¯l©l¼e¿j¹jÔ.HÈFÏLÉLÔ\a×\eÑ\eÔLeØ/L�D—K‘KÕ,à/K�D—K‘KÔ,à�{‰{×'Ñ'¨<Ô7Ü"›9�Ø—?‘? aÔ'Ù# F§N¡NÓ$4°f·n±nÓ6FÓG‘Dá# FÓ3‘DØ—‘×)Ñ)Ð-JÔJÜ+Ó-�Ù §¡¨B°·±Ó @À&Ç+Á+ÈbÃ/ÓR‘Ø—‘×)Ñ)Ð-IÔIÜ,Ó.�Ù Ó/�ä'ØØØ+×9Ñ9Ø(×3Ñ3ô	
ð 	
r-   )r}  rM   rý   rb   r{  r|  rs  ©r}   r~   r   r€   rY   r$  r3  r   r   rz   r�   r‚   rƒ   r„   s   @@r+   rv  rv    sK   ù‡ € ÷ó ÷9ð 9÷Pð Pð Ø÷:
ñ :
ó ó ÷:
ð :
r-   rv  c                   óŒ   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V3R lR lt]]RV3R lR	 ll4       4       t	R
t
VtV ;t# )ÚDistilBertForQuestionAnsweringiv  c                ó    <€ V ^8„  d   QhRS[ /# rL   r	   )r*   rN   s   "€r+   r,   Ú+DistilBertForQuestionAnswering.__annotate__x  ry  r-   c                ób  <€ \         SV `  V4       \        V4      V n        \        P
                  ! VP                  VP                  4      V n        VP                  ^8w  d   \        RVP                   24      h\        P                  ! VP                  4      V n        V P                  4        R# )r"   z)config.num_labels should be 2, but it is N)rX   rY   r  rý   r   r©   r$   r{  Ú
qa_outputsr¨   ra   Ú
qa_dropoutrb   r  rg   s   &&€r+   rY   Ú'DistilBertForQuestionAnswering.__init__x  s‚   ø€ Ü‰Ñ˜Ô ä)¨&Ó1ˆŒÜŸ)š) F§J¡J°×0AÑ0AÓBˆŒØ×Ñ Ô!ÜÐHÈ×IZÑIZÐH[Ð\Ó]Ð]ä—z’z &×"3Ñ"3Ó4ˆŒð 	�‰Ör-   c                ó4   <€ V ^8„  d   QhRS[ P                  /# r  r   )r*   rN   s   "€r+   r,   r˜  …  rQ  r-   c                ó6   € V P                   P                  4       # r"  rS  r#  s   &r+   r$  Ú6DistilBertForQuestionAnswering.get_position_embeddings…  rU  r-   c                ó    <€ V ^8„  d   QhRS[ /# r'  r)  )r*   rN   s   "€r+   r,   r˜  ‹  rW  r-   c                ó<   € V P                   P                  V4       R# rY  rZ  r[  s   &&r+   r3  Ú9DistilBertForQuestionAnswering.resize_position_embeddings‹  r]  r-   c                ó^  <€ V ^8„  d   QhRS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[ P                  R,          RS[S[,          R	S[S[S[ P                  R
3,          ,          /# )r"   rl   NrŠ   rm   Ústart_positionsÚend_positionsrf   rŒ   rn   .)r(   r)   r   r   r   r´   )r*   rN   s   "€r+   r,   r˜  ›  sª   ø€ ÷ >
ñ >
á—<‘< $Õ&ð>
ñ Ÿ™ tÕ+ð>
ñ —|‘| dÕ*ð	>
ñ
 Ÿ™¨Õ,ð>
ñ —|‘| dÕ*ð>
ñ —l‘l TÕ)ð>
ñ Ñ+Õ,ð>
ñ 
&©©e¯l©l¸CÐ.?Õ(@Õ	@ñ>
r-   c                ó&  € V P                   ! RRVRVRVRVRR/VB pV^ ,          p	V P                  V	4      p	V P                  V	4      p
V
P                  ^RR7      w  r¼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\        P                  ! VR	7      pV! W´4      pV! WÅ4      pVV,           ^,          p\        VVVVP                  VP                  R
7      # )rC  rl   rŠ   rm   rf   rk  Tr�   N)Úignore_index)rm  Ústart_logitsÚ
end_logitsr³   rþ   r  rW   )rý   rb   rš  ÚsplitrŽ  r˜   Úlenrs   Úclampr   r   r   r³   rþ   )rh   rl   rŠ   rm   r¤  r¥  rf   rŒ   r�  r³   rn  r¨  r©  Ú
total_lossÚignored_indexr’  Ú
start_lossÚend_losss   &&&&&&&,          r+   rz   Ú&DistilBertForQuestionAnswering.forward™  s¥  € ð2 !ŸOšOñ 
Øð
à)ð
ð (ð
ð &ð	
ð
 ð
ð ñ
Ðð *¨!Õ,ˆàŸ™ ]Ó3ˆØ—‘ Ó/ˆØ#)§<¡<°°r <Ó#:Ñ ˆØ#×+Ñ+¨BÓ/×:Ñ:Ó<ˆØ×'Ñ'¨Ó+×6Ñ6Ó8ˆ
àˆ
ØÒ&¨=Ò+Dä�?×'Ñ'Ó)Ó*¨QÔ.Ø"1×"9Ñ"9¸"Ó"=�Ü�=×%Ñ%Ó'Ó(¨1Ô,Ø -× 5Ñ 5°bÓ 9�à(×-Ñ-¨aÓ0ˆMØ-×3Ñ3°A°}ÓEˆOØ)×/Ñ/°°=ÓAˆMä×*Ò*¸ÔFˆHÙ! ,Ó@ˆJÙ 
Ó:ˆHØ$ xÕ/°1Õ4ˆJä+ØØ%Ø!Ø+×9Ñ9Ø(×3Ñ3ô
ð 	
r-   )rý   rb   rš  )NNNNNNr”  r„   s   @@r+   r–  r–  v  sK   ù‡ € ÷ó ÷9ð 9÷Pð Pð Ø÷>
ñ >
ó ó ÷>
ð >
r-   r–  c                   óŒ   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V3R lR lt]]RV3R lR	 ll4       4       t	R
t
VtV ;t# )Ú DistilBertForTokenClassificationiÜ  c                ó    <€ V ^8„  d   QhRS[ /# rL   r	   )r*   rN   s   "€r+   r,   Ú-DistilBertForTokenClassification.__annotate__Þ  ó   ø€ ÷ 	ñ 	Ñ/ñ 	r-   c                ó2  <€ \         SV `  V4       VP                  V n        \        V4      V n        \
        P                  ! VP                  4      V n        \
        P                  ! VP                  VP                  4      V n
        V P                  4        R # rÃ   )rX   rY   r{  r  rý   r   ra   rb   r©   Úhidden_sizer}  r  rg   s   &&€r+   rY   Ú)DistilBertForTokenClassification.__init__Þ  sg   ø€ Ü‰Ñ˜Ô Ø ×+Ñ+ˆŒä)¨&Ó1ˆŒÜ—z’z &§.¡.Ó1ˆŒÜŸ)š) F×$6Ñ$6¸×8IÑ8IÓJˆŒð 	�‰Ör-   c                ó4   <€ V ^8„  d   QhRS[ P                  /# r  r   )r*   rN   s   "€r+   r,   rµ  é  rQ  r-   c                ó6   € V P                   P                  4       # r"  rS  r#  s   &r+   r$  Ú8DistilBertForTokenClassification.get_position_embeddingsé  rU  r-   c                ó    <€ V ^8„  d   QhRS[ /# r'  r)  )r*   rN   s   "€r+   r,   rµ  ï  rW  r-   c                ó<   € V P                   P                  V4       R# rY  rZ  r[  s   &&r+   r3  Ú;DistilBertForTokenClassification.resize_position_embeddingsï  r]  r-   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[ P                  R,          RS[S[,          RS[S[S[ P                  R	3,          ,          /# rh  )r(   r)   ro   r   r   r   r´   )r*   rN   s   "€r+   r,   rµ  ÿ  s™   ø€ ÷ %
ñ %
á—<‘< $Õ&ð%
ñ Ÿ™ tÕ+ð%
ñ —|‘| dÕ*ð	%
ñ
 × Ñ  4Õ'ð%
ñ —l‘l TÕ)ð%
ñ Ñ+Õ,ð%
ñ 
¡¡u§|¡|°SÐ'8Õ!9Õ	9ñ%
r-   c                óX  € V P                   ! V3RVRVRVRR/VB pV^ ,          pV P                  V4      pV P                  V4      p	Rp
Ve=   \        4       pV! V	P	                  RV P
                  4      VP	                  R4      4      p
\        V
V	VP                  VP                  R7      # )	zÃ
labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
    Labels for computing the token classification loss. Indices should be in `[0, ..., config.num_labels - 1]`.
rŠ   rm   rf   rk  TNrl  rW   )	rý   rb   r}  r   r¸   r{  r   r³   rþ   )rh   rl   rŠ   rm   ri  rf   rŒ   ÚoutputsÚsequence_outputrn  rm  r’  s   &&&&&&,     r+   rz   Ú(DistilBertForTokenClassification.forwardý  sÇ   € ð —/’/Øñ
à)ð
ð (ð
ð &ð	
ð
 ð
ð ñ
ˆð " !�*ˆàŸ,™, Ó7ˆØ—‘ Ó1ˆàˆØÒÜ'Ó)ˆHÙ˜FŸK™K¨¨D¯O©OÓ<¸f¿k¹kÈ"»oÓNˆDä$ØØØ!×/Ñ/Ø×)Ñ)ô	
ð 	
r-   )r}  rý   rb   r{  rs  r”  r„   s   @@r+   r³  r³  Ü  sK   ù‡ € ÷	ó 	÷9ð 9÷Pð Pð Ø÷%
ñ %
ó ó ÷%
ð %
r-   r³  c                   óŒ   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V3R lR lt]]RV3R lR	 ll4       4       t	R
t
VtV ;t# )ÚDistilBertForMultipleChoicei'  c                ó    <€ V ^8„  d   QhRS[ /# rL   r	   )r*   rN   s   "€r+   r,   Ú(DistilBertForMultipleChoice.__annotate__)  r¶  r-   c                ó\  <€ \         SV `  V4       \        V4      V n        \        P
                  ! VP                  VP                  4      V n        \        P
                  ! VP                  ^4      V n        \        P                  ! VP                  4      V n        V P                  4        R# )r<   N)rX   rY   r  rý   r   r©   r$   r|  r}  ra   r~  rb   r  rg   s   &&€r+   rY   Ú$DistilBertForMultipleChoice.__init__)  so   ø€ Ü‰Ñ˜Ô ä)¨&Ó1ˆŒÜ Ÿiši¨¯
©
°F·J±JÓ?ˆÔÜŸ)š) F§J¡J°Ó2ˆŒÜ—z’z &×"<Ñ"<Ó=ˆŒð 	�‰Ör-   c                ó4   <€ V ^8„  d   QhRS[ P                  /# r  r   )r*   rN   s   "€r+   r,   rÈ  4  rQ  r-   c                ó6   € V P                   P                  4       # r"  rS  r#  s   &r+   r$  Ú3DistilBertForMultipleChoice.get_position_embeddings4  rU  r-   c                ó    <€ V ^8„  d   QhRS[ /# r'  r)  )r*   rN   s   "€r+   r,   rÈ  :  rW  r-   c                ó<   € V P                   P                  V4       R# )aƒ  
Resizes position embeddings of the model if `new_num_position_embeddings != config.max_position_embeddings`.

Arguments:
    new_num_position_embeddings (`int`)
        The number of new position embeddings. If position embeddings are learned, increasing the size will add
        newly initialized vectors at the end, whereas reducing the size will remove vectors from the end. If
        position embeddings are not learned (*e.g.* sinusoidal position embeddings), increasing the size will
        add correct vectors at the end following the position encoding algorithm, whereas reducing the size
        will remove vectors from the end.
NrZ  r[  s   &&r+   r3  Ú6DistilBertForMultipleChoice.resize_position_embeddings:  r]  r-   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[ P                  R,          RS[S[,          RS[S[S[ P                  R	3,          ,          /# rh  )r(   r)   ro   r   r   r   r´   )r*   rN   s   "€r+   r,   rÈ  J  s¢   ø€ ÷ U
ñ U
á—<‘< $Õ&ðU
ñ Ÿ™ tÕ+ðU
ñ —|‘| dÕ*ð	U
ñ
 × Ñ  4Õ'ðU
ñ —l‘l TÕ)ðU
ñ Ñ+Õ,ðU
ñ 
#¡U©5¯<©<¸Ð+<Õ%=Õ	=ñU
r-   c                óð  € Ve   VP                   ^,          MVP                   ^,          pVe"   VP                  RVP                  R4      4      MRpVe"   VP                  RVP                  R4      4      MRpVe2   VP                  RVP                  R	4      VP                  R4      4      MRpV P                  ! V3RVRVRVRR/VB pV^ ,          p	V	R
,          p
V P	                  V
4      p
\
        P                  ! 4       ! V
4      p
V P                  V
4      p
V P                  V
4      pVP                  RV4      pRpVe   \        4       pV! WÄ4      p\        VVVP                  VP                  R7      # )av  
input_ids (`torch.LongTensor` of shape `(batch_size, num_choices, sequence_length)`):
    Indices of input sequence tokens in the vocabulary.

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

    [What are input IDs?](../glossary#input-ids)
inputs_embeds (`torch.FloatTensor` of shape `(batch_size, num_choices, 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.
labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
    Labels for computing the multiple choice classification loss. Indices should be in `[0, ...,
    num_choices-1]` where `num_choices` is the size of the second dimension of the input tensors. (See
    `input_ids` above)

Examples:

```python
>>> from transformers import AutoTokenizer, DistilBertForMultipleChoice
>>> import torch

>>> tokenizer = AutoTokenizer.from_pretrained("distilbert-base-cased")
>>> model = DistilBertForMultipleChoice.from_pretrained("distilbert-base-cased")

>>> prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
>>> choice0 = "It is eaten with a fork and a knife."
>>> choice1 = "It is eaten while held in the hand."
>>> labels = torch.tensor(0).unsqueeze(0)  # choice0 is correct (according to Wikipedia ;)), batch size 1

>>> encoding = tokenizer([[prompt, choice0], [prompt, choice1]], return_tensors="pt", padding=True)
>>> outputs = model(**{k: v.unsqueeze(0) for k, v in encoding.items()}, labels=labels)  # batch size is 1

>>> # the linear classifier still needs to be trained
>>> loss = outputs.loss
>>> logits = outputs.logits
```NrŠ   rm   rf   rk  Trl  rW   éþÿÿÿr‹  )r·   r¸   rs   rý   r|  r   rŒ  rb   r}  r   r   r³   rþ   )rh   rl   rŠ   rm   ri  rf   rŒ   Únum_choicesrÂ  r�  r‘  rn  Úreshaped_logitsrm  r’  s   &&&&&&,        r+   rz   Ú#DistilBertForMultipleChoice.forwardH  sŒ  € ðb -6Ò,A�i—o‘o aÖ(À}×GZÑGZÐ[\ÕG]ˆà>GÒ>S�I—N‘N 2 y§~¡~°bÓ'9Ô:ÐY]ˆ	ØM[ÒMg˜×,Ñ,¨R°×1DÑ1DÀRÓ1HÔIÐmqˆð Ò(ð ×Ñ˜r =×#5Ñ#5°bÓ#9¸=×;MÑ;MÈbÓ;QÔRàð 	ð —/’/Øñ
à)ð
ð (ð
ð &ð	
ð
 ð
ð ñ
ˆð ˜q•zˆØ$ TÕ*ˆØ×+Ñ+¨MÓ:ˆÜŸšœ	 -Ó0ˆØŸ™ ]Ó3ˆØ—‘ Ó/ˆà Ÿ+™+ b¨+Ó6ˆàˆØÒÜ'Ó)ˆHÙ˜OÓ4ˆDä(ØØ"Ø!×/Ñ/Ø×)Ñ)ô	
ð 	
r-   )r}  rý   rb   r|  rs  r”  r„   s   @@r+   rÆ  rÆ  '  sO   ù‡ € ÷	ó 	÷9ð 9÷Pð Pð Ø÷U
ñ U
ó ó ÷U
ð U
r-   rÆ  )Nr¶   )rG  rÆ  r–  rv  r³  r  rü   )EÚ__doc__Úcollections.abcr   Únumpyr=   r(   r   Útorch.nnr   r   r   Ú r   r  Úactivationsr   Úconfiguration_utilsr
   Úintegrations.deepspeedr   Úmasking_utilsr   Úmodeling_layersr   Úmodeling_outputsr   r   r   r   r   r   Úmodeling_utilsr   r   Úprocessing_utilsr   Úpytorch_utilsr   Úutilsr   r   r   Úutils.genericr   r   Úutils.output_capturingr   Úconfiguration_distilbertr   Ú
get_loggerr}   r,  r8   r7   r�   rJ   r›   r�   rÅ   rÜ   rí   rü   r  rG  rv  r–  r³  rÆ  Ú__all__r  r-   r+   Ú<module>rë     sË  ðñõ
 %ã Û Ý ß AÑ Aå &Ý )Ý 3Ý @Ý 6Ý 9÷÷ ÷ GÝ &õ÷ñ ÷
 JÝ 5Ý 6ð 
×	Ò	˜HÓ	%€õLõô$�—‘ô $÷P%ô85)˜bŸi™iô 5)ôpˆ"�)‰)ô ô* Ð1ô  ôF@�"—)‘)ô @ð0 ôi ó ió ðið< ôg
Ð/ó g
ó ðg
ñT ðôô
_
Ð5ó _
óð
_
ñD ðôô^
Ð*Có ^
óð^
ðB ôb
Ð%>ó b
ó ðb
ðJ ôG
Ð'@ó G
ó ðG
ðT ôw
Ð";ó w
ó ðw
òt‚r-   