+
    œ°³jÖº  ã                   ó"  € R 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Ht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HtHt ^RI H!t! ^RI"H#t# ^RI$H%t%H&t& ^RI'H(t( ]&PR                  ! ]*4      t+ ! R R]PX                  4      t- ! R R]PX                  4      t. ! R R]PX                  4      t/ ! R R]PX                  4      t0 ! R R]PX                  4      t1 ! R R]PX                  4      t2 ! R R]PX                  4      t3 ! R R]4      t4 ! R R ]PX                  4      t5 ! R! R"]PX                  4      t6 ! R# R$]PX                  4      t7 ! R% R&]PX                  4      t8]% ! R' R(]!4      4       t9]%! R)R*7       ! R+ R,]94      4       t:]% ! R- R.]94      4       t;]%! R/R*7       ! R0 R1]9]4      4       t<]%! R2R*7       ! R3 R4]94      4       t=]% ! R5 R6]94      4       t>]% ! R7 R8]94      4       t?]% ! R9 R:]94      4       t@. R;OtAR# )<zPyTorch RemBERT model.N)Únn)ÚBCEWithLogitsLossÚCrossEntropyLossÚMSELoss)Úinitialization)ÚACT2FN)ÚCacheÚDynamicCacheÚEncoderDecoderCache)ÚGenerationMixin)Úcreate_bidirectional_mask)ÚGradientCheckpointingLayer)Ú)BaseModelOutputWithPastAndCrossAttentionsÚ,BaseModelOutputWithPoolingAndCrossAttentionsÚ!CausalLMOutputWithCrossAttentionsÚMaskedLMOutputÚMultipleChoiceModelOutputÚQuestionAnsweringModelOutputÚSequenceClassifierOutputÚTokenClassifierOutput)ÚPreTrainedModel)Úapply_chunking_to_forward)Úauto_docstringÚlogging©ÚRemBertConfigc                   óL   a a€ ] tR t^/t oRtV 3R ltRV3R lR lltRtVtV ;t	# )ÚRemBertEmbeddingszGConstruct the embeddings from word, position and token_type embeddings.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                  VP
                  4      V n        \        P                  ! VP
                  VP                  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©ÚepsF)Ú
persistentN©é   éÿÿÿÿ)ÚsuperÚ__init__r   Ú	EmbeddingÚ
vocab_sizeÚinput_embedding_sizeÚpad_token_idÚword_embeddingsÚmax_position_embeddingsÚposition_embeddingsÚtype_vocab_sizeÚtoken_type_embeddingsÚ	LayerNormÚlayer_norm_epsÚDropoutÚhidden_dropout_probÚdropoutÚBufferÚtorchÚarangeÚexpandÚposition_ids©ÚselfÚconfigÚ	__class__s   &&€Úm/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/rembert/modeling_rembert.pyr'   ÚRemBertEmbeddings.__init__2   sÞ   ø€ Ü‰ÑÔÜ!Ÿ|š|Ø×Ñ˜v×:Ñ:È×H[ÑH[ô 
ˆÔô $&§<¢<°×0NÑ0NÐPV×PkÑPkÓ#lˆÔ Ü%'§\¢\°&×2HÑ2HÈ&×JeÑJeÓ%fˆÔ"äŸš f×&AÑ&AÀv×G\ÑG\Ô]ˆŒÜ—z’z &×"<Ñ"<Ó=ˆŒô ŸIšI¤e§l¢l°6×3QÑ3QÓ&R×&YÑ&YÐZaÓ&bÐotÔuˆÖó    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S[ P                  /# )é   Ú	input_idsNÚtoken_type_idsr:   Úinputs_embedsÚpast_key_values_lengthÚreturn)r7   Ú
LongTensorÚFloatTensorÚintÚTensor)ÚformatÚ__classdict__s   "€r?   Ú__annotate__ÚRemBertEmbeddings.__annotate__@   sw   ø€ ÷ ñ á×#Ñ# dÕ*ðñ ×(Ñ(¨4Õ/ðñ ×&Ñ&¨Õ-ð	ñ
 ×(Ñ(¨4Õ/ðñ !$ðñ 
�‰ñrA   c                óú  € Ve   VP                  4       pMVP                  4       R R pV^,          pVf   V P                  RWWV,           13,          pVf<   \        P                  ! V\        P                  V P                  P
                  R7      pVf   V P                  V4      pV P                  V4      pWH,           p	V P                  V4      p
Wš,          p	V P                  V	4      p	V P                  V	4      p	V	# )NºNNN©ÚdtypeÚdevicer%   )Úsizer:   r7   ÚzerosÚlongrU   r,   r0   r.   r1   r5   )r<   rD   rE   r:   rF   rG   Úinput_shapeÚ
seq_lengthr0   Ú
embeddingsr.   s   &&&&&&     r?   ÚforwardÚRemBertEmbeddings.forward@   së   € ð Ò Ø#Ÿ.™.Ó*‰Kà'×,Ñ,Ó.¨s°Ð3ˆKà  •^ˆ
àÒØ×,Ñ,¨QÐ0FÐVlÕIlÐ0lÐ-lÕmˆLàÒ!Ü"Ÿ[š[¨¼E¿J¹JÈt×O`ÑO`×OgÑOgÔhˆNàÒ Ø ×0Ñ0°Ó;ˆMØ $× :Ñ :¸>Ó JÐà"Õ:ˆ
Ø"×6Ñ6°|ÓDÐØÕ)ˆ
Ø—^‘^ JÓ/ˆ
Ø—\‘\ *Ó-ˆ
ØÐrA   )r1   r5   r.   r:   r0   r,   )NNNNé    )
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r'   r\   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©r>   rN   s   @@r?   r   r   /   s   ù‡ € ÙQõv÷÷ ò rA   r   c                   óD   a a€ ] tR t^bt oV 3R ltV3R lR ltRtVtV ;t# )ÚRemBertPoolerc                ó¸   <€ \         SV `  4        \        P                  ! VP                  VP                  4      V n        \        P                  ! 4       V n        R # ©N)r&   r'   r   ÚLinearÚhidden_sizeÚdenseÚTanhÚ
activationr;   s   &&€r?   r'   ÚRemBertPooler.__init__c   s9   ø€ Ü‰ÑÔÜ—Y’Y˜v×1Ñ1°6×3EÑ3EÓFˆŒ
ÜŸ'š'›)ˆŽrA   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# ©rC   Úhidden_statesrH   ©r7   rL   )rM   rN   s   "€r?   rO   ÚRemBertPooler.__annotate__h   s#   ø€ ÷ ñ ¡U§\¡\ð ±e·l±lñ rA   c                ó\   € VR,          pV P                  V4      pV P                  V4      pV# )rR   )rR   r^   )rn   rp   )r<   rt   Úfirst_token_tensorÚpooled_outputs   &&  r?   r\   ÚRemBertPooler.forwardh   s2   € ð +¨4Õ0ÐØŸ
™
Ð#5Ó6ˆØŸ™¨Ó6ˆØÐrA   )rp   rn   ©	r_   r`   ra   rb   r'   r\   rd   re   rf   rg   s   @@r?   ri   ri   b   s   ù‡ € õ$÷
÷ ð rA   ri   c                   óL   a a€ ] tR t^qt oRV 3R lltRV3R lR lltRtVtV ;t# )ÚRemBertSelfAttentionc                ó,  <€ \         SV `  4        VP                  VP                  ,          ^ 8w  d9   \	        VR4      '       g'   \        RVP                   RVP                   R24      hVP                  V n        \        VP                  VP                  ,          4      V n        V P                  V P                  ,          V n        \        P                  ! V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        VP"                  V n        W n        R# )r^   Úembedding_sizezThe hidden size (z6) is not a multiple of the number of attention heads (Ú)N)r&   r'   rm   Únum_attention_headsÚhasattrÚ
ValueErrorrK   Úattention_head_sizeÚall_head_sizer   rl   ÚqueryÚkeyÚvaluer3   Úattention_probs_dropout_probr5   Ú
is_decoderÚ	layer_idx©r<   r=   r‹   r>   s   &&&€r?   r'   ÚRemBertSelfAttention.__init__r   s1  ø€ Ü‰ÑÔØ×Ñ × :Ñ :Õ:¸aÔ?ÌÐPVÐXh×HiÒHiÜØ# F×$6Ñ$6Ð#7ð 8Ø ×4Ñ4Ð5°Qð8óð ð
 $*×#=Ñ#=ˆÔ Ü#& v×'9Ñ'9¸F×<VÑ<VÕ'VÓ#WˆÔ Ø!×5Ñ5¸×8PÑ8PÕPˆÔä—Y’Y˜v×1Ñ1°4×3EÑ3EÓFˆŒ
