+
    QV-j8+  ã                   óÌ   € ^ RI HtHt ^ RIt^RIHtHtHt ^RI	H
t
HtHtHt ]! 4       '       d   ^ RIt]P                  ! ]4      t]! ]! RR7      R4       ! R R	]4      4       tR# )
é    )ÚAnyÚoverloadN)Úadd_end_docstringsÚis_torch_availableÚlogging)ÚGenericTensorÚPipelineÚPipelineExceptionÚbuild_pipeline_init_argsT)Úhas_tokenizeraO  
        top_k (`int`, *optional*, defaults to 5):
            The number of predictions to return.
        targets (`str` or `list[str]`, *optional*):
            When passed, the model will limit the scores to the passed targets instead of looking up in the whole
            vocab. If the provided targets are not in the model vocab, they will be tokenized and the first resulting
            token will be used (with a warning, and that might be slower).
        tokenizer_kwargs (`dict`, *optional*):
            Additional dictionary of keyword arguments passed along to the tokenizer.c                   óô   a a€ ] tR t^t oRtRtRtR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tR tRR ltR tRR lt]V3R lR l4       t]V3R lR l4       tV3R lV 3R lltRtVtV ;t# )ÚFillMaskPipelineFTc                ó:   <€ V ^8„  d   QhRS[ RS[P                  /# ©é   Ú	input_idsÚreturn©r   ÚnpÚndarray)ÚformatÚ__classdict__s   "€Úq/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/transformers/pipelines/fill_mask.pyÚ__annotate__ÚFillMaskPipeline.__annotate__V   s   ø€ ÷ ñ ©-ð ¹B¿J¹Jñ ó    c                ób   € \         P                  ! WP                  P                  8H  R R7      pV# )F©Úas_tuple)ÚtorchÚnonzeroÚ	tokenizerÚmask_token_id)Úselfr   Úmasked_indexs   && r   Úget_masked_indexÚ!FillMaskPipeline.get_masked_indexV   s&   € Ü—}’} Y·.±.×2NÑ2NÑ%NÐY^Ô_ˆØÐr   c                ó:   <€ V ^8„  d   QhRS[ RS[P                  /# r   r   )r   r   s   "€r   r   r   Z   s   ø€ ÷ ñ ¹ð É"Ï*É*ñ r   c                óè   € V P                  V4      p\        P                  ! VP                  4      pV^8  d:   \	        RV P
                  P                  RV P                  P                   R24      hR# )é   ú	fill-maskzNo mask_token (z) found on the inputN)	r&   r   ÚprodÚshaper
   ÚmodelÚbase_model_prefixr"   Ú
