+
    œ°³jLU  ã                   ó^  € R t ^ RIHt ^ RI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 ^RIHt ]P$                  ! ]4      t]! R	R
7      ] ! R R]4      4       4       t]! R	R
7      ] ! R R]4      4       4       t]! R	R
7      ] ! R R]4      4       4       t] ! R R]	4      4       t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t]! RR
7       ! R R]4      4       t]! R R
7       ! R! R"]4      4       t]! R#R
7       ! R$ R%]4      4       t . R&Ot!R# )'z5PyTorch DPR model for Open Domain Question Answering.)Ú	dataclassN)ÚTensorÚnn)ÚBaseModelOutputWithPooling)ÚPreTrainedModel)ÚModelOutputÚauto_docstringÚlogging)Ú	BertModel©Ú	DPRConfigz6
    Class for outputs of [`DPRQuestionEncoder`].
    )Úcustom_introc                   ó8   a € ] tR t^(t o RtRtRtV 3R ltRtV t	R# )ÚDPRContextEncoderOutputa“  
pooler_output (`torch.FloatTensor` of shape `(batch_size, embeddings_size)`):
    The DPR encoder outputs the *pooler_output* that corresponds to the context representation. Last layer
    hidden-state of the first token of the sequence (classification token) further processed by a Linear layer.
    This output is to be used to embed contexts for nearest neighbors queries with questions embeddings.
Nc                ó¾   <€ V ^8„  d   Qh/ S[ P                  ;R&   S[S[ P                  R3,          R,          ;R&   S[S[ P                  R3,          R,          ;R&   # ©é   Úpooler_output.NÚhidden_statesÚ
attentions©ÚtorchÚFloatTensorÚtuple)ÚformatÚ__classdict__s   "€Úe/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/dpr/modeling_dpr.pyÚ__annotate__Ú$DPRContextEncoderOutput.__annotate__(   ó\   ø‡ ‚ ñ ×$Ñ$Ñ$ñ ñ ™×*Ñ*¨CÐ/Õ0°4Õ7Ñ>ñ ñ  ‘e×'Ñ'¨Ð,Õ-°Õ4Ñ;ò! ó    © ©
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r   (   ó   ø‡ € ñð ;?€MØ7;€J÷! ƒ r    r   c                   ó8   a € ] tR t^;t o RtRtRtV 3R ltRtV t	R# )ÚDPRQuestionEncoderOutputa“  
pooler_output (`torch.FloatTensor` of shape `(batch_size, embeddings_size)`):
    The DPR encoder outputs the *pooler_output* that corresponds to the question representation. Last layer
    hidden-state of the first token of the sequence (classification token) further processed by a Linear layer.
    This output is to be used to embed questions for nearest neighbors queries with context embeddings.
Nc                ó¾   <€ V ^8„  d   Qh/ S[ P                  ;R&   S[S[ P                  R3,          R,          ;R&   S[S[ P                  R3,          R,          ;R&   # r   r   )r   r   s   "€r   r   Ú%DPRQuestionEncoderOutput.__annotate__;   r   r    r!   r"   r+   s   @r   r.   r.   ;   r,   r    r.   c                   ó@   a € ] tR t^Nt o RtRtRtRtRtV 3R lt	Rt
V tR# )ÚDPRReaderOutputaò  
start_logits (`torch.FloatTensor` of shape `(n_passages, sequence_length)`):
    Logits of the start index of the span for each passage.
end_logits (`torch.FloatTensor` of shape `(n_passages, sequence_length)`):
    Logits of the end index of the span for each passage.
relevance_logits (`torch.FloatTensor` of shape `(n_passages, )`):
    Outputs of the QA classifier of the DPRReader that corresponds to the scores of each passage to answer the
    question, compared to all the other passages.
Nc                ó  <€ V ^8„  d   Qh/ S[ P                  ;R&   S[ P                  R,          ;R&   S[ P                  R,          ;R&   S[S[ P                  R3,          R,          ;R&   S[S[ P                  R3,          R,          ;R&   # )r   Ústart_logitsNÚ
end_logitsÚrelevance_logits.r   r   r   )r   r   s   "€r   r   ÚDPRReaderOutput.__annotate__N   sŒ   ø‡ ‚ ñ" ×#Ñ#Ñ#ñ# ñ$ ×!Ñ! DÕ(Ñ/ñ% ñ& ×'Ñ'¨$Õ.Ñ5ñ' ñ( ™×*Ñ*¨CÐ/Õ0°4Õ7Ñ>ñ) ñ* ‘e×'Ñ'¨Ð,Õ-°Õ4Ñ;ò+ r    r!   )r#   r$   r%   r&   r'   r5   r6   r   r   r(   r)   r*   r+   s   @r   r2   r2   N   s(   ø‡ € ñð ,0€JØ15ÐØ:>€MØ7;€J÷+ ƒ r    r2   c                   ó   € ] tR t^ftRtRtR# )ÚDPRPreTrainedModelTr!   N)r#   r$   r%   r&   Ú_supports_sdpar)   r!   r    r   r9   r9   f   s   † à„Nr    r9   c                   ót   a a€ ] tR t^kt oRtV3R lV 3R lltR	V3R lR llt]V3R lR l4       tRt	Vt
V ;t# )
Ú
DPREncoderÚ
bert_modelc                ó    <€ V ^8„  d   QhRS[ /# ©r   Úconfigr   )r   r   s   "€r   r   ÚDPREncoder.__annotate__n   s   ø€ ÷ 	ñ 	™yñ 	r    c                ó–  <€ \         SV `  V4       \        VR R7      V n        V P                  P                  P
                  ^ 8:  d   \        R4      hVP                  V n        V P                  ^ 8”  dE   \        P                  ! V P                  P                  P
                  VP                  4      V n
        V P                  4        R# )F)Úadd_pooling_layerz!Encoder hidden_size can't be zeroN)ÚsuperÚ__init__r
   r=   r@   Úhidden_sizeÚ
ValueErrorÚprojection_dimr   ÚLinearÚencode_projÚ	post_init©Úselfr@   Ú	__class__s   &&€r   rE   ÚDPREncoder.__init__n   s‘   ø€ Ü‰Ñ˜Ô Ü# F¸eÔDˆŒØ�?‰?×!Ñ!×-Ñ-°Ô2ÜÐ@ÓAÐAØ$×3Ñ3ˆÔØ×Ñ Ô"Ü!Ÿyšy¨¯©×)?Ñ)?×)KÑ)KÈV×MbÑMbÓcˆDÔà�‰Ör    c                ó˜   <€ V ^8„  d   QhRS[ RS[ R,          RS[ R,          RS[ R,          RS[RS[RS[R	S[S[S[ R
3,          ,          /# )r   Ú	input_idsÚattention_maskNÚtoken_type_idsÚinputs_embedsÚoutput_attentionsÚoutput_hidden_statesÚreturn_dictÚreturn.)r   Úboolr   r   )r   r   s   "€r   r   rA   y   su   ø€ ÷ "
ñ "
áð"
ñ  �ð"
ñ  �ð	"
ñ
  •}ð"
ñ  ð"
ñ #ð"
ñ ð"
ñ 
$¡e©F°C¨KÕ&8Õ	8ñ"
r    c           
     ó  € V P                  VVVVVVVR 7      p	V	^ ,          p
V
R,          pV P                  ^ 8”  d   V P                  V4      pV'       g   W«3V	R,          ,           # \        V
VV	P                  V	P
                  R7      # )©rQ   rR   rS   rT   rU   rV   rW   ºr   NN)Úlast_hidden_stater   r   r   ©ºNNNé    r_   )r=   rH   rJ   r   r   r   )rM   rQ   rR   rS   rT   rU   rV   rW   ÚkwargsÚoutputsÚsequence_outputÚpooled_outputs   &&&&&&&&,   r   ÚforwardÚDPREncoder.forwardy   s™   € ð —/‘/ØØ)Ø)Ø'Ø/Ø!5Ø#ð "ó 
ˆð " !�*ˆØ'¨Õ0ˆà×Ñ Ô"Ø ×,Ñ,¨]Ó;ˆMçØ#Ð3°g¸bµkÕAÐAä)Ø-Ø'Ø!×/Ñ/Ø×)Ñ)ô	
ð 	
r    c                ó    <€ V ^8„  d   QhRS[ /# )r   rX   )Úint)r   r   s   "€r   r   rA   ž   s   ø€ ÷ 2ñ 2¡ñ 2r    c                ó�   € V P                   ^ 8”  d   V P                  P                  # V P                  P                  P
                  # )r`   )rH   rJ   Úout_featuresr=   r@   rF   )rM   s   &r   Úembeddings_sizeÚDPREncoder.embeddings_size�   s8   € à×Ñ Ô"Ø×#Ñ#×0Ñ0Ð0Ø�‰×%Ñ%×1Ñ1Ð1r    )r=   rJ   rH   )NNNFFF)r#   r$   r%   r&   Úbase_model_prefixrE   re   Úpropertyrk   r)   r*   Ú__classcell__©rN   r   s   @@r   r<   r<   k   s9   ù‡ € Ø$Ð÷	ó 	÷"
ò "
ðH ÷2ó ÷2ð 2r    r<   c                   óX   a a€ ] tR t^¤t oRt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	# )ÚDPRSpanPredictorÚencoderc                ó    <€ V ^8„  d   QhRS[ /# r?   r   )r   r   s   "€r   r   ÚDPRSpanPredictor.__annotate__§   s   ø€ ÷ ñ ™yñ r    c                ó&  <€ \         SV `  V4       \        V4      V n        \        P
                  ! V P                  P                  ^4      V n        \        P
                  ! V P                  P                  ^4      V n        V P                  4        R# )r   N)
rD   rE   r<   rs   r   rI   rk   Ú
qa_outputsÚqa_classifierrK   rL   s   &&€r   rE   ÚDPRSpanPredictor.__init__§   s_   ø€ Ü‰Ñ˜Ô Ü! &Ó)ˆŒÜŸ)š) D§L¡L×$@Ñ$@À!ÓDˆŒÜŸYšY t§|¡|×'CÑ'CÀQÓGˆÔà�‰Ör    c                óv   <€ V ^8„  d   QhRS[ RS[ RS[ R,          RS[RS[RS[RS[S[S[ R	3,          ,          /# )
r   rQ   rR   rT   NrU   rV   rW   rX   .©r   rY   r2   r   )r   r   s   "€r   r   ru   ¯   sc   ø€ ÷ ,
ñ ,
áð,
ñ ð,
ñ  •}ð	,
ñ
  ð,
ñ #ð,
ñ ð,
ñ 
™5¡¨ Õ-Õ	-ñ,
r    c           	     óv  € Ve   VP                  4       MVP                  4       R,          w  r‰V P                  VVVVVVR7      p
V
^ ,          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V P                  VR,          4      pVP                  W‰4      pVP                  W‰4      pVP                  V4      pV'       g   WÞV3V
R,          ,           # \        VVVV
P                  V
P                  R7      # )N:Nr   N)rR   rT   rU   rV   rW   )Údimr\   )r4   r5   r6   r   r   éÿÿÿÿr^   )Úsizers   rw   ÚsplitÚsqueezeÚ
contiguousrx   Úviewr2   r   r   )rM   rQ   rR   rT   rU   rV   rW   ra   Ú
n_passagesÚsequence_lengthrb   rc   Úlogitsr4   r5   r6   s   &&&&&&&,        r   re   ÚDPRSpanPredictor.forward¯   s9  € ð ;DÒ:O i§n¡nÔ&6ÐUb×UgÑUgÓUiÐjlÕUmÑ#ˆ
à—,‘,ØØ)Ø'Ø/Ø!5Ø#ð ó 
ˆð " !�*ˆð —‘ Ó1ˆØ#)§<¡<°°r <Ó#:Ñ ˆØ#×+Ñ+¨BÓ/×:Ñ:Ó<ˆØ×'Ñ'¨Ó+×6Ñ6Ó8ˆ
Ø×-Ñ-¨o¸gÕ.FÓGÐð $×(Ñ(¨ÓEˆØ—_‘_ ZÓAˆ
Ø+×0Ñ0°Ó<ÐçØ Ð.>Ð?À'È"Å+ÕMÐMäØ%Ø!Ø-Ø!×/Ñ/Ø×)Ñ)ô
ð 	
r    )rs   rx   rw   )NFFF)
r#   r$   r%   r&   rm   rE   re   r)   r*   ro   rp   s   @@r   rr   rr   ¤   s$   ù‡ € Ø!Ð÷ó ÷,
÷ ,
ò ,
r    rr   c                   ó4   a € ] tR t^ãt o RtRtV 3R ltRtV tR# )ÚDPRPretrainedContextEncoderúz
An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained
models.
Úctx_encoderc                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # r?   r   )r   r   s   "€r   r   Ú(DPRPretrainedContextEncoder.__annotate__ã   ó   ø‡ ‚ ñ Ñò r    r!   N©	r#   r$   r%   r&   r'   rm   r(   r)   r*   r+   s   @r   r‰   r‰   ã   s   ø‡ € ñð &Ð÷ ƒ r    r‰   c                   ó4   a € ] tR t^ít o RtRtV 3R ltRtV tR# )ÚDPRPretrainedQuestionEncoderrŠ   Úquestion_encoderc                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # r?   r   )r   r   s   "€r   r   Ú)DPRPretrainedQuestionEncoder.__annotate__í   rŽ   r    r!   Nr�   r+   s   @r   r‘   r‘   í   s   ø‡ € ñð +Ð÷ ƒ r    r‘   c                   ó4   a € ] tR t^÷t o RtRtV 3R ltRtV tR# )ÚDPRPretrainedReaderrŠ   Úspan_predictorc                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # r?   r   )r   r   s   "€r   r   Ú DPRPretrainedReader.__annotate__÷   rŽ   r    r!   Nr�   r+   s   @r   r–   r–   ÷   s   ø‡ € ñð )Ð÷ ƒ r    r–   zf
    The bare DPRContextEncoder transformer outputting pooler outputs as context representations.
    c                   ó^   a a€ ] tR tRt oV3R lV 3R llt]RV3R lR ll4       tRtVtV ;t	# )ÚDPRContextEncoderi  c                ó    <€ V ^8„  d   QhRS[ /# r?   r   )r   r   s   "€r   r   ÚDPRContextEncoder.__annotate__  ó   ø€ ÷ ñ ™yñ r    c                ór   <€ \         SV `  V4       Wn        \        V4      V n        V P                  4        R # ©N)rD   rE   r@   r<   r‹   rK   rL   s   &&€r   rE   ÚDPRContextEncoder.__init__  s,   ø€ Ü‰Ñ˜Ô ØŒÜ% fÓ-ˆÔà�‰Ör    c                óÐ   <€ V ^8„  d   QhRS[ R,          RS[ R,          RS[ R,          RS[ R,          RS[R,          RS[R,          RS[R,          R	S[S[S[ R
3,          ,          /# ©r   rQ   NrR   rS   rT   rU   rV   rW   rX   .)r   rY   r   r   )r   r   s   "€r   r   r�     s�   ø€ ÷ Y
ñ Y
á˜D•=ðY
ñ  �ðY
ñ  �ð	Y
ñ
  •}ðY
ñ   $�;ðY
ñ # T�kðY
ñ ˜D•[ðY
ñ 
!¡5©°¨Õ#5Õ	5ñY
r    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e   Ve   \	        R4      hVe   VP                  4       p	M#Ve   VP                  4       RR	 p	M\	        R4      hVe   VP                  MVP                  p
Vf4   Vf   \        P                  ! WšR7      MWP                   P                  8g  pVf(   \        P                  ! V	\        P                  V
R7      pV P                  VVVVVVVR7      pV'       g
   VR,          # \        VP                  VP                  VP                   R7      # )
aƒ  
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
    Indices of input sequence tokens in the vocabulary. To match pretraining, DPR input sequence should be
    formatted with [CLS] and [SEP] tokens as follows:

    (a) For sequence pairs (for a pair title+text for example):

    ```
    tokens:         [CLS] is this jack ##son ##ville ? [SEP] no it is not . [SEP]
    token_type_ids:   0   0  0    0    0     0       0   0   1  1  1  1   1   1
    ```

    (b) For single sequences (for a question for example):

    ```
    tokens:         [CLS] the dog is hairy . [SEP]
    token_type_ids:   0   0   0   0  0     0   0
    ```

    DPR is a model with absolute position embeddings so it's usually advised to pad the inputs on the right
    rather than the left.

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

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

Examples:

```python
>>> from transformers import DPRContextEncoder, DPRContextEncoderTokenizer

>>> tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base")
>>> model = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base")
>>> input_ids = tokenizer("Hello, is my dog cute ?", return_tensors="pt")["input_ids"]
>>> embeddings = model(input_ids).pooler_output
```NúDYou cannot specify both input_ids and inputs_embeds at the same timeú5You have to specify either input_ids or inputs_embeds©Údevice©Údtyper¨   r[   ºé   NN©r   r   r   r~   )r@   rU   rV   rW   rG   r   r¨   r   ÚonesÚpad_token_idÚzerosÚlongr‹   r   r   r   r   ©rM   rQ   rR   rS   rT   rU   rV   rW   ra   Úinput_shaper¨   rb   s   &&&&&&&&,   r   re   ÚDPRContextEncoder.forward  sj  € ðd 2CÒ1NÑ-ÐTX×T_ÑT_×TqÑTqÐà$8Ò$DÑ È$Ï+É+×JjÑJjð 	ð &1Ò%<‘kÀ$Ç+Á+×BYÑBYˆàÒ  ]Ò%>ÜÐcÓdÐdØÒ"Ø#Ÿ.™.Ó*‰KØÒ&Ø'×,Ñ,Ó.¨s°Ð3‰KäÐTÓUÐUà%.Ò%:�×!Ò!À×@TÑ@TˆàÒ!ð Ò$ô —
’
˜;Õ6à§;¡;×#;Ñ#;Ñ;ð ð
 Ò!Ü"Ÿ[š[¨¼E¿J¹JÈvÔVˆNà×"Ñ"ØØ)Ø)Ø'Ø/Ø!5Ø#ð #ó 
ˆ÷ Ø˜2•;ÐÜ&Ø!×/Ñ/¸w×?TÑ?TÐah×asÑasô
ð 	
r    )r@   r‹   ©NNNNNNN©
r#   r$   r%   r&   rE   r   re   r)   r*   ro   rp   s   @@r   r›   r›     s1   ù‡ € ÷ó ð ÷Y
ñ Y
ó ÷Y
ð Y
r    r›   zh
    The bare DPRQuestionEncoder transformer outputting pooler outputs as question representations.
    c                   ó^   a a€ ] tR tRt oV3R lV 3R llt]RV3R lR ll4       tRtVtV ;t	# )ÚDPRQuestionEncoderip  c                ó    <€ V ^8„  d   QhRS[ /# r?   r   )r   r   s   "€r   r   ÚDPRQuestionEncoder.__annotate__v  rž   r    c                ór   <€ \         SV `  V4       Wn        \        V4      V n        V P                  4        R # r    )rD   rE   r@   r<   r’   rK   rL   s   &&€r   rE   ÚDPRQuestionEncoder.__init__v  s,   ø€ Ü‰Ñ˜Ô ØŒÜ *¨6Ó 2ˆÔà�‰Ör    c                óÐ   <€ V ^8„  d   QhRS[ R,          RS[ R,          RS[ R,          RS[ R,          RS[R,          RS[R,          RS[R,          R	S[S[S[ R
3,          ,          /# r£   )r   rY   r.   r   )r   r   s   "€r   r   rº   ~  s�   ø€ ÷ Z
ñ Z
á˜D•=ðZ
ñ  �ðZ
ñ  �ð	Z
ñ
  •}ðZ
ñ   $�;ðZ
ñ # T�kðZ
ñ ˜D•[ðZ
ñ 
"¡E©&°#¨+Õ$6Õ	6ñZ
r    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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e   VP                  MVP                  p
Vf4   Vf   \        P                  ! WšR7      MWP                   P                  8g  pVf(   \        P                  ! V	\        P                  V
R7      pV P                  VVVVVVVR7      pV'       g
   VR,          # \        VP                  VP                   VP"                  R7      # )
a’  
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
    Indices of input sequence tokens in the vocabulary. To match pretraining, DPR input sequence should be
    formatted with [CLS] and [SEP] tokens as follows:

    (a) For sequence pairs (for a pair title+text for example):

    ```
    tokens:         [CLS] is this jack ##son ##ville ? [SEP] no it is not . [SEP]
    token_type_ids:   0   0  0    0    0     0       0   0   1  1  1  1   1   1
    ```

    (b) For single sequences (for a question for example):

    ```
    tokens:         [CLS] the dog is hairy . [SEP]
    token_type_ids:   0   0   0   0  0     0   0
    ```

    DPR is a model with absolute position embeddings so it's usually advised to pad the inputs on the right
    rather than the left.

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

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

Examples:

```python
>>> from transformers import DPRQuestionEncoder, DPRQuestionEncoderTokenizer

>>> tokenizer = DPRQuestionEncoderTokenizer.from_pretrained("facebook/dpr-question_encoder-single-nq-base")
>>> model = DPRQuestionEncoder.from_pretrained("facebook/dpr-question_encoder-single-nq-base")
>>> input_ids = tokenizer("Hello, is my dog cute ?", return_tensors="pt")["input_ids"]
>>> embeddings = model(input_ids).pooler_output
```
Nr¥   r¦   r§   r©   r[   r«   r­   r~   )r@   rU   rV   rW   rG   Ú%warn_if_padding_and_no_attention_maskr   r¨   r   r®   r¯   r°   r±   r’   r.   r   r   r   r²   s   &&&&&&&&,   r   re   ÚDPRQuestionEncoder.forward}  sx  € ðd 2CÒ1NÑ-ÐTX×T_ÑT_×TqÑTqÐà$8Ò$DÑ È$Ï+É+×JjÑJjð 	ð &1Ò%<‘kÀ$Ç+Á+×BYÑBYˆàÒ  ]Ò%>ÜÐcÓdÐdØÒ"Ø×6Ñ6°yÔQØ#Ÿ.™.Ó*‰KØÒ&Ø'×,Ñ,Ó.¨s°Ð3‰KäÐTÓUÐUà%.Ò%:�×!Ò!À×@TÑ@TˆàÒ!ð Ò$ô —
’
˜;Õ6à§;¡;×#;Ñ#;Ñ;ð ð
 Ò!Ü"Ÿ[š[¨¼E¿J¹JÈvÔVˆNà×'Ñ'ØØ)Ø)Ø'Ø/Ø!5Ø#ð (ó 
ˆ÷ Ø˜2•;ÐÜ'Ø!×/Ñ/¸w×?TÑ?TÐah×asÑasô
ð 	
r    )r@   r’   rµ   r¶   rp   s   @@r   r¸   r¸   p  s1   ù‡ € ÷ó ð ÷Z
ñ Z
ó ÷Z
ð Z
r    r¸   zE
    The bare DPRReader transformer outputting span predictions.
    c                   ó^   a a€ ] tR tRt oV3R lV 3R llt]RV3R lR ll4       tRtVtV ;t	# )Ú	DPRReaderiÛ  c                ó    <€ V ^8„  d   QhRS[ /# r?   r   )r   r   s   "€r   r   ÚDPRReader.__annotate__á  rž   r    c                ór   <€ \         SV `  V4       Wn        \        V4      V n        V P                  4        R # r    )rD   rE   r@   rr   r—   rK   rL   s   &&€r   rE   ÚDPRReader.__init__á  s,   ø€ Ü‰Ñ˜Ô ØŒÜ.¨vÓ6ˆÔà�‰Ör    c                ó¼   <€ V ^8„  d   QhRS[ R,          RS[ R,          RS[ R,          RS[R,          RS[R,          RS[R,          RS[S[S[ R	3,          ,          /# )
r   rQ   NrR   rT   rU   rV   rW   rX   .r{   )r   r   s   "€r   r   rÄ   é  s€   ø€ ÷ L
ñ L
á˜D•=ðL
ñ  �ðL
ñ  •}ð	L
ñ
   $�;ðL
ñ # T�kðL
ñ ˜D•[ðL
ñ 
™5¡¨ Õ-Õ	-ñL
r    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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e   VP                  MVP                  p	Vf   \        P                  ! W‰R7      pV P                  VVVVVVR7      # )a³  
input_ids (`tuple[torch.LongTensor]` of shapes `(n_passages, sequence_length)`):
    Indices of input sequence tokens in the vocabulary. It has to be a sequence triplet with 1) the question
    and 2) the passages titles and 3) the passages texts To match pretraining, DPR `input_ids` sequence should
    be formatted with [CLS] and [SEP] with the format:

    `[CLS] <question token ids> [SEP] <titles ids> [SEP] <texts ids>`

    DPR is a model with absolute position embeddings so it's usually advised to pad the inputs on the right
    rather than the left.

    Indices can be obtained using [`DPRReaderTokenizer`]. See this class documentation for more details.

    [What are input IDs?](../glossary#input-ids)
inputs_embeds (`torch.FloatTensor` of shape `(n_passages, 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.

Examples:

```python
>>> from transformers import DPRReader, DPRReaderTokenizer

>>> tokenizer = DPRReaderTokenizer.from_pretrained("facebook/dpr-reader-single-nq-base")
>>> model = DPRReader.from_pretrained("facebook/dpr-reader-single-nq-base")
>>> encoded_inputs = tokenizer(
...     questions=["What is love ?"],
...     titles=["Haddaway"],
...     texts=["'What Is Love' is a song recorded by the artist Haddaway"],
...     return_tensors="pt",
... )
>>> outputs = model(**encoded_inputs)
>>> start_logits = outputs.start_logits
>>> end_logits = outputs.end_logits
>>> relevance_logits = outputs.relevance_logits
```
Nr¥   r¦   r§   )rT   rU   rV   rW   r~   )r@   rU   rV   rW   rG   r¿   r   r¨   r   r®   r—   )
rM   rQ   rR   rT   rU   rV   rW   ra   r³   r¨   s
   &&&&&&&,  r   re   ÚDPRReader.forwardè  s  € ðb 2CÒ1NÑ-ÐTX×T_ÑT_×TqÑTqÐà$8Ò$DÑ È$Ï+É+×JjÑJjð 	ð &1Ò%<‘kÀ$Ç+Á+×BYÑBYˆàÒ  ]Ò%>ÜÐcÓdÐdØÒ"Ø×6Ñ6°yÔQØ#Ÿ.™.Ó*‰KØÒ&Ø'×,Ñ,Ó.¨s°Ð3‰KäÐTÓUÐUà%.Ò%:�×!Ò!À×@TÑ@TˆàÒ!Ü"ŸZšZ¨ÔCˆNà×"Ñ"ØØØ'Ø/Ø!5Ø#ð #ó 
ð 	
r    )r@   r—   )NNNNNNr¶   rp   s   @@r   rÂ   rÂ   Û  s1   ù‡ € ÷ó ð ÷L
ñ L
ó ÷L
ð L
r    rÂ   )r›   r‰   r9   r‘   r–   r¸   rÂ   )"r'   Údataclassesr   r   r   r   Úmodeling_outputsr   Úmodeling_utilsr   Úutilsr   r   r	   Úbert.modeling_bertr
   Úconfiguration_dprr   Ú
get_loggerr#   Úloggerr   r.   r2   r9   r<   rr   r‰   r‘   r–   r›   r¸   rÂ   Ú__all__r!   r    r   Ú<module>rÓ      s­  ðñ <å !ã ß å :Ý -÷ñ õ
 +Ý (ð 
×	Ò	˜HÓ	%€ñ ðôð
 ô
<˜kó 
<ó óð
<ñ ðôð
 ô
<˜{ó 
<ó óð
<ñ ðôð
 ô<�kó <ó óð<ð$ ô˜ó ó ðô62Ð#ô 62ôr7
Ð)ô 7
ô~&Ð"4ô &ô+Ð#5ô +ô)Ð,ô )ñ ðôô
b
Ð3ó b
óð
b
ñJ ðôô
c
Ð5ó c
óð
c
ñL ðôô
U
Ð#ó U
óð
U
òp‚r    