Ü—9’9˜V×/Ñ/°×1CÑ1CÓDˆŒÜ—Y’Y˜v×1Ñ1°4×3EÑ3EÓFˆŒ
ä—z’z &×"EÑ"EÓFˆŒà ×+Ñ+ˆŒØ"ŽrA   c                ó¤   <€ V ^8„  d   QhRS[ P                  RS[ P                  R,          RS[ P                  R,          RS[R,          RS[RS[/# ©rC   rt   Úattention_maskNÚencoder_hidden_statesÚpast_key_valuesÚoutput_attentionsrH   ©r7   rL   rJ   r   ÚboolÚtuple)rM   rN   s   "€r?   rO   Ú!RemBertSelfAttention.__annotate__‡   sm   ø€ ÷ @.ñ @.á—|‘|ð@.ñ ×)Ñ)¨DÕ0ð@.ñ  %×0Ñ0°4Õ7ð	@.ñ
  �ð@.ñ  ð@.ñ 
ñ@.rA   c                ó  € 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R J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                   R R ORNV P                  N5pV P                  V4      P                  V4      P	                  ^^4      pV P!                  V4      P                  V4      P	                  ^^4      pVeV   XP#                  WïV P                  4      w  rïV'       d0   \        V\        4      '       d   RVP                  V P                  &   \$        P&                  ! WžP	                  RR4      4      pV\(        P*                  ! V P                  4      ,          pVe
   VV,           p\,        P.                  P1                  VRR7      pV P3                  V4      p\$        P&                  ! VV4      pVP5                  ^ ^^^4      P7                  4       pVP9                  4       R R V P:                  3,           pVP                  ! V!  pVV3# )NFT©Údimr%   éþÿÿÿ)Úshaper„   r†   ÚviewÚ	transposeÚ
isinstancer
   Ú