mask_token)r$   r   r%   Únumels   &&  r   Ú_ensure_exactly_one_mask_tokenÚ/FillMaskPipeline._ensure_exactly_one_mask_tokenZ   sg   € Ø×,Ñ,¨YÓ7ˆÜ—’˜×*Ñ*Ó+ˆØ�1Œ9Ü#ØØ—
‘
×,Ñ,Ø! $§.¡.×";Ñ";Ð!<Ð<PÐQóð ñ r   c                ó    <€ V ^8„  d   QhRS[ /# )r   Úmodel_inputs)r   )r   r   s   "€r   r   r   d   s   ø€ ÷ ?ñ ?¹-ñ ?r   c                óÈ   € \        V\        4      '       d+   V F"  pV P                  VR ,          ^ ,          4       K$  	  R# VR ,           F  pV P                  V4       K  	  R# )r   N)Ú
isinstanceÚlistr2   )r$   r5   Úmodel_inputr   s   &&  r   Úensure_exactly_one_mask_tokenÚ.FillMaskPipeline.ensure_exactly_one_mask_tokend   sS   € Ü�l¤D×)Ò)Û+�Ø×3Ñ3°KÀÕ4LÈQÕ4OÖPó  ,ð *¨+×6Ð6�	Ø×3Ñ3°IÖ>ó 7r   c                ó6   <€ V ^8„  d   QhRS[ S[S[3,          /# )r   r   )ÚdictÚstrr   )r   r   s   "€r   r   r   l   s   ø€ ÷ 
ñ 
á	‰c‘=Ð Õ	!ñ
r   c                ój   € Vf   RpVf   / pV P                   ! V3RV/VB pV P                  V4       V# )NÚptÚreturn_tensors)r"   r:   )r$   ÚinputsrA   Útokenizer_kwargsÚpreprocess_parametersr5   s   &&&&, r   Ú
preprocessÚFillMaskPipeline.preprocessl   sH   € ð Ò!Ø!ˆNØÒ#Ø!Ðà—~’~ fÑ`¸^Ð`ÐO_Ñ`ˆØ×*Ñ*¨<Ô8ØÐr   c                óB   € V P                   ! R/ VB pVR ,          VR &   V# )r   © )r.   )r$   r5   Úmodel_outputss   && r   Ú_forwardÚFillMaskPipeline._forwardx   s(   € ØŸ
š
Ñ2 \Ñ2ˆØ%1°+Õ%>ˆ�kÑ"ØÐr   c           
     ó@  € Ve,   VP                   ^ ,          V8  d   VP                   ^ ,          pVR,          ^ ,          pVR,          p\        P                  ! W@P                  P                  8H  RR7      P                  R4      pV^ VR3,          pVP                  RR7      pVe   VRV3,          pVP                  V4      w  rš. pV	P                   ^ ,          ^8H  p\        \        V	P                  4       V
P                  4       4      4       Fú  w  pw  rï. p\        Wï4       FÐ  w  ppVP                  4       P                  4       pVe   VV,          P                  4       pVVWm,          &   V\        P                  ! VV P                  P                  8g  4      ,          pV P                  P!                  VVR7      pR	VR
VRV P                  P!                  V.4      RV/pVP#                  V4       KÒ  	  VP#                  V4       Kü  	  V'       d
   V^ ,          # V# )Nr   ÚlogitsFr   :NNN)Údim.)Úskip_special_tokensÚscoreÚtokenÚ	token_strÚsequenceéÿÿÿÿ)r-   r    r!   r"   r#   ÚsqueezeÚsoftmaxÚtopkÚ	enumerateÚzipÚtolistÚnumpyÚcopyr   ÚwhereÚpad_token_idÚdecodeÚappend)r$   rI   Útop_kÚ
target_idsr   Úoutputsr%   rM   ÚprobsÚvaluesÚpredictionsÚresultÚsingle_maskÚiÚ_valuesÚ_predictionsÚrowÚvÚpÚtokensrS   Úpropositions   &&&&                  r   ÚpostprocessÚFillMaskPipeline.postprocess}   sá  € àÒ! j×&6Ñ&6°qÕ&9¸EÔ&AØ×$Ñ$ QÕ'ˆEØ! +Õ.¨qÕ1ˆ	Ø Õ)ˆä—}’} Y·.±.×2NÑ2NÑ%NÐY^Ô_×gÑgÐhjÓkˆð ˜˜L¨!Ð+Õ,ˆØ—‘ 2�Ó&ˆØÒ!Ø˜#˜z˜/Õ*ˆEà#Ÿj™j¨Ó/ÑˆàˆØ—l‘l 1•o¨Ñ*ˆÜ*3´C¸¿¹»È×I[ÑI[ÓI]Ó4^Ö*_Ñ&ˆAÑ&�ØˆCÜ˜GÖ2‘��1à"Ÿ™Ó*×/Ñ/Ó1�ØÒ)Ø" 1�×,Ñ,Ó.�Aà*+��|•Ñ'à¤§¢¨°4·>±>×3NÑ3NÑ)NÓ OÕP�ð  Ÿ>™>×0Ñ0°È[Ð0ÓY�Ø&¨¨7°A°{ÀDÇNÁN×DYÑDYÐ[\ÐZ]ÓD^Ð`jÐltÐu�Ø—
‘
˜;Ö'ñ 3ð �M‰M˜#Öñ# +`÷$ Ø˜!•9ÐØˆr   c           
     ó�  € \        V\        4      '       d   V.p V P                  P                  4       p. pV F°  pVP                  V4      pVfˆ   V P                  VRRR^RR7      R,          p\        V4      ^ 8X  d   \        P                  RV R24       Ka  V^ ,          p\        P                  RV RV P                  P                  V4       R24       VP                  V4       K²  	  \        \        V4      4      p\        V4      ^ 8X  d   \        R	4      h\        P                  ! V4      pV#   \         d    / p ELi ; i)
NFT)Úadd_special_tokensÚreturn_attention_maskÚreturn_token_type_idsÚ
max_lengthÚ
truncationr   zThe specified target token `zd` does not exist in the model vocabulary. We cannot replace it with anything meaningful, ignoring itz:` does not exist in the model vocabulary. Replacing with `z`.z1At least one target must be provided when passed.)r7   r>   r"   Ú	get_vocabÚ	ExceptionÚgetÚlenÚloggerÚwarningÚconvert_ids_to_tokensr`   r8   ÚsetÚ
ValueErrorr   Úarray)r$   ÚtargetsÚvocabrb   ÚtargetÚid_r   s   &&     r   Úget_target_idsÚFillMaskPipeline.get_target_ids¦   sV  € Ü�gœs×#Ò#Ø�iˆGð	Ø—N‘N×,Ñ,Ó.ˆEð ˆ
ÛˆFØ—)‘)˜FÓ#ˆCØŠ{Ø ŸN™NØØ',Ø*/Ø*/Ø Ø#ð +ó ð õ�	ô �y“> QÔ&Ü—N‘NØ6°v°hð ?Uð Uôñ Ø •l�ô
 —‘Ø2°6°(ð ;'Ø'+§~¡~×'KÑ'KÈCÓ'PÐ&QÐQSðUôð ×Ñ˜cÖ"ñ5 ô6 œ#˜j›/Ó*ˆ
Üˆz‹?˜aÔÜÐPÓQÐQÜ—X’X˜jÓ)ˆ
ØÐøôE ô 	Ø‹Eð	ús   ›D4 Ä4EÅEc                óØ   € / pVe   W4R&   / pVe   V P                  V4      pWeR&   Ve   WR&   V P                  P                  f"   \        RV P                  P
                  R4      hV/ V3# )NrC   rb   ra   r+   z-The tokenizer does not define a `mask_token`.)r‡   r"   r#   r
   r.   r/   )r$   ra   rƒ   rC   Úpreprocess_paramsÚpostprocess_paramsrb   s   &&&&   r   Ú_sanitize_parametersÚ%FillMaskPipeline._sanitize_parametersÏ   sˆ   € ØÐàÒ'Ø4DÐ0Ñ1àÐàÒØ×,Ñ,¨WÓ5ˆJØ/9˜|Ñ,àÒØ*/˜wÑ'à�>‰>×'Ñ'Ò/Ü#Ø˜TŸZ™Z×9Ñ9Ð;jóð ð ! "Ð&8Ð8Ð8r   c          	      óR   <€ V ^8„  d   QhRS[ RS[RS[S[S[ S[3,          ,          /# ©r   rB   Úkwargsr   )r>   r   r8   r=   )r   r   s   "€r   r   r   å   s%   ø€ ×OÑO™sÐO©cÐO±d¹4ÁÁSÀ½>Õ6JÑOr   c                ó   € R # ©NrH   ©r$   rB   r�   s   &&,r   Ú__call__ÚFillMaskPipeline.__call__ä   s   € ÙLOr   c          
      ór   <€ V ^8„  d   QhRS[ S[,          RS[RS[ S[ S[S[S[3,          ,          ,          /# r�   )r8   r>   r   r=   )r   r   s   "€r   r   r   è   s/   ø€ ×[Ñ[™t¡C�yÐ[±CÐ[¹DÁÁdÉ3ÑPSÈ8ÅnÕAUÕ<VÑ[r   c                ó   € R # r’   rH   r“   s   &&,r   r”   r•   ç   s   € ÙX[r   c                ó¸   <€ V ^8„  d   QhRS[ S[S[ ,          ,          RS[RS[S[S[ S[3,          ,          S[S[S[S[ S[3,          ,          ,          ,          /# r�   )r>   r8   r   r=   )r   r   s   "€r   r   r   ê   sV   ø€ ÷ ñ ™s¡T©#¥Y�ð ¹#ð Á$ÁtÉCÑQTÈHÅ~ÕBVÑY]Ñ^bÑcgÑhkÑmpÐhpÕcqÕ^rÕYsÕBsñ r   c                óˆ   <€ \         SV `  ! V3/ VB p\        V\        4      '       d   \	        V4      ^8X  d
   V^ ,          # V# )a  
Fill the masked token in the text(s) given as inputs.

Args:
    inputs (`str` or `list[str]`):
        One or several texts (or one list of prompts) with masked tokens.
    targets (`str` or `list[str]`, *optional*):
        When passed, the model will limit the scores to the passed targets instead of looking up in the whole
        vocab. If the provided targets are not in the model vocab, they will be tokenized and the first
        resulting token will be used (with a warning, and that might be slower).
    top_k (`int`, *optional*):
        When passed, overrides the number of predictions to return.

Return:
    A list or a list of list of `dict`: Each result comes as list of dictionaries with the following keys:

    - **sequence** (`str`) -- The corresponding input with the mask token prediction.
    - **score** (`float`) -- The corresponding probability.
    - **token** (`int`) -- The predicted token id (to replace the masked one).
    - **token_str** (`str`) -- The predicted token (to replace the masked one).
)Úsuperr”   r7   r8   r|   )r$   rB   r�   rc   Ú	__class__s   &&, €r   r”   r•   ê   s@   ø€ ô, ‘'Ò" 6Ñ4¨VÑ4ˆÜ�fœd×#Ò#¬¨F«°qÔ(8Ø˜1•:ÐØˆr   rH   )NN)é   N)NNN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú_load_processorÚ_load_image_processorÚ_load_feature_extractorÚ_load_tokenizerr&   r2   r:   rE   rJ   rq   r‡   rŒ   r   r”   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r›   r   s   @@r   r   r      sŽ   ù‡ € ð €OØ!ÐØ#ÐØ€Oð2÷hð ÷ð ÷?ð ?÷
ò 
òô
'òR'ôR9ð* ßOó ØOàß[ó Ø[÷÷ ó r   r   )Útypingr   r   r[   r   Úutilsr   r   r   Úbaser   r	   r
   r   r    Ú
get_loggerr�   r}   r   rH   r   r   Ú<module>r¬      sh   ðß  ã ç CÑ Cß VÓ Vñ ×ÒÛð 
×	Ò	˜HÓ	%€ñ Ù¨4Ô0ðYóôg�xó góògr   