is_updatedÚgetr‹   Úcross_attention_cacheÚself_attention_cacheÚlayersÚkeysÚvaluesr‡   rˆ   Úupdater7   ÚmatmulÚmathÚsqrtr   Ú
functionalÚsoftmaxr5   ÚpermuteÚ
contiguousrV   r…   )r<   rt   r�   r‘   r’   r“   ÚkwargsrY   Úhidden_shapeÚquery_layerr    Úis_cross_attentionÚcurr_past_key_valuesÚcurrent_statesÚ	key_layerÚvalue_layerÚkv_shapeÚattention_scoresÚattention_probsÚcontext_layerÚnew_context_layer_shapes   &&&&&&,              r?   r\   ÚRemBertSelfAttention.forward‡   sœ  € ð $×)Ñ)¨#¨2Ð.ˆØC˜ÐC bÐC¨$×*BÑ*BÑCˆØ—j‘j Ó/×4Ñ4°\ÓB×LÑLÈQÐPQÓRˆàˆ
Ø2¸$Ð>ÐØÒ&Ü˜/Ô+>×?Ò?Ø,×7Ñ7×;Ñ;¸D¿N¹NÓK�
ß%à+:×+PÑ+PÑ(à+:×+OÑ+OÑ(à'6Ð$ç2DÑ.È-ˆß /Ò"=Ç*à,×3Ñ3°D·N±NÕC×HÑHˆIØ.×5Ñ5°d·n±nÕE×LÑL‰KàQ˜×-Ñ-¨c¨rÐ2ÐQ°BÐQ¸×8PÑ8PÑQˆHØŸ™ Ó0×5Ñ5°hÓ?×IÑIÈ!ÈQÓOˆIØŸ*™* ^Ó4×9Ñ9¸(ÓC×MÑMÈaÐQRÓSˆKàÒ*à)=×)DÑ)DÀYÐ]a×]kÑ]kÓ)lÑ&�	ç%¬*°_ÔFY×*ZÒ*ZØAE�O×.Ñ.¨t¯~©~Ñ>ô !Ÿ<š<¨×5HÑ5HÈÈRÓ5PÓQÐà+¬d¯iªi¸×8PÑ8PÓ.QÕQÐØÒ%à/°.Õ@Ðô Ÿ-™-×/Ñ/Ð0@ÀbÐ/ÓIˆð Ÿ,™, Ó7ˆäŸš _°kÓBˆà%×-Ñ-¨a°°A°qÓ9×DÑDÓFˆØ"/×"4Ñ"4Ó"6°s¸Ð";¸t×?QÑ?QÐ>SÕ"SÐØ%×*Ò*Ð,CÑDˆà˜oÐ-Ð-rA   )	r…   r„   r5   rŠ   r‡   r‹   r�   r†   rˆ   rk   ©NNNFr{   rg   s   @@r?   r}   r}   q   s   ù‡ € ÷#÷*@.÷ @.ò @.rA   r}   c                   óD   a a€ ] tR t^Ët oV 3R ltV3R lR ltRtVtV ;t# )ÚRemBertSelfOutputc                ó0  <€ \         SV `  4        \        P                  ! VP                  VP                  4      V n        \        P                  ! VP                  VP                  R 7      V n        \        P                  ! VP                  4      V n
        R# ©r    N)r&   r'   r   rl   rm   rn   r1   r2   r3   r4   r5   r;   s   &&€r?   r'   ÚRemBertSelfOutput.__init__Ì   s`   ø€ Ü‰ÑÔÜ—Y’Y˜v×1Ñ1°6×3EÑ3EÓFˆŒ
ÜŸš f×&8Ñ&8¸f×>SÑ>SÔTˆŒÜ—z’z &×"<Ñ"<Ó=ˆŽrA   c                óh   <€ V ^8„  d   QhRS[ P                  RS[ P                  RS[ P                  /# ©rC   rt   Úinput_tensorrH   ru   )rM   rN   s   "€r?   rO   ÚRemBertSelfOutput.__annotate__Ò   ó1   ø€ ÷ ñ ¡U§\¡\ð ÁÇÁð ÑRW×R^ÑR^ñ rA   c                óx   € V P                  V4      pV P                  V4      pV P                  W,           4      pV# rk   ©rn   r5   r1   ©r<   rt   rÅ   s   &&&r?   r\   ÚRemBertSelfOutput.forwardÒ   ó5   € ØŸ
™
 =Ó1ˆØŸ™ ]Ó3ˆØŸ™ }Õ'CÓDˆØÐrA   ©r1   rn   r5   r{   rg   s   @@r?   r¿   r¿   Ë   ó   ù‡ € õ>÷÷ ð rA   r¿   c                   óL   a a€ ] tR t^Ùt oRV 3R lltRV3R lR lltRtVtV ;t# )ÚRemBertAttentionc                óf   <€ \         SV `  4        \        WR 7      V n        \	        V4      V n        R# )©r‹   N)r&   r'   r}   r<   r¿   ÚoutputrŒ   s   &&&€r?   r'   ÚRemBertAttention.__init__Ú   s&   ø€ Ü‰ÑÔÜ(¨ÔEˆŒ	Ü'¨Ó/ˆŽrA   c                óÖ   <€ V ^8„  d   QhRS[ P                  RS[ P                  R,          RS[ P                  R,          RS[R,          RS[R,          RS[S[ P                  ,          /# r�   r”   )rM   rN   s   "€r?   rO   ÚRemBertAttention.__annotate__ß   sr   ø€ ÷ ñ á—|‘|ðñ ×)Ñ)¨DÕ0ðñ  %×0Ñ0°4Õ7ð	ñ
  �ðñ   $�;ðñ 
‰u�|‰|Õ	ñrA   c                ó†   € V P                  VVVVVR 7      pV P                  V^ ,          V4      pV3VR,          ,           p	V	# )©r�   r‘   r’   r“   ºr$   NN)r<   rÓ   )
r<   rt   r�   r‘   r’   r“   r¯   Úself_outputsÚattention_outputÚoutputss
   &&&&&&,   r?   r\   ÚRemBertAttention.forwardß   sT   € ð —y‘yØØ)Ø"7Ø+Ø/ð !ó 
ˆð  Ÿ;™; |°A¥¸ÓFÐØ#Ð%¨°RÕ(8Õ8ˆØˆrA   )rÓ   r<   rk   r½   r{   rg   s   @@r?   rÐ   rÐ   Ù   s   ù‡ € ÷0÷
÷ ò rA   rÐ   c                   óD   a a€ ] tR t^õt oV 3R ltV3R lR ltRtVtV ;t# )ÚRemBertIntermediatec                ó"  <€ \         SV `  4        \        P                  ! VP                  VP
                  4      V n        \        VP                  \        4      '       d   \        VP                  ,          V n        R # VP                  V n        R # rk   )r&   r'   r   rl   rm   Úintermediate_sizern   rŸ   Ú
hidden_actÚstrr   Úintermediate_act_fnr;   s   &&€r?   r'   ÚRemBertIntermediate.__init__ö   s`   ø€ Ü‰ÑÔÜ—Y’Y˜v×1Ñ1°6×3KÑ3KÓLˆŒ
Ü�f×'Ñ'¬×-Ò-Ü'-¨f×.?Ñ.?Õ'@ˆDÖ$à'-×'8Ñ'8ˆDÖ$rA   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# rs   ru   )rM   rN   s   "€r?   rO   Ú RemBertIntermediate.__annotate__þ   s#   ø€ ÷ ñ ¡U§\¡\ð ±e·l±lñ rA   c                óJ   € V P                  V4      pV P                  V4      pV# rk   ©rn   rä   ©r<   rt   s   &&r?   r\   ÚRemBertIntermediate.forwardþ   s&   € ØŸ
™
 =Ó1ˆØ×0Ñ0°Ó?ˆØÐrA   ré   r{   rg   s   @@r?   rß   rß   õ   s   ù‡ € õ9÷÷ ð rA   rß   c                   óD   a a€ ] tR tRt oV 3R ltV3R lR ltRtVtV ;t# )ÚRemBertOutputi  c                ó0  <€ \         SV `  4        \        P                  ! VP                  VP
                  4      V n        \        P                  ! VP
                  VP                  R 7      V n        \        P                  ! VP                  4      V n        R# rÁ   )r&   r'   r   rl   rá   rm   rn   r1   r2   r3   r4   r5   r;   s   &&€r?   r'   ÚRemBertOutput.__init__  s`   ø€ Ü‰ÑÔÜ—Y’Y˜v×7Ñ7¸×9KÑ9KÓLˆŒ
ÜŸš f×&8Ñ&8¸f×>SÑ>SÔTˆŒÜ—z’z &×"<Ñ"<Ó=ˆŽrA   c                óh   <€ V ^8„  d   QhRS[ P                  RS[ P                  RS[ P                  /# rÄ   ru   )rM   rN   s   "€r?   rO   ÚRemBertOutput.__annotate__  rÇ   rA   c                óx   € V P                  V4      pV P                  V4      pV P                  W,           4      pV# rk   rÉ   rÊ   s   &&&r?   r\   ÚRemBertOutput.forward  rÌ   rA   rÍ   r{   rg   s   @@r?   rí   rí     rÎ   rA   rí   c                   óR   a a€ ] tR tRt oRV 3R lltRV3R lR lltR tRtVtV ;t	# )	ÚRemBertLayeri  c                ó~  <€ \         SV `  4        VP                  V n        ^V n        \	        W4      V n        VP                  V n        VP                  V n        V P                  '       d2   V P                  '       g   \        V  R24      h\	        WR7      V n	        \        V4      V n        \        V4      V n        R# )r$   z> should be used as a decoder model if cross attention is addedrÒ   N)r&   r'   Úchunk_size_feed_forwardÚseq_len_dimrÐ   Ú	attentionrŠ   Úadd_cross_attentionrƒ   Úcrossattentionrß   Úintermediaterí   rÓ   rŒ   s   &&&€r?   r'   ÚRemBertLayer.__init__  s™   ø€ Ü‰ÑÔØ'-×'EÑ'EˆÔ$ØˆÔÜ)¨&Ó<ˆŒØ ×+Ñ+ˆŒØ#)×#=Ñ#=ˆÔ Ø×#×#Ð#Ø—?—?�?Ü  D 6Ð)gÐ!hÓiÐiÜ"2°6Ô"OˆDÔÜ/°Ó7ˆÔÜ# FÓ+ˆŽrA   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[ P                  ,          /# )	rC   rt   r�   Nr‘   Úencoder_attention_maskr’   r“   rH   r”   )rM   rN   s   "€r?   rO   ÚRemBertLayer.__annotate__#  s‡   ø€ ÷ )ñ )á—|‘|ð)ñ ×)Ñ)¨DÕ0ð)ñ  %×0Ñ0°4Õ7ð	)ñ
 !&× 1Ñ 1°DÕ 8ð)ñ  �ð)ñ   $�;ð)ñ 
‰u�|‰|Õ	ñ)rA   c                óŠ  € V P                  VVVVR 7      pV^ ,          p	VR,          p
V P                  '       dT   VeP   \        V R4      '       g   \        RV  R24      hV P	                  V	VVVVR7      pV^ ,          p	W«R,          ,           p
\        V P                  V P                  V P                  V	4      pV3V
,           p
V
# ))r�   r“   r’   rÙ   rû   z'If `encoder_hidden_states` are passed, z` has to be instantiated with cross-attention layers by setting `config.add_cross_attention=True`rØ   )	rù   rŠ   r‚   rƒ   rû   r   Úfeed_forward_chunkr÷   rø   )r<   rt   r�   r‘   rÿ   r’   r“   r¯   Úself_attention_outputsrÛ   rÜ   Úcross_attention_outputsÚlayer_outputs   &&&&&&&,     r?   r\   ÚRemBertLayer.forward#  só   € ð "&§¡ØØ)Ø/Ø+ð	 "0ó "
Ðð 2°!Õ4ÐØ(¨Õ,ˆà�?�?ˆ?Ð4Ò@Ü˜4Ð!1×2Ò2Ü Ø=¸d¸Vð DDð Dóð ð
 '+×&9Ñ&9Ø Ø5Ø&;Ø /Ø"3ð ':ó 'Ð#ð  7°qÕ9ÐØ¸Õ ;Õ;ˆGä0Ø×#Ñ# T×%AÑ%AÀ4×CSÑCSÐUeó
ˆð  �/ GÕ+ˆàˆrA   c                óJ   € V P                  V4      pV P                  W!4      pV# rk   )rü   rÓ   )r<   rÛ   Úintermediate_outputr  s   &&  r?   r  ÚRemBertLayer.feed_forward_chunkO  s)   € Ø"×/Ñ/Ð0@ÓAÐØ—{‘{Ð#6ÓIˆØÐrA   )rú   rù   r÷   rû   rü   rŠ   rÓ   rø   rk   )NNNNF)
r_   r`   ra   rb   r'   r\   r  rd   re   rf   rg   s   @@r?   rõ   rõ     s   ù‡ € ÷,÷)ò )÷Xò rA   rõ   c                   óH   a a€ ] tR tRt oV 3R ltRV3R lR lltRtVtV ;t# )ÚRemBertEncoderiU  c           
     ó8  <€ \         SV `  4        Wn        \        P                  ! 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        RV n        R# u upi )rÒ   FN)r&   r'   r=   r   rl   r*   rm   Úembedding_hidden_mapping_inÚ
ModuleListÚrangeÚnum_hidden_layersrõ   ÚlayerÚgradient_checkpointing)r<   r=   Úir>   s   && €r?   r'   ÚRemBertEncoder.__init__V  ss   ø€ Ü‰ÑÔØŒä+-¯9ª9°V×5PÑ5PÐRX×RdÑRdÓ+eˆÔ(Ü—]’]ÌuÐU[×UmÑUmÔOnÓ#oÑOnÈ!¤L°×$EÑOnÑ#oÓpˆŒ
Ø&+ˆÖ#ùò $ps   Á-B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[R	S[R
S[RS[S[,          /
# )rC   rt   r�   Nr‘   rÿ   r’   Ú	use_cacher“   Úoutput_hidden_statesÚreturn_dictrH   )r7   rL   rJ   r   r•   r–   r   )rM   rN   s   "€r?   rO   ÚRemBertEncoder.__annotate__^  s®   ø€ ÷ D
ñ D
á—|‘|ðD
ñ ×)Ñ)¨DÕ0ðD
ñ  %×0Ñ0°4Õ7ð	D
ñ
 !&× 1Ñ 1°DÕ 8ðD
ñ  �ðD
ñ ˜$•;ðD
ñ  ðD
ñ #ðD
ñ ðD
ñ 
Ñ:Õ	:ñD
rA   c
           	     ó†  € V P                   '       d2   V P                  '       d    V'       d   \        P                  R 4       RpV'       d9   Vf5   \	        \        V P                  R7      \        V P                  R7      4      pV P                  V4      pV'       d   RMRpV'       d   RMRpV'       d   V P                  P                  '       d   RMRp\        V P                  4       Fv  w  rïV'       d
   W±3,           pV! VVVVVV4      pV^ ,          pV'       g   K6  VV^,          3,           pV P                  P                  '       g   Ke  VV^,          3,           pKx  	  V'       d
   W±3,           pV	'       g7   \        ;QJ d    . R VVVVV3 4       F  NK  	  5# ! R VVVVV3 4       4      # \        VVVVVR7      # )zZ`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`...FN)r=   c              3   ó2   "  € T F  pVf   K	  Vx € K  	  R # 5irk   © )Ú.0Úvs   & r?   Ú	<genexpr>Ú)RemBertEncoder.forward.<locals>.<genexpr>‘  s"   é € ð 
ñ�Að ÷ ’óùs   ‚�
)Úlast_hidden_stater’   rt   Ú
attentionsÚcross_attentionsr  )r  ÚtrainingÚloggerÚwarning_oncer
   r	   r=   r  rú   Ú	enumerater  r–   r   )r<   rt   r�   r‘   rÿ   r’   r  r“   r  r  r¯   Úall_hidden_statesÚall_self_attentionsÚall_cross_attentionsr  Úlayer_moduleÚlayer_outputss   &&&&&&&&&&,      r?   r\   ÚRemBertEncoder.forward^  s®  € ð ×&×&Ð&¨4¯=¯=¨=ßÜ×#Ñ#Øpôð "�	ç˜Ò0Ü1´,ÀdÇkÁkÔ2RÔT`Ðhl×hsÑhsÔTtÓuˆOà×8Ñ8¸ÓGˆß"6™B¸DÐß$5™b¸4Ðß%6¸4¿;¹;×;Z×;ZÐ;Z™rÐ`dÐä(¨¯©Ö4‰OˆAß#Ø$5Ð8HÕ$HÐ!á(ØØØ%Ø&ØØ!óˆMð *¨!Õ,ˆMß Ñ Ø&9¸]È1Õ=MÐ<OÕ&OÐ#Ø—;‘;×2×2Ò2Ø+?À=ÐQRÕCSÐBUÕ+UÒ(ñ#  5÷&  Ø 1Ð4DÕ DÐçß”5ñ 
ð "Ø#Ø%Ø'Ø(ñó
—5ð 
�5ñ 
ð "Ø#Ø%Ø'Ø(ñó
ó 
ð 
ô 9Ø+Ø+Ø+Ø*Ø1ô
ð 	
rA   )r=   r  r  r  )NNNNNFFTr{   rg   s   @@r?   r  r  U  s   ù‡ € õ,÷D
÷ D
ò D
rA   r  c                   óD   a a€ ] tR tRt oV 3R ltV3R lR ltRtVtV ;t# )ÚRemBertPredictionHeadTransformi¦  c                ó‚  <€ \         SV `  4        \        P                  ! VP                  VP                  4      V n        \        VP                  \        4      '       d   \        VP                  ,          V n
        MVP                  V n
        \        P                  ! VP                  VP                  R 7      V n        R# rÁ   )r&   r'   r   rl   rm   rn   rŸ   râ   rã   r   Útransform_act_fnr1   r2   r;   s   &&€r?   r'   Ú'RemBertPredictionHeadTransform.__init__§  s~   ø€ Ü‰ÑÔÜ—Y’Y˜v×1Ñ1°6×3EÑ3EÓFˆŒ
Ü�f×'Ñ'¬×-Ò-Ü$*¨6×+<Ñ+<Õ$=ˆDÕ!à$*×$5Ñ$5ˆDÔ!ÜŸš f×&8Ñ&8¸f×>SÑ>SÔTˆŽrA   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# rs   ru   )rM   rN   s   "€r?   rO   Ú+RemBertPredictionHeadTransform.__annotate__°  s#   ø€ ÷ ñ ¡U§\¡\ð ±e·l±lñ rA   c                ól   € V P                  V4      pV P                  V4      pV P                  V4      pV# rk   )rn   r1  r1   rê   s   &&r?   r\   Ú&RemBertPredictionHeadTransform.forward°  s4   € ØŸ
™
 =Ó1ˆØ×-Ñ-¨mÓ<ˆØŸ™ }Ó5ˆØÐrA   )r1   rn   r1  r{   rg   s   @@r?   r/  r/  ¦  s   ù‡ € õU÷÷ ð rA   r/  c                   óD   a a€ ] tR tRt oV 3R ltV3R lR ltRtVtV ;t# )ÚRemBertLMPredictionHeadi·  c                ó~  <€ \         SV `  4        \        P                  ! VP                  VP
                  4      V n        \        P                  ! VP
                  VP                  4      V n        \        VP                  ,          V n        \        P                  ! VP
                  VP                  R 7      V n        R# rÁ   )r&   r'   r   rl   rm   Úoutput_embedding_sizern   r)   Údecoderr   râ   rp   r1   r2   r;   s   &&€r?   r'   Ú RemBertLMPredictionHead.__init__¸  sz   ø€ Ü‰ÑÔÜ—Y’Y˜v×1Ñ1°6×3OÑ3OÓPˆŒ
Ü—y’y ×!=Ñ!=¸v×?PÑ?PÓQˆŒÜ  ×!2Ñ!2Õ3ˆŒÜŸš f×&BÑ&BÈ×H]ÑH]Ô^ˆŽrA   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# rs   ru   )rM   rN   s   "€r?   rO   Ú$RemBertLMPredictionHead.__annotate__¿  s#   ø€ ÷ ñ ¡U§\¡\ð ±e·l±lñ rA   c                óŽ   € V P                  V4      pV P                  V4      pV P                  V4      pV P                  V4      pV# rk   )rn   rp   r1   r;  rê   s   &&r?   r\   ÚRemBertLMPredictionHead.forward¿  s@   € ØŸ
™
 =Ó1ˆØŸ™¨Ó6ˆØŸ™ }Ó5ˆØŸ™ ]Ó3ˆØÐrA   )r1   rp   r;  rn   r{   rg   s   @@r?   r8  r8  ·  s   ù‡ € õ_÷÷ ð rA   r8  c                   óD   a a€ ] tR tRt oV 3R ltV3R lR ltRtVtV ;t# )ÚRemBertOnlyMLMHeadiÈ  c                óD   <€ \         SV `  4        \        V4      V n        R # rk   )r&   r'   r8  Úpredictionsr;   s   &&€r?   r'   ÚRemBertOnlyMLMHead.__init__É  s   ø€ Ü‰ÑÔÜ2°6Ó:ˆÖrA   c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# )rC   Úsequence_outputrH   ru   )rM   rN   s   "€r?   rO   ÚRemBertOnlyMLMHead.__annotate__Í  s#   ø€ ÷ !ñ !¡u§|¡|ð !¹¿¹ñ !rA   c                ó(   € V P                  V4      pV# rk   ©rD  )r<   rG  Úprediction_scoress   && r?   r\   ÚRemBertOnlyMLMHead.forwardÍ  s   € Ø ×,Ñ,¨_Ó=ÐØ Ð rA   rJ  r{   rg   s   @@r?   rB  rB  È  s   ù‡ € õ;÷!÷ !ð !rA   rB  c                   óF   a a€ ] tR tRt oRtRtV 3R ltV3R ltRtVt	V ;t
# )ÚRemBertPreTrainedModeliÒ  ÚrembertTc                ó  <€ \         SV `  V4       \        V\        4      '       db   \        P
                  ! VP                  \        P                  ! VP                  P                  R,          4      P                  R4      4       R# R# )r$   Nr%   r#   )r&   Ú_init_weightsrŸ   r   ÚinitÚcopy_r:   r7   r8   rœ   r9   )r<   Úmoduler>   s   &&€r?   rQ  Ú$RemBertPreTrainedModel._init_weightsØ  s^   ø€ Ü‰Ñ˜fÔ%Ü�fÔ/×0Ò0Ü�JŠJ�v×*Ñ*¬E¯LªL¸×9LÑ9L×9RÑ9RÐSUÕ9VÓ,W×,^Ñ,^Ð_fÓ,gÖhñ 1rA   c                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # )rC   r=   r   )rM   rN   s   "€r?   rO   Ú#RemBertPreTrainedModel.__annotate__Ò  s   ø‡ ‚ áÑò rA   r  )r_   r`   ra   rb   Úbase_model_prefixÚsupports_gradient_checkpointingrQ  Ú__annotate_func__rd   re   rf   rg   s   @@r?   rN  rN  Ò  s    ù‡ € ð "ÐØ&*Ð#õi÷ … rA   rN  a
  
    The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
    cross-attention is added between the self-attention layers, following the architecture described in [Attention is
    all you need](https://huggingface.co/papers/1706.03762) by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
    Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.

    To behave as an decoder the model needs to be initialized with the `is_decoder` argument of the configuration set
    to `True`. To be used in a Seq2Seq model, the model needs to initialized with both `is_decoder` argument and
    `add_cross_attention` set to `True`; an `encoder_hidden_states` is then expected as an input to the forward pass.
    )Úcustom_introc                   ób   a a€ ] tR tRt oRV 3R lltR tR t]R	V3R lR ll4       tRt	Vt
V ;t# )
ÚRemBertModeliÞ  c                óÆ   <€ \         SV `  V4       Wn        \        V4      V n        \        V4      V n        V'       d   \        V4      MRV n        V P                  4        R# )z^
add_pooling_layer (bool, *optional*, defaults to `True`):
    Whether to add a pooling layer
N)
r&   r'   r=   r   r[   r  Úencoderri   ÚpoolerÚ	post_init)r<   r=   Úadd_pooling_layerr>   s   &&&€r?   r'   ÚRemBertModel.__init__ë  sK   ø€ ô
 	‰Ñ˜Ô ØŒä+¨FÓ3ˆŒÜ% fÓ-ˆŒç/@”m FÔ+ÀdˆŒð 	�‰ÖrA   c                ó.   € V P                   P                  # rk   ©r[   r,   ©r<   s   &r?   Úget_input_embeddingsÚ!RemBertModel.get_input_embeddingsû  s   € Ø�‰×.Ñ.Ð.rA   c                ó&   € WP                   n        R # rk   re  )r<   rˆ   s   &&r?   Úset_input_embeddingsÚ!RemBertModel.set_input_embeddingsþ  s   € Ø*/�‰Ö'rA   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[ P                  R,          R	S[R,          R
S[R,          RS[R,          RS[R,          RS[R,          RS[S[,          /# )rC   rD   Nr�   rE   r:   rF   r‘   rÿ   r’   r  r“   r  r  rH   )r7   rI   rJ   r   r•   r–   r   )rM   rN   s   "€r?   rO   ÚRemBertModel.__annotate__  s  ø€ ÷ ]
ñ ]
á×#Ñ# dÕ*ð]
ñ ×(Ñ(¨4Õ/ð]
ñ ×(Ñ(¨4Õ/ð	]
ñ
 ×&Ñ&¨Õ-ð]
ñ ×(Ñ(¨4Õ/ð]
ñ  %×0Ñ0°4Õ7ð]
ñ !&× 1Ñ 1°DÕ 8ð]
ñ  �ð]
ñ ˜$•;ð]
ñ   $�;ð]
ñ # T�kð]
ñ ˜D•[ð]
ñ 
Ñ=Õ	=ñ]
rA   c                óª  € V
e   T
MV P                   P                  p
Ve   TMV P                   P                  pVe   TMV P                   P                  pV P                   P                  '       d   V	e   T	MV P                   P
                  p	MRp	Ve   Ve   \        R4      hVe#   V P                  W4       VP                  4       pM#Ve   VP                  4       R R pM\        R4      hVw  ppVe   VP                  MVP                  pVf   ^ MVP                  4       pVf"   \        P                  ! VVV,           3VR7      pVf(   \        P                  ! V\        P                  VR7      pV P                  VVVVVR7      p\!        V P                   VVR7      pVe   \!        V P                   VVVR7      pV P#                  VVVVVV	V
VVR	7	      pV^ ,          pV P$                  e   V P%                  V4      MR pV'       g   VV3VR
,          ,           # \'        VVVP(                  VP*                  VP,                  VP.                  R7      # )NFzDYou cannot specify both input_ids and inputs_embeds at the same timez5You have to specify either input_ids or inputs_embeds)rU   rS   )rD   r:   rE   rF   rG   )r=   rF   r�   )r=   rF   r�   r‘   )r�   r‘   rÿ   r’   r  r“   r  r  rÙ   )r!  Úpooler_outputr’   rt   r"  r#  r%   )r=   r“   r  r  rŠ   r  rƒ   Ú%warn_if_padding_and_no_attention_maskrV   rU   Úget_seq_lengthr7   ÚonesrW   rX   r[   r   r_  r`  r   r’   rt   r"  r#  )r<   rD   r�   rE   r:   rF   r‘   rÿ   r’   r  r“   r  r  r¯   rY   Ú
batch_sizerZ   rU   rG   Úembedding_outputÚencoder_outputsrG  ry   s   &&&&&&&&&&&&&,         r?   r\   ÚRemBertModel.forward  sU  € ð" 2CÒ1NÑ-ÐTX×T_ÑT_×TqÑTqÐà$8Ò$DÑ È$Ï+É+×JjÑJjð 	ð &1Ò%<‘kÀ$Ç+Á+×BYÑBYˆà�;‰;×!×!Ð!Ø%.Ò%:™	ÀÇÁ×@UÑ@U‰IàˆIàÒ  ]Ò%>ÜÐcÓdÐdØÒ"Ø×6Ñ6°yÔQØ#Ÿ.™.Ó*‰KØÒ&Ø'×,Ñ,Ó.¨s°Ð3‰KäÐTÓUÐUà!,Ñˆ
�JØ%.Ò%:�×!Ò!À×@TÑ@Tˆà&5Ò&=¡À?×CaÑCaÓCcÐàÒ!Ü"ŸZšZ¨*°jÐCYÕ6YÐ)ZÐdjÔkˆNØÒ!Ü"Ÿ[š[¨¼E¿J¹JÈvÔVˆNàŸ?™?ØØ%Ø)Ø'Ø#9ð +ó 
Ðô 3Ø—;‘;Ø*Ø)ô
ˆð "Ò-Ü%>Ø—{‘{Ø.Ø5Ø&;ô	&Ð"ð Ÿ,™,ØØ)Ø"7Ø#9Ø+ØØ/Ø!5Ø#ð 'ó 

ˆð *¨!Õ,ˆØ8<¿¹Ò8O˜Ÿ™ OÔ4ÐUYˆçØ# ]Ð3°oÀbÕ6IÕIÐIä;Ø-Ø'Ø+×;Ñ;Ø)×7Ñ7Ø&×1Ñ1Ø,×=Ñ=ô
ð 	
rA   )r=   r[   r_  r`  )T)NNNNNNNNNNNN)r_   r`   ra   rb   r'   rg  rj  r   r\   rd   re   rf   rg   s   @@r?   r]  r]  Þ  s6   ù‡ € ÷ò /ò0ð ÷]
ñ ]
ó ÷]
ð ]
rA   r]  c                   ó^   a a€ ] tR tRt oV 3R ltR tR t]RV3R lR ll4       tRt	Vt
V ;t# )	ÚRemBertForMaskedLMib  c                óØ   <€ \         SV `  V4       VP                  '       d   \        P	                  R 4       \        VRR7      V n        \        V4      V n        V P                  4        R# )znIf you want to use `RemBertForMaskedLM` make sure `config.is_decoder=False` for bi-directional self-attention.F©rb  N©
r&   r'   rŠ   r%  Úwarningr]  rO  rB  Úclsra  r;   s   &&€r?   r'   ÚRemBertForMaskedLM.__init__d  sU   ø€ Ü‰Ñ˜Ô à××ÐÜ�N‰Nð1ôô
 $ F¸eÔDˆŒÜ% fÓ-ˆŒð 	�‰ÖrA   c                óB   € V P                   P                  P                  # rk   ©r}  rD  r;  rf  s   &r?   Úget_output_embeddingsÚ(RemBertForMaskedLM.get_output_embeddingss  ó   € Ø�x‰x×#Ñ#×+Ñ+Ð+rA   c                ó:   € WP                   P                  n        R # rk   r€  ©r<   Únew_embeddingss   &&r?   Úset_output_embeddingsÚ(RemBertForMaskedLM.set_output_embeddingsv  ó   € Ø'5�‰×ÑÖ$rA   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[ P                  R,          R	S[ P                  R,          R
S[R,          RS[R,          RS[R,          RS[S[,          /# )rC   rD   Nr�   rE   r:   rF   r‘   rÿ   Úlabelsr“   r  r  rH   )r7   rI   rJ   r•   r–   r   )rM   rN   s   "€r?   rO   ÚRemBertForMaskedLM.__annotate__z  sì   ø€ ÷ 5
ñ 5
á×#Ñ# dÕ*ð5
ñ ×(Ñ(¨4Õ/ð5
ñ ×(Ñ(¨4Õ/ð	5
ñ
 ×&Ñ&¨Õ-ð5
ñ ×(Ñ(¨4Õ/ð5
ñ  %×0Ñ0°4Õ7ð5
ñ !&× 1Ñ 1°DÕ 8ð5
ñ × Ñ  4Õ'ð5
ñ   $�;ð5
ñ # T�kð5
ñ ˜D•[ð5
ñ 
‘Õ	ñ5
rA   c                óÔ  € Ve   TMV P                   P                  pV P                  VVVVVVVV	V
VR7
      pV^ ,          pV P                  V4      pRpVeG   \	        4       pV! VP                  RV P                   P                  4      VP                  R4      4      pV'       g"   V3VR,          ,           pVe   V3V,           # T# \        VVVP                  VP                  R7      # )a{  
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]`.
N)	r�   rE   r:   rF   r‘   rÿ   r“   r  r  ºrC   NN©ÚlossÚlogitsrt   r"  r%   )
r=   r  rO  r}  r   r�   r)   r   rt   r"  )r<   rD   r�   rE   r:   rF   r‘   rÿ   r‹  r“   r  r  r¯   rÜ   rG  rK  Úmasked_lm_lossÚloss_fctrÓ   s   &&&&&&&&&&&&,      r?   r\   ÚRemBertForMaskedLM.forwardy  sû   € ð, &1Ò%<‘kÀ$Ç+Á+×BYÑBYˆà—,‘,ØØ)Ø)Ø%Ø'Ø"7Ø#9Ø/Ø!5Ø#ð ó 
ˆð " !�*ˆØ ŸH™H _Ó5ÐàˆØÒÜ'Ó)ˆHÙ%Ð&7×&<Ñ&<¸RÀÇÁ×AWÑAWÓ&XÐZ`×ZeÑZeÐfhÓZiÓjˆNçØ'Ð)¨G°B­KÕ7ˆFØ3AÒ3M�^Ð%¨Õ.ÐYÐSYÐYäØØ$Ø!×/Ñ/Ø×)Ñ)ô	
ð 	
rA   ©r}  rO  )NNNNNNNNNNN©r_   r`   ra   rb   r'   r�  r‡  r   r\   rd   re   rf   rg   s   @@r?   rx  rx  b  s2   ù‡ € õò,ò6ð ÷5
ñ 5
ó ÷5
ð 5
rA   rx  zS
    RemBERT Model with a `language modeling` head on top for CLM fine-tuning.
    c                   ó^   a a€ ] tR tRt oV 3R ltR tR t]RV3R lR ll4       tRt	Vt
V ;t# )	ÚRemBertForCausalLMi²  c                óØ   <€ \         SV `  V4       VP                  '       g   \        P	                  R 4       \        VRR7      V n        \        V4      V n        V P                  4        R# )zOIf you want to use `RemBertForCausalLM` as a standalone, add `is_decoder=True.`Frz  Nr{  r;   s   &&€r?   r'   ÚRemBertForCausalLM.__init__¸  sO   ø€ Ü‰Ñ˜Ô à× × Ð Ü�N‰NÐlÔmä# F¸eÔDˆŒÜ% fÓ-ˆŒð 	�‰ÖrA   c                óB   € V P                   P                  P                  # rk   r€  rf  s   &r?   r�  Ú(RemBertForCausalLM.get_output_embeddingsÄ  rƒ  rA   c                ó:   € WP                   P                  n        R # rk   r€  r…  s   &&r?   r‡  Ú(RemBertForCausalLM.set_output_embeddingsÇ  r‰  rA   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[ P                  R,          R	S[R,          R
S[ P                  R,          RS[R,          RS[R,          RS[R,          RS[R,          RS[S[ P                  ,          RS[S[,          /# )rC   rD   Nr�   rE   r:   rF   r‘   rÿ   r’   r‹  r  r“   r  r  Úlogits_to_keeprH   )	r7   rI   rJ   r   r•   rK   rL   r–   r   )rM   rN   s   "€r?   rO   ÚRemBertForCausalLM.__annotate__Ë  s-  ø€ ÷ M
ñ M
á×#Ñ# dÕ*ðM
ñ ×(Ñ(¨4Õ/ðM
ñ ×(Ñ(¨4Õ/ð	M
ñ
 ×&Ñ&¨Õ-ðM
ñ ×(Ñ(¨4Õ/ðM
ñ  %×0Ñ0°4Õ7ðM
ñ !&× 1Ñ 1°DÕ 8ðM
ñ  �ðM
ñ × Ñ  4Õ'ðM
ñ ˜$•;ðM
ñ   $�;ðM
ñ # T�kðM
ñ ˜D•[ðM
ñ ™eŸl™lÕ*ðM
ñ" 
Ñ2Õ	2ñ#M
rA   c                ó.  € Ve   TMV P                   P                  pV P                  VVVVVVVVV
VVVR7      pV^ ,          p\        V\        4      '       d   \        V) R4      MTpV P                  VRVR3,          4      pRpV	e-   V P                  ! R	RVRV	RV P                   P                  /VB pV'       g"   V3VR,          ,           pVe   V3V,           # T# \        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 left-to-right language modeling loss (next word prediction). 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]`.

Example:

```python
>>> from transformers import AutoTokenizer, RemBertForCausalLM, RemBertConfig
>>> import torch

>>> tokenizer = AutoTokenizer.from_pretrained("google/rembert")
>>> config = RemBertConfig.from_pretrained("google/rembert")
>>> config.is_decoder = True
>>> model = RemBertForCausalLM.from_pretrained("google/rembert", config=config)

>>> inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
>>> outputs = model(**inputs)

>>> prediction_logits = outputs.logits
```N)r�   rE   r:   rF   r‘   rÿ   r’   r  r“   r  r  rR   r‘  r‹  r)   rŽ  )r�  r‘  r’   rt   r"  r#  r  )r=   r  rO  rŸ   rK   Úslicer}  Úloss_functionr)   r   r’   rt   r"  r#  )r<   rD   r�   rE   r:   rF   r‘   rÿ   r’   r‹  r  r“   r  r  r   r¯   rÜ   rt   Úslice_indicesr‘  r�  rÓ   s   &&&&&&&&&&&&&&&,      r?   r\   ÚRemBertForCausalLM.forwardÊ  s.  € ðR &1Ò%<‘kÀ$Ç+Á+×BYÑBYˆà—,‘,ØØ)Ø)Ø%Ø'Ø"7Ø#9Ø+ØØ/Ø!5Ø#ð ó 
ˆð   �
ˆä8BÀ>ÔSV×8WÒ8Wœ˜~˜o¨tÔ4Ð]kˆØ—‘˜-¨¨=¸!Ð(;Õ<Ó=ˆàˆØÒØ×%Ò%Ñp¨VÐp¸FÐpÈtÏ{É{×OeÑOeÐpÐioÑpˆDçØ�Y ¨¥Õ,ˆFØ)-Ò)9�T�G˜fÕ$ÐE¸vÐEä0ØØØ#×3Ñ3Ø!×/Ñ/Ø×)Ñ)Ø$×5Ñ5ô
ð 	
rA   r•  )NNNNNNNNNNNNNr^   r–  rg   s   @@r?   r˜  r˜  ²  s6   ù‡ € õ
ò,ò6ð ÷M
ñ M
ó ÷M
ð M
rA   r˜  zŸ
    RemBERT 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                   óR   a a€ ] tR tRt oV 3R lt]RV3R lR ll4       tRtVtV ;t	# )Ú RemBertForSequenceClassificationi  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 # rk   ©r&   r'   Ú
num_labelsr]  rO  r   r3   Úclassifier_dropout_probr5   rl   rm   Ú
classifierra  r;   s   &&€r?   r'   Ú)RemBertForSequenceClassification.__init__"  si   ø€ Ü‰Ñ˜Ô Ø ×+Ñ+ˆŒÜ# FÓ+ˆŒÜ—z’z &×"@Ñ"@ÓAˆŒÜŸ)š) F×$6Ñ$6¸×8IÑ8IÓJˆŒð 	�‰ÖrA   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[R,          R	S[R,          R
S[R,          RS[S[,          /
# ©rC   rD   Nr�   rE   r:   rF   r‹  r“   r  r  rH   )r7   rJ   rI   r•   r–   r   )rM   rN   s   "€r?   rO   Ú-RemBertForSequenceClassification.__annotate__-  sÏ   ø€ ÷ D
ñ D
á×$Ñ$ tÕ+ðD
ñ ×)Ñ)¨DÕ0ðD
ñ ×(Ñ(¨4Õ/ð	D
ñ
 ×'Ñ'¨$Õ.ðD
ñ ×(Ñ(¨4Õ/ðD
ñ × Ñ  4Õ'ðD
ñ   $�;ðD
ñ # T�kðD
ñ ˜D•[ðD
ñ 
Ñ)Õ	)ñD
rA   c
                ó–  € V	e   T	MV P                   P                  p	V P                  VVVVVVVV	R7      pV^,          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	'       g"   V3VR,          ,           pVe   V3V,           # T# \!        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).
N©r�   rE   r:   rF   r“   r  r  Ú
regressionÚsingle_label_classificationÚmulti_label_classificationrŽ  r�  r%   )r=   r  rO  r5   r­  Úproblem_typer«  rT   r7   rX   rK   r   Úsqueezer   r�   r   r   rt   r"  )r<   rD   r�   rE   r:   rF   r‹  r“   r  r  r¯   rÜ   ry   r‘  r�  r“  rÓ   s   &&&&&&&&&&,      r?   r\   Ú(RemBertForSequenceClassification.forward,  sß  € ð( &1Ò%<‘kÀ$Ç+Á+×BYÑBYˆà—,‘,ØØ)Ø)Ø%Ø'Ø/Ø!5Ø#ð ó 	
ˆð   �
ˆàŸ™ ]Ó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Ü,Ó.�Ù Ó/�ßØ�Y ¨¥Õ,ˆFØ)-Ò)9�T�G˜fÕ$ÐE¸vÐEä'ØØØ!×/Ñ/Ø×)Ñ)ô	
ð 	
rA   ©r­  r5   r«  rO  ©	NNNNNNNNN©
r_   r`   ra   rb   r'   r   r\   rd   re   rf   rg   s   @@r?   r¨  r¨    s,   ù‡ € õð ÷D
ñ D
ó ÷D
ð D
rA   r¨  c                   óR   a a€ ] tR tRt oV 3R lt]RV3R lR ll4       tRtVtV ;t	# )ÚRemBertForMultipleChoiceit  c                óü   <€ \         SV `  V4       \        V4      V n        \        P
                  ! VP                  4      V n        \        P                  ! VP                  ^4      V n
        V P                  4        R# )r$   N)r&   r'   r]  rO  r   r3   r¬  r5   rl   rm   r­  ra  r;   s   &&€r?   r'   Ú!RemBertForMultipleChoice.__init__v  sV   ø€ Ü‰Ñ˜Ô ä# FÓ+ˆŒÜ—z’z &×"@Ñ"@ÓAˆŒÜŸ)š) F×$6Ñ$6¸Ó:ˆŒð 	�‰ÖrA   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[R,          R	S[R,          R
S[R,          RS[S[,          /
# r°  )r7   rJ   rI   r•   r–   r   )rM   rN   s   "€r?   rO   Ú%RemBertForMultipleChoice.__annotate__�  sÏ   ø€ ÷ W
ñ W
á×$Ñ$ tÕ+ðW
ñ ×)Ñ)¨DÕ0ðW
ñ ×(Ñ(¨4Õ/ð	W
ñ
 ×'Ñ'¨$Õ.ðW
ñ ×(Ñ(¨4Õ/ðW
ñ × Ñ  4Õ'ðW
ñ   $�;ðW
ñ # T�kðW
ñ ˜D•[ðW
ñ 
Ñ*Õ	*ñW
rA   c
                ó¨  € V	e   T	MV P                   P                  p	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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VVVVVVV	R7      pV^,          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	'       g"   V3VR,          ,           pVe   V3V,           # T# \        VVVP                  VP                  R7      # )a›  
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)
token_type_ids (`torch.LongTensor` of shape `(batch_size, num_choices, sequence_length)`, *optional*):
    Segment token indices to indicate first and second portions of the inputs. Indices are selected in `[0,
    1]`:

    - 0 corresponds to a *sentence A* token,
    - 1 corresponds to a *sentence B* token.

    [What are token type IDs?](../glossary#token-type-ids)
position_ids (`torch.LongTensor` of shape `(batch_size, num_choices, sequence_length)`, *optional*):
    Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
    config.max_position_embeddings - 1]`.

    [What are position IDs?](../glossary#position-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)
Nr³  rŽ  r�  r%   r›   )r=   r  rœ   r�   rV   rO  r5   r­  r   r   rt   r"  )r<   rD   r�   rE   r:   rF   r‹  r“   r  r  r¯   Únum_choicesrÜ   ry   r‘  Úreshaped_logitsr�  r“  rÓ   s   &&&&&&&&&&,        r?   r\   Ú RemBertForMultipleChoice.forward€  s×  € ðX &1Ò%<‘kÀ$Ç+Á+×BYÑBYˆØ,5Ò,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ˆØM[ÒMg˜×,Ñ,¨R°×1DÑ1DÀRÓ1HÔIÐmqˆØGSÒG_�|×(Ñ(¨¨\×->Ñ->¸rÓ-BÔCÐeiˆð Ò(ð ×Ñ˜r =×#5Ñ#5°bÓ#9¸=×;MÑ;MÈbÓ;QÔRàð 	ð —,‘,ØØ)Ø)Ø%Ø'Ø/Ø!5Ø#ð ó 	
ˆð   �
ˆàŸ™ ]Ó3ˆØ—‘ Ó/ˆØ Ÿ+™+ b¨+Ó6ˆàˆØÒÜ'Ó)ˆHÙ˜OÓ4ˆDçØ%Ð'¨'°"­+Õ5ˆFØ)-Ò)9�T�G˜fÕ$ÐE¸vÐEä(ØØ"Ø!×/Ñ/Ø×)Ñ)ô	
ð 	
rA   )r­  r5   rO  r»  r¼  rg   s   @@r?   r¾  r¾  t  s,   ù‡ € õð ÷W
ñ W
ó ÷W
ð W
rA   r¾  c                   óR   a a€ ] tR tRt oV 3R lt]RV3R lR ll4       tRtVtV ;t	# )ÚRemBertForTokenClassificationiÛ  c                ó6  <€ \         SV `  V4       VP                  V n        \        VR R7      V n        \
        P                  ! VP                  4      V n        \
        P                  ! VP                  VP                  4      V n        V P                  4        R# ©Frz  Nrª  r;   s   &&€r?   r'   Ú&RemBertForTokenClassification.__init__Ý  sk   ø€ Ü‰Ñ˜Ô Ø ×+Ñ+ˆŒä# F¸eÔDˆŒÜ—z’z &×"@Ñ"@ÓAˆŒÜŸ)š) F×$6Ñ$6¸×8IÑ8IÓJˆŒð 	�‰ÖrA   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[R,          R	S[R,          R
S[R,          RS[S[,          /
# r°  )r7   rJ   rI   r•   r–   r   )rM   rN   s   "€r?   rO   Ú*RemBertForTokenClassification.__annotate__é  sÃ   ø€ ÷ 1
ñ 1
á×$Ñ$ tÕ+ð1
ñ ×)Ñ)¨DÕ0ð1
ñ ×(Ñ(¨4Õ/ð	1
ñ
 ×'Ñ'¨$Õ.ð1
ñ ×(Ñ(¨4Õ/ð1
ñ × Ñ  4Õ'ð1
ñ   $�;ð1
ñ # T�kð1
ñ ˜D•[ð1
ñ 
Ñ&Õ	&ñ1
rA   c
                óÞ  € V	e   T	MV P                   P                  p	V P                  VVVVVVVV	R7      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	'       g"   V3VR,          ,           pVe   V3V,           # T# \        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]`.
Nr³  rŽ  r�  r%   )r=   r  rO  r5   r­  r   r�   r«  r   rt   r"  )r<   rD   r�   rE   r:   rF   r‹  r“   r  r  r¯   rÜ   rG  r‘  r�  r“  rÓ   s   &&&&&&&&&&,      r?   r\   Ú%RemBertForTokenClassification.forwardè  sñ   € ð$ &1Ò%<‘kÀ$Ç+Á+×BYÑBYˆà—,‘,ØØ)Ø)Ø%Ø'Ø/Ø!5Ø#ð ó 	
ˆð " !�*ˆàŸ,™, Ó7ˆØ—‘ Ó1ˆàˆØÒÜ'Ó)ˆHÙ˜FŸK™K¨¨D¯O©OÓ<¸f¿k¹kÈ"»oÓNˆDçØ�Y ¨¥Õ,ˆFØ)-Ò)9�T�G˜fÕ$ÐE¸vÐEä$ØØØ!×/Ñ/Ø×)Ñ)ô	
ð 	
rA   rº  r»  r¼  rg   s   @@r?   rÈ  rÈ  Û  s(   ù‡ € õ	ð ÷1
ñ 1
ó ÷1
ð 1
rA   rÈ  c                   óR   a a€ ] tR tRt oV 3R lt]RV3R lR ll4       tRtVtV ;t	# )ÚRemBertForQuestionAnsweringi  c                óì   <€ \         SV `  V4       VP                  V n        \        VR R7      V n        \
        P                  ! VP                  VP                  4      V n        V P                  4        R# rÊ  )
r&   r'   r«  r]  rO  r   rl   rm   Ú
qa_outputsra  r;   s   &&€r?   r'   Ú$RemBertForQuestionAnswering.__init__  sU   ø€ Ü‰Ñ˜Ô à ×+Ñ+ˆŒä# F¸eÔDˆŒÜŸ)š) F×$6Ñ$6¸×8IÑ8IÓJˆŒð 	�‰ÖrA   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[ P                  R,          R	S[R,          R
S[R,          RS[R,          RS[S[,          /# )rC   rD   Nr�   rE   r:   rF   Ústart_positionsÚend_positionsr“   r  r  rH   )r7   rJ   rI   r•   r–   r   )rM   rN   s   "€r?   rO   Ú(RemBertForQuestionAnswering.__annotate__+  sØ   ø€ ÷ =
ñ =
á×$Ñ$ tÕ+ð=
ñ ×)Ñ)¨DÕ0ð=
ñ ×(Ñ(¨4Õ/ð	=
ñ
 ×'Ñ'¨$Õ.ð=
ñ ×(Ñ(¨4Õ/ð=
ñ ×)Ñ)¨DÕ0ð=
ñ ×'Ñ'¨$Õ.ð=
ñ   $�;ð=
ñ # T�kð=
ñ ˜D•[ð=
ñ 
Ñ-Õ	-ñ=
rA   c                ó@  € V
e   T
MV P                   P                  p
V P                  VVVVVVV	V
R7      pV^ ,          pV P                  V4      pVP	                  ^RR7      w  ppVP                  R4      pVP                  R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       VP                  ^ V4       \        VR7      pV! Wö4      pV! VV4      pVV,           ^,          pV
'       g#   VV3VR,          ,           pVe   V3V,           # T# \        VVVVP                  VP                  R7      # )Nr³  r™   )Úignore_indexrŽ  )r�  Ústart_logitsÚ
end_logitsrt   r"  r%   )r=   r  rO  rÓ  Úsplitr¸  ÚlenrV   Úclamp_r   r   rt   r"  )r<   rD   r�   rE   r:   rF   rÖ  r×  r“   r  r  r¯   rÜ   rG  r‘  rÛ  rÜ  Ú
total_lossÚignored_indexr“  Ú
start_lossÚend_lossrÓ   s   &&&&&&&&&&&,           r?   r\   Ú#RemBertForQuestionAnswering.forward*  s¥  € ð &1Ò%<‘kÀ$Ç+Á+×BYÑBYˆà—,‘,ØØ)Ø)Ø%Ø'Ø/Ø!5Ø#ð ó 	
ˆð " !�*ˆà—‘ Ó1ˆØ#)§<¡<°°r <Ó#:Ñ ˆ�jØ#×+Ñ+¨BÓ/ˆØ×'Ñ'¨Ó+ˆ
àˆ
ØÒ&¨=Ò+Dä�?×'Ñ'Ó)Ó*¨QÔ.Ø"1×"9Ñ"9¸"Ó"=�Ü�=×%Ñ%Ó'Ó(¨1Ô,Ø -× 5Ñ 5°bÓ 9�à(×-Ñ-¨aÓ0ˆMØ×"Ñ" 1 mÔ4Ø× Ñ   MÔ2ä'°]ÔCˆHÙ! ,Ó@ˆJÙ 
¨MÓ:ˆHØ$ xÕ/°1Õ4ˆJçØ" JÐ/°'¸"µ+Õ=ˆFØ/9Ò/E�Z�M FÕ*ÐQÈ6ÐQä+ØØ%Ø!Ø!×/Ñ/Ø×)Ñ)ô
ð 	
rA   )r«  rÓ  rO  )
NNNNNNNNNNr¼  rg   s   @@r?   rÑ  rÑ    s(   ù‡ € õ	ð ÷=
ñ =
ó ÷=
ð =
rA   rÑ  )	r˜  rx  r¾  rÑ  r¨  rÈ  rõ   r]  rN  )Brc   r©   r7   r   Útorch.nnr   r   r   Ú r   rR  Úactivationsr   Úcache_utilsr   r	   r
   Ú
generationr   Úmasking_utilsr   Úmodeling_layersr   Úmodeling_outputsr   r   r   r   r   r   r   r   Úmodeling_utilsr   Úpytorch_utilsr   Úutilsr   r   Úconfiguration_rembertr   Ú
get_loggerr_   r%  ÚModuler   ri   r}   r¿   rÐ   rß   rí   rõ   r  r/  r8  rB  rN  r]  rx  r˜  r¨  r¾  rÈ  rÑ  Ú__all__r  rA   r?   Ú<module>rô     sD  ðñ ã ã Ý ß AÑ Aå &Ý !ß CÑ CÝ )Ý 6Ý 9÷	÷ 	ó 	õ .Ý 6ß ,Ý 0ð 
×	Ò	˜HÓ	%€ô/˜Ÿ	™	ô /ôf�B—I‘Iô ôV.˜2Ÿ9™9ô V.ôt˜Ÿ	™	ô ô�r—y‘yô ô8˜"Ÿ)™)ô ô �B—I‘Iô ô?Ð-ô ?ôDM
�R—Y‘Yô M
ôb R§Y¡Yô ô"˜bŸi™iô ô"!˜Ÿ™ô !ð ôi˜_ó ió ðiñ ð	ôôu
Ð)ó u
óðu
ðp ôL
Ð/ó L
ó ðL
ñ^ ðôô
a
Ð/°ó a
óð
a
ñH ðôôP
Ð'=ó P
óðP
ðf ôc
Ð5ó c
ó ðc
ðL ô>
Ð$:ó >
ó ð>
ðB ôJ
Ð"8ó J
ó ðJ
òZ
‚rA   