+
    QV-jÕõ  ã                   ó*  € R t ^ RIt^ RIt^ RIHt ^ RIHtHt ^RIH	t	H
t
HtHtHtHtHtHt ^RIHtHtHtHt ]P,                  ! ]4      tRtRtRt ! R	 R
4      t ! R R]4      tR tR tR t R t!R t"R R lt#]! ]	4       ! R R]4      4       t$]$t%R# )z•
Tokenization classes for python tokenizers. For fast tokenizers (provided by HuggingFace's tokenizers library) see
tokenization_utils_tokenizers.py
N)ÚOrderedDict)ÚAnyÚoverload)ÚINIT_TOKENIZER_DOCSTRINGÚ
AddedTokenÚBatchEncodingÚEncodedInputÚPreTokenizedInputÚPreTrainedTokenizerBaseÚ	TextInputÚTruncationStrategy)ÚPaddingStrategyÚ
TensorTypeÚadd_end_docstringsÚloggingzspecial_tokens_map.jsonzadded_tokens.jsonztokenizer_config.jsonc                   óZ   a € ] tR t^-t o RtR tR tV 3R lR ltV 3R lR ltR t	R	t
V tR
# )ÚTriez£
Trie in Python. Creates a Trie out of a list of words. The trie is used to split on `added_tokens` in one pass
Loose reference https://en.wikipedia.org/wiki/Trie
c                ó`   € / V n         \        4       V n        R V n        V P                  ! V!   R# )Ú N)ÚdataÚsetÚ_tokensÚ_termination_charÚupdate)ÚselfÚargss   &*Úq/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/transformers/tokenization_python.pyÚ__init__ÚTrie.__init__3   s&   € ØˆŒ	Ü“uˆŒØ!#ˆÔØ�Š�TÔó    c                óH   € \        V!   F  pV P                  V4       K  	  R# )z}
Updates the Trie with new tokens provided as arguments.

Args:
    *args: Variable number of words to be added to the Trie.
N)ÚtupleÚadd)r   r   Útokens   &* r   r   ÚTrie.update9   s   € ô ˜D”\ˆEØ�H‰H�UŽOó "r   c                ó    <€ V ^8„  d   QhRS[ /# )é   Úword©Ústr)ÚformatÚ__classdict__s   "€r   Ú__annotate__ÚTrie.__annotate__C   s   ø€ ÷ (ñ (™ñ (r   c                óÎ   € V'       g   R# V P                   P                  V4       V P                  pV F  pVP                  V/ 4      W#&   W#,          pK!  	  ^W P                  &   R# )u%  
Passes over every char (utf-8 char) on word and recursively adds it to the internal `data` trie representation.
The special key `""` in `self._termination_char` is used to represent termination.

This function is idempotent, adding twice the same word will leave the trie unchanged

Example:

```python
>>> trie = Trie()
>>> trie.add("Hello å�‹é�”")
>>> trie.data
{"H": {"e": {"l": {"l": {"o": {" ": {"å�‹": {"é�”": {"": 1}}}}}}}}}

>>> trie.add("Hello")
>>> trie.data
{"H": {"e": {"l": {"l": {"o": {"": 1, " ": {"å�‹": {"é�”": {"": 1}}}}}}}}}
```
N)r   r"   r   Ú
setdefaultr   )r   r'   ÚrefÚchars   &&  r   r"   ÚTrie.addC   sX   € ÷( áà�‰×Ñ˜ÔØ�i‰iˆÛˆDØŸ™ t¨RÓ0ˆC‰IØ•)ŠCñ ð '(ˆ×"Ñ"Ó#r   c                ó6   <€ V ^8„  d   QhRS[ RS[S[ ,          /# ©r&   ÚtextÚreturn)r)   Úlist)r*   r+   s   "€r   r,   r-   b   s#   ø€ ÷ W,ñ W,™#ð W,¡$¡s¥)ñ W,r   c                óò  € \        4       p^ .p^ p\        V4       EFy  w  rVV'       d	   WT8  d   K  \        4       pRpVP                  4        Fü  w  ršRV
9   dÌ   VP                  4        F‘  w  r¼W¹8”  d    MˆW¹8  d   V^,           pV^,           pMTpTpV\	        V4      8  d	   W,          MRpRV9   d   Tp	TpTpWü9   g   KY  WÏ,          pV^,          pRV9   d   Tp	TpTpV\	        V4      8X  d   K‰  W,          pKB  	  VP                  V	4       VP                  X4       Rp M)Wj9   d   W¦,          p
W¢V	&   Kë  VP                  V	4       Kþ  	  V'       d   / pMV F  p	W) K  	  WT8¼  g   EKQ  W`P                  9   g   EKd  V P                  V,          W%&   EK|  	  VP                  4        F;  w  ršRV
9   g   K  \	        V4      pVP                  V	4       VP                  V4        M	  V P                  W4      # )aá  
Will look for the words added to the trie within `text`. Output is the original string split along the
boundaries of the words found.

This trie will match the longest possible word first !

Example:

```python
>>> trie = Trie()
>>> trie.split("[CLS] This is a extra_id_100")
["[CLS] This is a extra_id_100"]

>>> trie.add("[CLS]")
>>> trie.add("extra_id_1")
>>> trie.add("extra_id_100")
>>> trie.split("[CLS] This is a extra_id_100")
["[CLS]", " This is a ", "extra_id_100"]
```
Fr   NT)	r   Ú	enumerater   ÚitemsÚlenÚappendr"   r   Úcut_text)r   r5   ÚstatesÚoffsetsÚskipÚcurrentÚcurrent_charÚ	to_removeÚresetÚstartÚtrie_pointerÚ	lookstartÚlooktrie_pointerÚlookahead_indexÚendÚ	next_chars   &&              r   ÚsplitÚ
Trie.splitb   s   € ôB “ˆð
 �#ˆð
 ˆä%.¨t§_Ñ!ˆGß˜œñ ô ›ˆIð ˆEð (.§|¡|¦~Ñ#�Ø˜Ô%ð 8>·|±|¶~Ñ3˜	Ø$Ô,á!Ø&Ô.ð /6¸­k˜OØ")¨A¥+™Cð
 /6˜OØ")˜CØ=LÌsÐSWËyÔ=X DÖ$9Ð^b˜	ØÐ!1Ô1Ø$-˜EØ"1˜CØ#2˜Dà'Ö;Ø/?Õ/JÐ,Ø+¨qÕ0˜OØ!Ð%5Ô5Ø(1 Ø&5 Ø'6 à.´#°d³)Ô;á %Ø(,Õ(=šIñA 8FðH —N‘N 5Ô)Ø—N‘N 3Ô'Ø �EÙØ!Ô1ð $0Õ#=�Lð %1˜5“Mð —M‘M %Ö(ñ (6÷F Ø‘ã&�EØšñ 'ð
 � <·9±9×#<Ø"&§)¡)¨LÕ"9�”ñy &5ð~ $*§<¡<¦>ÑˆEØ�\Ö!ô ˜$“i�Ø—‘˜uÔ%Ø—‘˜sÔ#ñ ñ $2ð �}‰}˜TÓ+Ð+r   c                óÈ   € VP                  \        V4      4       . p^ pV F=  pWE8”  d   \        P                  R4       K   WE8X  d   K(  VP                  WV 4       TpK?  	  V# )é    zbThere was a bug in Trie algorithm in tokenization. Attempting to recover. Please report it anyway.)r<   r;   ÚloggerÚerror)r   r5   r?   ÚtokensrE   rJ   s   &&&   r   r=   ÚTrie.cut_textû   si   € ð 	�‰”s˜4“yÔ!ØˆØˆÛˆCØŒ{Ü—‘ðôñ Ø”ñ Ø�M‰M˜$ S˜/Ô*ØŠEñ ð ˆr   )r   r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r"   rL   r=   Ú__static_attributes__Ú__classdictcell__)r+   s   @r   r   r   -   s5   ø‡ € ñò
ò÷(ð (÷>W,ð W,÷rð r   r   c                   óh   a a€ ] tR tRt oV 3R ltV3R lR ltV3R lR ltV3R lR ltR	tVt	V ;t
# )
ÚExtensionsTriei  c                ó$   <€ \         SV `  ! V!   R # ©N)Úsuperr   )r   r   Ú	__class__s   &*€r   r   ÚExtensionsTrie.__init__  s   ø€ Ü‰Ò˜$Ôr   c                ó    <€ V ^8„  d   QhRS[ /# )r&   Úprefixr(   )r*   r+   s   "€r   r,   ÚExtensionsTrie.__annotate__  s   ø€ ÷ 1ñ 1¡ñ 1r   c                ó€   € V P                  V4      pV P                  V4      pV Uu. uF  qAV,           NK  	  up# u upi )zë
Generates all extensions of a given prefix token in the Trie.

Example:

```python
>>> trie = Trie()
>>> trie.add("apple")
>>> trie.add("app")
>>> trie.add("application")
>>> trie.extensions("app")
['app', 'apple', 'application']
```
)Ú	_get_nodeÚ_collect_tokens)r   rc   Úprefix_nodeÚretr#   s   &&   r   Ú
extensionsÚExtensionsTrie.extensions  s>   € ð —n‘n VÓ,ˆØ×"Ñ" ;Ó/ˆÙ,/Ó0©C 5˜—�©CÑ0Ð0ùÒ0s   §;c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r&   r#   r6   )r)   Údict)r*   r+   s   "€r   r,   rd   +  s   ø€ ÷ ñ ™sð ¡tñ r   c                óR   € V P                   pV F  pW29  d    V# W#,          pK  	  V# )zç
Retrieves the node corresponding to the given token in the Trie.

Args:
    token (str): The token for which the corresponding node needs to be retrieved.

Returns:
    dict: The node in the Trie corresponding to the given token.
)r   )r   r#   Únoder1   s   &&  r   rf   ÚExtensionsTrie._get_node+  s7   € ð �y‰yˆÛˆDØÔØð ˆð •:ŠDñ	 ð
 ˆr   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r&   ro   r6   )rm   r7   )r*   r+   s   "€r   r,   rd   =  s   ø€ ÷ ñ ¡Dð ©Tñ r   c                ó  € V P                   V9   d   V P                   .M. pVP                  4        FO  w  r4W0P                   8w  g   K  V P                  V4      pTP                  V Uu. uF  qcV,           NK  	  up4       KQ  	  V# u upi )zÕ
Generates all tokens in the Trie starting from a given node.

Args:
    node (dict): The node in the Trie from which tokens need to be generated.

Returns:
    list: List of tokens generated from the given node.
)r   r:   rg   Úextend)r   ro   rR   r#   Úsubtrie_headÚ	subtokensÚsubtokens   &&     r   rg   ÚExtensionsTrie._collect_tokens=  s   € ð .2×-CÑ-CÀtÔ-K�$×(Ñ(Ñ)ÐQSˆØ#'§:¡:¦<ÑˆEØ×.Ñ.Ö.Ø ×0Ñ0°Ó>�	Ø—‘Á	ÓJÁ	°H x×/Ð/Á	ÑJÖKñ $0ð ˆùò Ks   Á(B
© )rT   rU   rV   rW   r   rj   rf   rg   rY   rZ   Ú__classcell__©r`   r+   s   @@r   r\   r\     s-   ù‡ € õ ÷1ð 1÷&ð ÷$÷ ð r   r\   c                ó€   € V R8X  g   V R8X  g   V R8X  g   V R8X  d   R# \         P                  ! V 4      pVR8X  d   R# R# )z0Checks whether `char` is a whitespace character.Ú Ú	Ú
ÚTÚZsF)ÚunicodedataÚcategory©r1   Úcats   & r   Ú_is_whitespacer…   O  s=   € ð ˆs„{�d˜d”l d¨d¤l°d¸d´lÙÜ
×
Ò
˜tÓ
$€CØ
ˆd„{ÙÙr   c                ó’   € V R8X  g   V R8X  g   V R8X  d   R# \         P                  ! V 4      pVP                  R4      '       d   R# R# )z-Checks whether `char` is a control character.r}   r~   r   FÚCT)r�   r‚   Ú
startswithrƒ   s   & r   Ú_is_controlr‰   [  s?   € ð ˆt„|�t˜t”| t¨t¤|ÙÜ
×
Ò
˜tÓ
$€CØ
‡~�~�c×ÒÙÙr   c                óî   € \        V 4      pV^!8¼  d   V^/8:  g+   V^:8¼  d   V^@8:  g   V^[8¼  d   V^`8:  g   V^{8¼  d
   V^~8:  d   R# \        P                  ! V 4      pVP                  R4      '       d   R# R# )z1Checks whether `char` is a punctuation character.TÚPF)Úordr�   r‚   rˆ   )r1   Úcpr„   s   &  r   Ú_is_punctuationrŽ   g  sm   € ä	ˆT‹€Bð
 	ˆbŒ�R˜2”X 2¨¤8°°b´¸bÀB¼hÈ2ÐQSÌ8ÐY[Ð_bÔYbÐgiÐmpÔgpÙÜ
×
Ò
˜tÓ
$€CØ
‡~�~�c×ÒÙÙr   c                ó|   € V R,          p\        \        V4      \        V4      ,          \        V4      ,          4      # )zcChecks whether the last character in text is one of a punctuation, control or whitespace character.éÿÿÿÿ©Úboolr‰   rŽ   r…   )r5   Ú	last_chars   & r   Ú_is_end_of_wordr”   v  s0   € à�R•€IÜ”˜IÓ&¬¸Ó)CÕCÄnÐU^ÓF_Õ_Ó`Ð`r   c                ó|   € V ^ ,          p\        \        V4      \        V4      ,          \        V4      ,          4      # )zdChecks whether the first character in text is one of a punctuation, control or whitespace character.r‘   )r5   Ú
first_chars   & r   Ú_is_start_of_wordr—   |  s0   € à�a•€JÜ”˜JÓ'¬/¸*Ó*EÕEÌÐWaÓHbÕbÓcÐcr   c                óF   € V ^8„  d   QhR\         \        ,          R\        /# )r&   Ú
token_listÚ	new_token©r7   r)   )r*   s   "r   r,   r,   ‚  s   € ÷ 
4ñ 
4´$´sµ)ð 
4Ìñ 
4r   c                ó’   € \         P                  ! W4      pV\        V 4      8  d   W,          V8X  d   R# V P                  W!4       R# )ze
Inserts one token to an ordered list if it does not already exist. Note: token_list must be sorted.
N)ÚbisectÚbisect_leftr;   Úinsert)r™   rš   Úinsertion_idxs   && r   Ú!_insert_one_token_to_ordered_listr¡   ‚  s;   € ô ×&Ò& zÓ=€Mà”s˜:“Ô&¨:Õ+DÈ	Ô+Qáà×Ñ˜-Ö3r   c                   óÌ  a a€ ] tR tRt oRtV 3R lt]V3R lR l4       t]V3R lR l4       t]V3R lR	 l4       t	]	P                  V3R
 lR l4       t	V3R lR ltR tR tR;V3R lR lltR<V3R lR lltR;V3R lR lltV3R lR ltR tR tR tRR]P,                  ]P0                  R^ RRRRRRRRRR3V3R lR lltR;V3R  lR! lltR<V3R" lR# lltR=V3R$ lV 3R% lllt]R;V3R& lR' ll4       t]R;V3R( lR) ll4       tR;V3R* lR+ lltV3R, lR- ltV3R. lR/ lt R>V3R0 lR1 llt!R?V3R2 lR3 llt"R@V3R4 lR5 llt#R<V3R6 lR7 llt$R<V3R8 lR9 llt%R:t&Vt'V ;t(# )AÚPythonBackendi�  a  
Base class for all slow tokenizers.

Inherits from [`~tokenization_utils_base.PreTrainedTokenizerBase`].

Handle all the shared methods for tokenization and special tokens as well as methods downloading/caching/loading
pretrained tokenizers as well as adding tokens to the vocabulary.

This class also contain the added tokens in a unified way on top of all tokenizers so we don't have to handle the
specific vocabulary augmentation methods of the various underlying dictionary structures (BPE, sentencepiece...).
c                óŽ  <€ \        4       V n        ^ V n        \        V R4      '       g   / V n        V P                  P                  VP                  R/ 4      4       V P                  P                  4        UUu/ uF  w  r#VP                  VbK  	  uppV n	        VP                  RR4      V n
        VP                  RR4      V n        VP                  RR4      V n        R	V9  d   R
VR	&   \        SV `8  ! R/ VB  T P                  V P                    Uu. uF  qDV P                  9  g   K  VNK  	  upRR7       R# u uppi u upi )rO   Ú_added_tokens_decoderÚadded_tokens_decoderÚtoken_type_ids_patternÚ
bert_styleÚ%token_type_ids_include_special_tokensTÚspecial_tokens_patternNÚbackendÚcustom)Úspecial_tokensrx   )r   Útokens_trieÚtotal_vocab_sizeÚhasattrr¥   r   Úpopr:   ÚcontentÚ_added_tokens_encoderr§   r©   rª   r_   r   Ú_add_tokensÚall_special_tokens)r   ÚkwargsÚvÚkr#   r`   s   &,   €r   r   ÚPythonBackend.__init__�  s7  ø€ ô  ›6ˆÔð !"ˆÔô �tÐ4×5Ò5Ø@BˆDÔ&ð 	×"Ñ"×)Ñ)¨&¯*©*Ð5KÈRÓ*PÔQØOS×OiÑOi×OoÑOoÔOqÔ5rÑOqÁtÀq°a·i±iÀ²lÑOqÒ5rˆÔ"ð '-§j¡jÐ1IÈ<Ó&XˆÔ#Ø5;·Z±ZÐ@gÐimÓ5nˆÔ2ð '-§j¡jÐ1IÈ4Ó&PˆÔ#ð ˜FÔ"Ø (ˆF�9Ñô 	‰ÒÑ"˜6Ò"ð
 	×ÑØ $× 7Ò 7ÓcÑ 7�uÈ×HbÑHbÑ;b�UˆUÑ 7ÑcØð 	ö 	
ùó+ 6sùò, ds   Á9D<ÄEÄ+Ec                ó    <€ V ^8„  d   QhRS[ /# ©r&   r6   )r’   )r*   r+   s   "€r   r,   ÚPythonBackend.__annotate__Æ  s   ø€ ÷ ñ ™ñ r   c                ó   € R # ©Frx   ©r   s   &r   Úis_fastÚPythonBackend.is_fastÅ  s   € ár   c                ó6   <€ V ^8„  d   QhRS[ S[S[3,          /# r»   ©rm   r)   Úint)r*   r+   s   "€r   r,   r¼   Ê  s   ø€ ÷ oñ o¡d©3±¨8¥nñ or   c                ó˜   € \        V P                  P                  4       R R7       UUu/ uF  w  rVP                  VbK  	  upp# u uppi )z«
Returns the sorted mapping from string to index. The added tokens encoder is cached for performance
optimisation in `self._added_tokens_encoder` for the slow tokenizers.
c                 ó   € V ^ ,          # ©rO   rx   ©Úitems   &r   Ú<lambda>Ú4PythonBackend.added_tokens_encoder.<locals>.<lambda>Ï  s   € ÐeiÐjkÖelr   ©Úkey)Úsortedr¥   r:   r²   )r   r·   r¸   s   &  r   Úadded_tokens_encoderÚ"PythonBackend.added_tokens_encoderÉ  s?   € ô *0°×0JÑ0J×0PÑ0PÓ0RÑXlÕ)mÔnÑ)m¡ �—	‘	˜1’Ñ)mÒnÐnùÓns   ªAc                ó6   <€ V ^8„  d   QhRS[ S[S[3,          /# r»   )rm   rÄ   r   )r*   r+   s   "€r   r,   r¼   Ò  s    ø€ ÷ Zñ Z¡d©3±
¨?Õ&;ñ Zr   c                ó`   € \        \        V P                  P                  4       R R7      4      # )z†
Returns the added tokens in the vocabulary as a dictionary of index to AddedToken.

Returns:
    `dict[str, int]`: The added tokens.
c                 ó   € V ^ ,          # rÇ   rx   rÈ   s   &r   rÊ   Ú4PythonBackend.added_tokens_decoder.<locals>.<lambda>Ù  s   € ÐPTÐUVÖPWr   rÌ   )rm   rÎ   r¥   r:   r¿   s   &r   r¦   Ú"PythonBackend.added_tokens_decoderÑ  s&   € ô ”F˜4×5Ñ5×;Ñ;Ó=ÑCWÔXÓYÐYr   c                ób   <€ V ^8„  d   QhRS[ S[S[S[,          3,          RS[ S[S[3,          /# )r&   Úvaluer6   )rm   rÄ   r   r)   )r*   r+   s   "€r   r,   r¼   Ü  s4   ø€ ÷ 
(ñ 
(©$©s±JÁÕ4DÐ/DÕ*Eð 
(É$ÉsÑT^ÈÕJ_ñ 
(r   c           	     óÂ  € VP                  4        Fº  w  r#\        V\        \        34      '       d   \        V\        4      '       g=   \        R VP                  VP                  3 R\        \        \        ,          3 24      h\        V\        4      '       d   \        V4      MTV P                  V&   W P                  \        V4      &   K¼  	  V P                  4        R# )z;The provided `added_tokens_decoder` has an element of type z, should be a dict of N)
r:   Ú
isinstancer)   r   rÄ   Ú	TypeErrorr`   r¥   r³   Ú_update_total_vocab_size)r   r×   Úindexr#   s   &&  r   r¦   rÕ   Û  sÞ   € ð "ŸK™KžM‰LˆEÜ˜e¤c¬:Ð%6×7Ò7¼zÈ%ÔQT×?UÒ?UÜØQÐRW×RaÑRaÐch×crÑcrÐRrÐQsð  tJô  KNô  PZô  ]`õ  P`ð  K`ð  Jað  bóð ô FPÐPUÔWZ×E[ÒE[´
¸5Ô0AÐafˆD×&Ñ& uÑ-Ø5:×&Ñ&¤s¨5£zÓ2ñ *ð 	×%Ñ%Ö'r   c                ó6   <€ V ^8„  d   QhRS[ S[S[3,          /# r»   rÃ   )r*   r+   s   "€r   r,   r¼   è  s   ø€ ÷ 	*ñ 	*¡¡c©3 h¥ñ 	*r   c                ó   € V P                   # )a(  
Returns the added tokens in the vocabulary as a dictionary of token to index. Results might be different from
the fast call because for now we always add the tokens even if they are already in the vocabulary. This is
something we should change.

Returns:
    `dict[str, int]`: The added tokens.
)r³   r¿   s   &r   Úget_added_vocabÚPythonBackend.get_added_vocabè  s   € ð ×)Ñ)Ð)r   c                ó\   € V P                   ^ 8X  d   V P                  4        V P                   # )z4
Size of the full vocabulary with the added tokens.
)r¯   rÛ   r¿   s   &r   Ú__len__ÚPythonBackend.__len__ó  s*   € ð
 × Ñ  AÔ%Ø×)Ñ)Ô+Ø×$Ñ$Ð$r   c                óB   € \        V P                  4       4      V n        R# )a  
Update the size of the full vocabulary with the added tokens. Counts the `keys` and not the `values` because
otherwise if there is a hole in the vocab, we will add tokenizers at a wrong index. This operation is slow and
is only updated when adding tokens.
N)r;   Ú	get_vocabr¯   r¿   s   &r   rÛ   Ú&PythonBackend._update_total_vocab_sizeü  s   € ô !$ D§N¡NÓ$4Ó 5ˆÖr   Fc                ó\   <€ V ^8„  d   QhRS[ S[,          S[ S[,          ,          RS[RS[/# )r&   Ú
new_tokensr­   r6   )r7   r)   r   r’   rÄ   )r*   r+   s   "€r   r,   r¼     s7   ø€ ÷ Lñ L¡d©3¥i±$±zÕ2BÕ&Bð LÑTXð LÑehñ Lr   c           	     óÖ  € ^ pVf   V# V P                  4       P                  4       p\        V4      pV EF  p\        V\        \
        34      '       g   \        RV R\        V4       R24      h\	        V4      R8X  d   KM  \        V\        4      '       dA   W`P                  9   d   Ku  W`P                  9   ;'       g    Tp\        VRRV'       * VR7      pM'V'       d    VP                  RRR	VP                  /4       W`P                  9   d   KÜ  VP                  '       gE   VP                  '       d3   \        V R
R4      '       d    VP                  P!                  4       Vn        VP                  V9  d!   WS,           pW„VP                  &   V^,          pMWFP                  ,          pVP                  '       d6   \	        V4      V P                  9  d   V P"                  P%                  V4       W`P                  V&   W€P                  VP                  &   V P&                  '       g   EK÷  \(        P+                  RV R24       EK  	  V P-                  4        V P/                  4        V# )aÍ  
Add a list of new tokens to the tokenizer class. If the new tokens are not in the vocabulary, they are added to
it with indices starting from length of the current vocabulary. Special tokens are sometimes already in the
vocab which is why they have to be handled specifically.

Args:
    new_tokens (`list[str]`or `list[tokenizers.AddedToken]`):
        Token(s) to add in vocabulary. A token is counted as added if it's not already in the vocabulary
        (tested by checking if the tokenizer assign the index of the `unk_token` to them). If a token is part
        of the vocabulary then we simply mark this token as an `AddedToken` which allows to control the
        stripping and normalization of this token. This is NOT possible in `tokenizers`.
    special_tokens (`bool`, *optional*, defaults to `False`):
        Whether or not the tokens should be added as special tokens.

Returns:
    `int`: The number of tokens actually added to the vocabulary.

Examples:

```python
# Let's see how to increase the vocabulary of Bert model and tokenizer
tokenizer = BertTokenizer.from_pretrained("google-bert/bert-base-uncased")
model = BertModel.from_pretrained("google-bert/bert-base-uncased")

num_added_toks = tokenizer.add_tokens(["new_tok1", "my_new-tok2"])
print("We have added", num_added_toks, "tokens")
# Note: resize_token_embeddings expects to receive the full size of the new vocabulary, i.e. the length of the tokenizer.
model.resize_token_embeddings(len(tokenizer))
```zToken z is not a string but a Ú.r   F)ÚrstripÚlstripÚ
normalizedÚspecialrî   Trí   Údo_lower_casezAdding z to the vocabulary)rå   Úcopyr;   rÙ   r)   r   rÚ   Útyper³   rµ   Ú__setstate__rí   r¥   rî   Úgetattrr²   ÚlowerÚ_extra_special_tokensr<   ÚverboserP   ÚinfoÚ_update_trierÛ   )	r   rè   r­   Úadded_tokensÚcurrent_vocabÚnew_idxr#   Ú
is_specialÚtoken_indexs	   &&&      r   r´   ÚPythonBackend._add_tokens  sú  € ð< ˆØÒØÐàŸ™Ó(×-Ñ-Ó/ˆÜ�mÓ$ˆÜˆEÜ˜e¤c¬:Ð%6×7Ò7Ü &¨¨Ð/FÄtÈEÃ{ÀmÐSTÐ UÓVÐVÜ�5‹z˜RÔÙÜ˜%¤×%Ò%Ø×6Ñ6Ô6Ùð "'×*AÑ*AÑ!A×!SÐ!SÀ^�JÜ&Ø e°EÈ*ÄnÐ^hô‘E÷  ð ×"Ñ" I¨t°\À5×CSÑCSÐ#TÔUØ×2Ñ2Ô2ÙØ—=—=�= U×%5×%5Ð%5¼'À$ÈÐY^×:_Ò:_à %§¡× 3Ñ 3Ó 5�”Ø�}‰} MÔ1Ø%Õ4�Ø/:˜eŸm™mÑ,Ø Õ!‘à+¯M©MÕ:�à�}�}ˆ}¤ U£°4×3JÑ3JÔ!JØ×*Ñ*×1Ñ1°%Ô8à6;×&Ñ& {Ñ3Ø8C×&Ñ& u§}¡}Ñ5Ø�|�|‹|Ü—‘˜g e WÐ,>Ð?×@ñI  ðL 	×ÑÔØ×%Ñ%Ô'ØÐr   Nc                ó>   <€ V ^8„  d   QhRS[ S[,          R,          /# )r&   Úunique_no_split_tokensNr›   )r*   r+   s   "€r   r,   r¼   R  s   ø€ ÷ ,ñ ,±4¹µ9¸tÕ3Cñ ,r   c                ót  € V P                   P                  4        FO  pVP                  V P                  P                  9  g   K*  V P                  P                  VP                  4       KQ  	  T;'       g    .  F:  pW P                  P                  9  g   K  V P                  P                  V4       K<  	  R # r^   )r¥   Úvaluesr²   r®   r   r"   )r   r   r#   s   && r   rø   ÚPythonBackend._update_trieR  sˆ   € Ø×/Ñ/×6Ñ6Ö8ˆEØ�}‰} D×$4Ñ$4×$<Ñ$<Ö<Ø× Ñ ×$Ñ$ U§]¡]Ö3ñ 9ð ,×1Ð1¨rÒ1ˆEØ×,Ñ,×4Ñ4Ö4Ø× Ñ ×$Ñ$ UÖ+ó 2r   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r&   Úpairr6   )r’   rÄ   )r*   r+   s   "€r   r,   r¼   Z  s   ø€ ÷ fñ f©dð f¹sñ fr   c                ób   € . p. p\        T P                  Y!'       d   V4      4      # R4      4      # )aç  
Returns the number of added tokens when encoding a sequence with special tokens.

<Tip>

This encodes a dummy input and checks the number of added tokens, and is therefore not efficient. Do not put
this inside your training loop.

</Tip>

Args:
    pair (`bool`, *optional*, defaults to `False`):
        Whether the number of added tokens should be computed in the case of a sequence pair or a single
        sequence.

Returns:
    `int`: Number of special tokens added to sequences.
N)r;   Ú build_inputs_with_special_tokens)r   r  Útoken_ids_0Útoken_ids_1s   &&  r   Únum_special_tokens_to_addÚ'PythonBackend.num_special_tokens_to_addZ  s5   € ð& ˆØˆÜ�4×8Ñ8¸ÖUYÀkÓdÓeÐeÐ_cÓdÓeÐer   c                ó6   <€ V ^8„  d   QhRS[ RS[S[,          /# r4   )r   r7   r)   )r*   r+   s   "€r   r,   r¼   q  s   ø€ ÷ 5ñ 5™Yð 5±T¹#µYñ 5r   c                óþ  € VP                  RV P                  4      pV P                  ! V3/ VB w  rV'       d   V P                  V4      # V P                  P                  V4      pV P                  P                  4       p\        V4       EF„  w  rgWu9   g   K  V P                  P                  V P                  V,          4      pV^ 8”  d   WF^,
          ,          MRp	V\        V4      ^,
          8  d   WF^,           ,          MRp
\        V\        4      '       g   K’  VP                  '       d"   V
'       d   V
P                  4       WF^,           &   VP                  '       d"   V	'       d   V	P                  4       WF^,
          &   VP                   '       g   EK  V	'       d1   V	R,          R8w  d#   WF^,
          ;;,          V,          uu&   RWF&   EKE  V
'       g   EKP  V
^ ,          R8w  g   EKa  WtV^,           ,          ,           WF^,           &   RWF&   EK‡  	  . p\#        V P$                  4      pV FL  pV'       g   K  Wu9   g   W|9   d   VP'                  V4       K,  VP)                  V P                  V4      4       KN  	  V# )zô
Converts a string into a sequence of tokens, using the tokenizer.

Args:
    text: The sequence to be encoded.
    **kwargs: Passed along to the model-specific `prepare_for_tokenization` preprocessing method.

Returns:
    The list of tokens.
Úsplit_special_tokensNr|   r   r�   )r±   r  Úprepare_for_tokenizationÚ	_tokenizer®   rL   r³   Úkeysr9   r¥   Úgetr;   rÙ   r   rë   rì   Úsingle_wordr   rµ   r<   rs   )r   r5   r¶   r  rR   Úno_split_tokenÚir#   Útok_extendedÚleftÚrightÚresultÚall_special_tokens_sets   &&,          r   ÚtokenizeÚPythonBackend.tokenizeq  sÝ  € ð  &Ÿz™zÐ*@À$×B[ÑB[Ó\ÐØ×4Ò4°TÑD¸VÑD‰ˆçà—>‘> $Ó'Ð'ð ×!Ñ!×'Ñ'¨Ó-ˆØ×3Ñ3×8Ñ8Ó:ˆô " &×)‰HˆAØÖ&Ø#×9Ñ9×=Ñ=¸d×>XÑ>XÐY^Õ>_Ó`�Ø()¨A¬�v !�e–}°4�Ø)*¬S°«[¸1­_Ô)<˜ 1�užÀ$�ä˜l¬J×7Ô7Ø#×*×*Ð*¯uØ(-¯©«˜ 1�u™Ø#×*×*Ð*¯tØ(,¯©«˜ 1�u™Ø#×/×/Ó/ß D¨¥H°¤OØ" q¥5ŸM¨UÕ2›MØ(*˜FœIß"šU u¨Q¥x°3§Ø,1¸1¸q½5µMÕ,A˜F q¥5™MØ(*˜FœIñ# *ð( ˆÜ!$ T×%<Ñ%<Ó!=ÐÛˆEßÙØÔ&¨%Ô*IØ—‘˜eÖ$à—‘˜dŸn™n¨UÓ3Ö4ñ ð ˆr   c                ó   € \         h)zæ
Converts a string into a sequence of tokens (string), using the tokenizer. Split in words for word-based
vocabulary or sub-words for sub-word-based vocabularies (BPE/SentencePieces/WordPieces).

Do NOT take care of added tokens.
©ÚNotImplementedError)r   r5   r¶   s   &&,r   r  ÚPythonBackend._tokenize¨  s
   € ô "Ð!r   c                ój   € WP                   9   d   V P                   V,          # V P                  V4      # r^   )r³   Ú_convert_token_to_id©r   r#   s   &&r   Ú#_convert_token_to_id_with_added_vocÚ1PythonBackend._convert_token_to_id_with_added_voc±  s2   € ð ×.Ñ.Ô.Ø×-Ñ-¨eÕ4Ð4Ø×(Ñ(¨Ó/Ð/r   c                ó   € \         hr^   r  r#  s   &&r   r"  Ú"PythonBackend._convert_token_to_id»  ó   € Ü!Ð!r   Tc          $      ó8  <€ V ^8„  d   QhRS[ S[,          S[,          RS[ S[,          S[,          R,          RS[RS[RS[RS[R,          RS[R	S[R
S[R,          RS[R,          RS[S[,          R,          RS[R,          RS[R,          RS[RS[RS[RS[RS[	/# )r&   r5   Ú	text_pairNÚadd_special_tokensÚpadding_strategyÚtruncation_strategyÚ
max_lengthÚstrideÚis_split_into_wordsÚpad_to_multiple_ofÚpadding_sideÚreturn_tensorsÚreturn_token_type_idsÚreturn_attention_maskÚreturn_overflowing_tokensÚreturn_special_tokens_maskÚreturn_lengthrö   r6   )
r   r	   r   r’   r   r   rÄ   r)   r   r   )r*   r+   s   "€r   r,   r¼   ¾  s  ø€ ÷ I
ñ I
áÑ+Õ+©lÕ:ðI
ñ Ñ0Õ0±<Õ?À$ÕFðI
ñ !ð	I
ñ
 *ðI
ñ 0ðI
ñ ˜$•JðI
ñ ðI
ñ "ðI
ñ   $�JðI
ñ ˜D•jðI
ñ ™jÕ(¨4Õ/ðI
ñ  $ d�{ðI
ñ  $ d�{ðI
ñ $(ðI
ñ  %)ð!I
ñ" ð#I
ñ$ ð%I
ñ( 
ñ)I
r   c                ó:  a aa€ \        V\        \        34      ;'       d“    V'       * ;'       d    S'       * ;'       gu    T;'       d0    S;'       d&    \        V^ ,          \        \        34      ;'       g<    T;'       d2    S'       * ;'       d#    \        V^ ,          \        \        \        34      pV'       Ed�   VeA   \        V\        \        34      '       d   \	        V4      \	        V4      8w  d   \        R4      hVe   TMR.\	        V4      ,          p/ p\        VV4       EFº  w  pp\        V\        \        34      '       Ed	   V'       Ed    \        V^ ,          \        4      '       gã   Vfß   \	        V4      ^8H  ;'       d�    \        V^ ,          \        4      ;'       g&    \        V^ ,          \        \        34      ;'       d=    \        V^,          \        4      ;'       g    \        V^,          \        \        34      pV'       d   Vw  ppM:\	        V4      ^8X  d   V^ ,          pM S'       g   \        R\	        V4       R24      hS P                  ! R/ RVbRVbRVbR\        P                  bR	VbR
VbRVbRSbRRbRRbRRbRVbRRbRVbRVbRVbRVbSB pVP                  4        F'  w  ppVP                  V. 4      P                  V4       K)  	  EK½  	  V'       d-   V'       d%   VP                  RR4       VP                  RR4       S P                  VVP                   VV	V
VR7      p\#        VVR7      # VVV 3R lpV! V4      pVe	   V! V4      MRpS P%                  VVVVP                   VP                   VVV	V
VRVVVVVVR7      # )rO   NzJIf `text` is a batch, `text_pair` must also be a batch of the same length.z"Expected a pair of sequences, got z sequences.r5   r*  r+  r,  r-  r.  r/  r0  r1  r2  r3  r4  r5  Fr6  r7  r8  rö   Úoverflowing_tokensÚnum_truncated_tokens)Úpaddingr.  r1  r2  r5  )Útensor_typec                 ó  <€ \        V \        4      '       d#   SP                  SP                  ! V 3/ SB 4      # \        V \        \
        34      '       dš   V '       d’   \        V ^ ,          \        4      '       d   V # \        V ^ ,          \        4      '       dV   S'       d=   SP                  V  UUu. uF  pSP                  ! V3/ SB  F  q"NK  	  K   	  upp4      # SP                  V 4      # \        R\        V 4       24      hu uppi )rO   z?Input must be a string, list of strings, or list of ints, got: )	rÙ   r)   Úconvert_tokens_to_idsr  r7   r!   rÄ   Ú
ValueErrorrñ   )r5   r'   Útokr0  r¶   r   s   &  €€€r   Úget_input_idsÚ1PythonBackend._encode_plus.<locals>.get_input_ids"  sÝ   ø€ Ü˜$¤×$Ò$à×1Ñ1°$·-²-ÀÑ2OÈÑ2OÓPÐPÜ˜$¤¤u ×.Ò.·4Ü˜d 1�g¤s×+Ò+Ø�Kä˜d 1�g¤s×+Ò+ß*Ø#×9Ñ9Ù-1Ô[©T T¸T¿]º]È4Ñ=ZÐSYÔ=Z°cšSÑ=Z™S©TÒ[ó ð ð  ×5Ñ5°dÓ;Ð;ÜÐ^Ô_cÐdhÓ_iÐ^jÐkÓlÐlùó \s   Â2$D
T)Úpair_idsr+  r<  Ú
truncationr.  r/  r1  r2  r3  Úprepend_batch_axisr5  r4  r6  r7  r8  rö   rx   )rÙ   r7   r!   r)   r;   r@  ÚziprÄ   Ú_encode_plusr   Ú
DO_NOT_PADr:   r/   r<   r±   Úpadr×   r   Úprepare_for_model)r   r5   r*  r+  r,  r-  r.  r/  r0  r1  r2  r3  r4  r5  r6  r7  r8  rö   r¶   Ú
is_batchedÚpairsÚbatch_outputsÚcurrent_textÚcurrent_pairÚis_pairÚcurrent_outputrÍ   r×   rB  Ú	first_idsÚ
second_idss   f&&&&&&&f&&&&&&&&&l            r   rH  ÚPythonBackend._encode_plus¾  sÎ  ú€ ô,   ¤t¬U mÓ4÷ 
ð 
ØŒX×1Ð1Ð1Ô1÷ ^ð ^Ø×SÐSÐ,×SÐS´¸DÀ½GÄdÌEÀ]Ó1S÷^ð ^à×\Ð\Ð0Ô0×\Ð\´ZÀÀQÅÌ#ÌtÔUZÐI[Ó5\ð 	÷ ˆ:ØÒ$Ü! )¬d´E¨]×;Ò;¼sÀ9»~ÔQTÐUYÓQZÔ?ZÜ$Ð%qÓrÐrØ!*Ò!6‘I¸T¸FÄSÈÃYÕ<NˆEàˆMÜ.1°$¸×.>Ñ*�˜lô
 ˜|¬d´E¨]×;Ó;ß$˜Ü& |°A¥¼×<Ò<Ø$Ò,ô ˜LÓ)¨QÑ.÷ mð mÜ'¨°Q­¼Ó=×kÐkÄÈLÐYZÍOÔ^bÔdiÐ]jÓAk÷mð mä'¨°Q­¼Ó=×kÐkÄÈLÐYZÍOÔ^bÔdiÐ]jÓAkð ÷
 Ø5AÑ2˜¡lÜ˜\Ó*¨aÔ/Ø'3°A¥™ß0ä(Ð+MÌcÐR^ÓN_ÐM`Ð`kÐ)lÓmÐmà!%×!2Ò!2ò "Ù%ð"á*ð"ñ (:ð"ô &5×%?Ò%?ð	"ñ
 )<ð"ñ  *ð"ñ "ð"ñ )<ð"ñ (,ð"ñ "&ð"ñ $(ð"ñ +@ð"ñ +0ð"ñ /Hð"ñ 0Jð"ñ  #0ð!"ñ" $Øñ%"�ð( #1×"6Ñ"6Ö"8‘J�C˜Ø!×,Ñ,¨S°"Ó5×<Ñ<¸UÖCô #9ñY /?÷b ×";Ø×!Ñ!Ð"6¸Ô=Ø×!Ñ!Ð"8¸$Ô?à ŸH™HØØ(×.Ñ.Ø%Ø#5Ø)Ø&;ð %ó ˆMô ! ¸NÔKÐK÷	mñ  " $Ó'ˆ	Ø1:Ò1F‘] 9Ô-ÈDˆ
à×%Ñ%ØØØ1Ø$×*Ñ*Ø*×0Ñ0Ø!ØØ1Ø%Ø)Ø#Ø"7Ø"7Ø&?Ø'AØ'Øð# &ó 
ð 	
r   c          
      óX   <€ V ^8„  d   QhRS[ RS[RS[S[ S[S[ S[3,          3,          /# )r&   r5   r0  r6   )r)   r’   r!   rm   r   )r*   r+   s   "€r   r,   r¼   I  s7   ø€ ÷ ñ ÙðÙ.2ðá	‰s‘D™™c˜•NÐ"Õ	#ñr   c                ó   € W3# )aW  
Performs any necessary transformations before tokenization.

This method should pop the arguments from kwargs and return the remaining `kwargs` as well. We test the
`kwargs` at the end of the encoding process to be sure all the arguments have been used.

Args:
    text (`str`):
        The text to prepare.
    is_split_into_words (`bool`, *optional*, defaults to `False`):
        Whether or not the input is already pre-tokenized (e.g., split into words). If set to `True`, the
        tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
        which it will tokenize. This is useful for NER or token classification.
    kwargs (`dict[str, Any]`, *optional*):
        Keyword arguments to use for the tokenization.

Returns:
    `tuple[str, dict[str, Any]]`: The prepared text and the unused kwargs.
rx   )r   r5   r0  r¶   s   &&&,r   r  Ú&PythonBackend.prepare_for_tokenizationI  s   € ð, ˆ~Ðr   c                ój   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          R,          RS[ S[,          /# ©r&   r  r	  Nr6   ©r7   rÄ   )r*   r+   s   "€r   r,   r¼   a  s;   ø€ ÷ g-ñ g-Ù¡�9ðg-Ù37¹µ9¸tÕ3Cðg-á	‰c�ñg-r   c                ó4  € V P                   R8X  d¬   V P                  f5   V P                  f'   \        RV P                   RV P                   R24      hVf'   V P                  .V,           V P                  .,           # V P                  .V,           V P                  .,           V,           V P                  .,           # V P                   R8X  dk   V P                  f   \        RV P                   R24      hVf   WP                  .,           # WP                  .,           V,           V P                  .,           # V P                   R8X  dm   V P
                  f   \        R	V P
                   R24      hVf   V P
                  .V,           # V P
                  .V,           V P
                  .,           V,           # V P                   R
8X  d¬   V P
                  f5   V P                  f'   \        RV P
                   RV P                   R24      hVf'   V P
                  .V,           V P                  .,           # V P
                  .V,           V P                  .,           V,           V P                  .,           # V P                   R8X  d·   V P                  f5   V P                  f'   \        RV P                   RV P                   R24      hVf'   V P                  .V,           V P                  .,           # V P                  .V,           V P                  V P                  .,           V,           V P                  .,           # V P                   R8X  dD   \        V R. 4      p\        V R. 4      pVf   W1,           V,           # W1,           V,           V,           # Vf   V# W,           # )a�  
Build model inputs from a sequence or a pair of sequences by adding special tokens.

This method dynamically builds inputs based on the tokenizer's `special_tokens_pattern`:
- `"none"`: No special tokens
- `"cls_sep"`: [CLS] seq0 [SEP] or [CLS] seq0 [SEP] seq1 [SEP]
- `"eos"`: seq0 [EOS] or seq0 [EOS] seq1 [EOS]
- `"bos"`: [BOS] seq0 or [BOS] seq0 [BOS] seq1
- `"bos_eos"`: [BOS] seq0 [EOS] or [BOS] seq0 [EOS] seq1 [EOS]
- `"cls_double_sep"`: [CLS] seq0 [SEP] or [CLS] seq0 [SEP] [SEP] seq1 [SEP]
- `"prefix_suffix"`: `<prefix_tokens> seq0 [seq1] <suffix_tokens>` (custom prefix/suffix stored on the tokenizer)

Args:
    token_ids_0 (`list[int]`):
        List of IDs to which the special tokens will be added.
    token_ids_1 (`list[int]`, *optional*):
        Optional second list of IDs for sequence pairs.

Returns:
    `list[int]`: List of input IDs with the appropriate special tokens.
Úcls_sepzzCannot add special tokens following 'cls_sep' pattern because one or several special tokens are not defined (cls_token_id=z; sep_token_id=zZ)Set the required special tokens in tokenizer or update `tokenizer.special_tokens_pattern`ÚeoszaCannot add special tokens following 'eos' pattern because eos token is not defined (eos_token_id=z[).Set the required special tokens in tokenizer or update `tokenizer.special_tokens_pattern`ÚboszaCannot add special tokens following 'bos' pattern because bos token is not defined (bos_token_id=Úbos_eoszzCannot add special tokens following 'bos_eos' pattern because one or several special tokens are not defined (bos_token_id=z; eos_token_id=Úcls_double_sepz�Cannot add special tokens following 'cls_double_sep' pattern because one or several special tokens are not defined (cls_token_id=Úprefix_suffixÚprefix_tokensÚsuffix_tokens)rª   Úcls_token_idÚsep_token_idr@  Úeos_token_idÚbos_token_idró   )r   r  r	  rc  rd  s   &&&  r   r  Ú.PythonBackend.build_inputs_with_special_tokensa  sÌ  € ð0 ×&Ñ&¨)Ô3à× Ñ Ò(¨T×->Ñ->Ò-FÜ ð5Ø59×5FÑ5FÐ4GÀÐW[×WhÑWhÐVið jpðpóð ð
 Ò"Ø×)Ñ)Ð*¨[Õ8¸D×<MÑ<MÐ;NÕNÐNØ×%Ñ%Ð&¨Õ4¸×8IÑ8IÐ7JÕJÈ[ÕXÐ\`×\mÑ\mÐ[nÕnÐnà×(Ñ(¨EÔ1à× Ñ Ò(Ü ð%Ø%)×%6Ñ%6Ð$7ð 8pðpóð ð
 Ò"Ø"×&7Ñ&7Ð%8Õ8Ð8Ø×"3Ñ"3Ð!4Õ4°{ÕBÀd×FWÑFWÐEXÕXÐXà×(Ñ(¨EÔ1à× Ñ Ò(Ü ð%Ø%)×%6Ñ%6Ð$7ð 8pðpóð ð
 Ò"Ø×)Ñ)Ð*¨[Õ8Ð8Ø×%Ñ%Ð&¨Õ4¸×8IÑ8IÐ7JÕJÈ[ÕXÐXà×(Ñ(¨IÔ5à× Ñ Ò(¨T×->Ñ->Ò-FÜ ð5Ø59×5FÑ5FÐ4GÀÐW[×WhÑWhÐVið jpðpóð ð Ò"Ø×)Ñ)Ð*¨[Õ8¸D×<MÑ<MÐ;NÕNÐNØ×%Ñ%Ð&¨Õ4¸×8IÑ8IÐ7JÕJÈ[ÕXÐ\`×\mÑ\mÐ[nÕnÐnà×(Ñ(Ð,<Ô<à× Ñ Ò(¨T×->Ñ->Ò-FÜ ð5Ø59×5FÑ5FÐ4GÀÐW[×WhÑWhÐVið jpðpóð ð
 Ò"Ø×)Ñ)Ð*¨[Õ8¸D×<MÑ<MÐ;NÕNÐNà×"Ñ"Ð#Øõà×$Ñ$ d×&7Ñ&7Ð8õ9ð õð ×$Ñ$Ð%õ	&ðð ×(Ñ(¨OÔ;Ü# D¨/¸2Ó>ˆMÜ# D¨/¸2Ó>ˆMØÒ"Ø$Õ2°]ÕBÐBØ Õ.°Õ<¸}ÕLÐLð Ò"Ø"Ð"ØÕ,Ð,r   c          	      óP   <€ V ^8„  d   QhRS[ RS[ R,          RS[RS[ S[,          /# )r&   r  r	  NÚalready_has_special_tokensr6   )r7   r’   rÄ   )r*   r+   s   "€r   r,   r¼   Ê  sA   ø€ ÷ NWñ NWÙðNWÙ.2°T­kðNWÙ^bðNWá	‰c�ñNWr   c                ó^  <€ V'       d!   Ve   \        R4      h\        SV `	  WRR7      # V P                  R8X  dk   Vf$   ^.^ .\	        V4      ,          ,           ^.,           # ^.^ .\	        V4      ,          ,           ^.,           ^ .\	        V4      ,          ,           ^.,           # V P                  R8X  d[   Vf   ^ .\	        V4      ,          ^.,           # ^ .\	        V4      ,          ^.,           ^ .\	        V4      ,          ,           ^.,           # V P                  R8X  d[   Vf   ^.^ .\	        V4      ,          ,           # ^.^ .\	        V4      ,          ,           ^.,           ^ .\	        V4      ,          ,           # V P                  R8X  dk   Vf$   ^.^ .\	        V4      ,          ,           ^.,           # ^.^ .\	        V4      ,          ,           ^.,           ^ .\	        V4      ,          ,           ^.,           # V P                  R8X  dl   Vf$   ^.^ .\	        V4      ,          ,           ^.,           # ^.^ .\	        V4      ,          ,           ^^.,           ^ .\	        V4      ,          ,           ^.,           # V P                  R	8X  d€   \	        \        V R
. 4      4      p\	        \        V R. 4      4      p^.V,          ^ .\	        V4      ,          ,           pVe   V^ .\	        V4      ,          ,          pV^.V,          ,          pV# ^ .V'       d   \	        V4      M^ \	        V4      ,           ,          # )a‚  
Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `prepare_for_model` or `encode_plus` methods.

This method dynamically builds the special tokens mask based on the tokenizer's `special_tokens_pattern`:
- `"none"`: No special tokens (default, returns all 0s)
- `"cls_sep"`: [CLS] seq0 [SEP] or [CLS] seq0 [SEP] seq1 [SEP]
- `"eos"`: seq0 [EOS] or seq0 [EOS] seq1 [EOS]
- `"bos"`: [BOS] seq0 or [BOS] seq0 [BOS] seq1
- `"bos_eos"`: [BOS] seq0 [EOS] or [BOS] seq0 [EOS] seq1 [EOS]
- `"cls_double_sep"`: [CLS] seq0 [SEP] or [CLS] seq0 [SEP] [SEP] seq1 [SEP]
- `"prefix_suffix"`: `<prefix_tokens> seq0 [seq1] <suffix_tokens>`

Args:
    token_ids_0 (`list[int]`):
        List of ids of the first sequence.
    token_ids_1 (`list[int]`, *optional*):
        List of ids of the second sequence.
    already_has_special_tokens (`bool`, *optional*, defaults to `False`):
        Whether or not the token list is already formatted with special tokens for the model.

Returns:
    A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.
zYou should not supply a second sequence if the provided sequence of ids is already formatted with special tokens for the model.T)r  r	  rk  r]  r^  r_  r`  ra  rb  rc  rd  )r@  r_   Úget_special_tokens_maskrª   r;   ró   )r   r  r	  rk  Ú
prefix_lenÚ
suffix_lenÚmaskr`   s   &&&&   €r   rm  Ú%PythonBackend.get_special_tokens_maskÊ  sñ  ø€ ÷6 &ØÒ&Ü ðRóð ô
 ‘7Ñ2Ø'Ð]að 3ó ð ð ×&Ñ&¨)Ô3àÒ"Ø�s˜q˜c¤C¨Ó$4Õ4Õ5¸¸Õ;Ð;Ø�3˜1˜#¤ KÓ 0Õ0Õ1°Q°CÕ7¸A¸3ÄÀ[ÓAQÕ;QÕRÐVWÐUXÕXÐXà×(Ñ(¨EÔ1àÒ"Ø˜œc +Ó.Õ.°1°#Õ5Ð5Ø�Cœ#˜kÓ*Õ*¨q¨cÕ1°a°S¼3¸{Ó;KÕ5KÕLÐPQÈsÕRÐRà×(Ñ(¨EÔ1àÒ"Ø�s˜q˜c¤C¨Ó$4Õ4Õ5Ð5Ø�3˜1˜#¤ KÓ 0Õ0Õ1°Q°CÕ7¸A¸3ÄÀ[ÓAQÕ;QÕRÐRà×(Ñ(¨IÔ5àÒ"Ø�s˜q˜c¤C¨Ó$4Õ4Õ5¸¸Õ;Ð;Ø�3˜1˜#¤ KÓ 0Õ0Õ1°Q°CÕ7¸A¸3ÄÀ[ÓAQÕ;QÕRÐVWÐUXÕXÐXà×(Ñ(Ð,<Ô<àÒ"Ø�s˜q˜c¤C¨Ó$4Õ4Õ5¸¸Õ;Ð;Ø�3˜1˜#¤ KÓ 0Õ0Õ1°Q¸°FÕ:¸q¸cÄCÈÓDTÕ>TÕUÐYZÐX[Õ[Ð[à×(Ñ(¨OÔ;ÜœW T¨?¸BÓ?Ó@ˆJÜœW T¨?¸BÓ?Ó@ˆJØ�3˜Õ#¨ s¬S°Ó-=Õ'=Õ>ˆDØÒ&Ø˜˜œc +Ó.Õ.Õ.�Ø�Q�C˜*Õ$Õ$ˆDØˆKð �3¯{œ3˜{Ô+ÀÄSÈÓEUÕUÕVÐVr   c                ó,   <€ V ^8„  d   QhRS[ RS[RS[/# ©r&   ÚidsÚskip_special_tokensr6   )rÄ   r’   r)   )r*   r+   s   "€r   r,   r¼     s   ø€ ×\Ñ\©Ð\Á4Ð\ÑTWÑ\r   c                ó   € R # r^   rx   ©r   rt  ru  s   &&&r   Úconvert_ids_to_tokensÚ#PythonBackend.convert_ids_to_tokens  s   € ÙY\r   c                óL   <€ V ^8„  d   QhRS[ S[,          RS[RS[ S[,          /# rs  )r7   rÄ   r’   r)   )r*   r+   s   "€r   r,   r¼     s#   ø€ ×hÑh©©c­ÐhÉÐhÑZ^Ñ_bÕZcÑhr   c                ó   € R # r^   rx   rw  s   &&&r   rx  ry    s   € Ùehr   c                ól   <€ V ^8„  d   QhRS[ S[S[ ,          ,          RS[RS[S[S[,          ,          /# rs  ©rÄ   r7   r’   r)   )r*   r+   s   "€r   r,   r¼      s7   ø€ ÷ !ñ !©©t±C­y­ð !Étð !Ñ`cÑfjÑknÕfoÕ`oñ !r   c                óÒ  € \        V\        4      '       d?   WP                  9   d   V P                  V,          P                  # V P	                  V4      # . pV'       d   \        V P                  4      M	\        4       pV Fc  p\        V4      pWT9   d   K  TP                  WPP                  9   d   V P                  V,          P                  MV P	                  V4      4       Ke  	  V# )aœ  
Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.

Args:
    ids (`int` or `list[int]`):
        The token id (or token ids) to convert to tokens.
    skip_special_tokens (`bool`, *optional*, defaults to `False`):
        Whether or not to remove special tokens in the decoding.

Returns:
    `str` or `list[str]`: The decoded token(s).
)rÙ   rÄ   r¥   r²   Ú_convert_id_to_tokenr   Úall_special_idsr<   )r   rt  ru  rR   Úids_to_skiprÜ   s   &&&   r   rx  ry     sË   € ô �cœ3×Òð ×4Ñ4Ô4ð ×*Ñ*¨3Õ/×7Ñ7ðð ×.Ñ.¨sÓ3ðð ˆç3F”c˜$×.Ñ.Ô/ÌCËEˆÛˆEÜ˜“JˆEØÔ#ÙØ�M‰Mà×6Ñ6Ô6ð ×*Ñ*¨5Õ1×9Ò9à×.Ñ.¨uÓ5öñ	 ð ˆr   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r&   rÜ   r6   )rÄ   r)   )r*   r+   s   "€r   r,   r¼   C  s   ø€ ÷ "ñ "©#ð "±#ñ "r   c                ó   € \         hr^   r  )r   rÜ   s   &&r   r  Ú"PythonBackend._convert_id_to_tokenC  r(  r   c                ó6   <€ V ^8„  d   QhRS[ S[,          RS[/# )r&   rR   r6   r›   )r*   r+   s   "€r   r,   r¼   F  s   ø€ ÷  ñ  ©t±C­yð  ¹Sñ  r   c                ó$   € R P                  V4      # )r|   )Újoin)r   rR   s   &&r   Úconvert_tokens_to_stringÚ&PythonBackend.convert_tokens_to_stringF  s   € Ø�x‰x˜ÓÐr   c                ó`   <€ V ^8„  d   QhRS[ S[S[ ,          ,          RS[RS[R,          RS[/# )r&   Ú	token_idsru  Úclean_up_tokenization_spacesNr6   r}  )r*   r+   s   "€r   r,   r¼   I  s?   ø€ ÷ ñ á™™c�•?ðñ "ðñ '+¨T¥kð	ñ 
ñr   c                óÔ   € V P                  WR7      p\        V\        4      '       d   V.pV P                  V4      pVe   TMV P                  pV'       d   V P                  V4      pV# )zDecode token ids to string.)ru  )rx  rÙ   r)   rˆ  rŒ  Úclean_up_tokenization)r   r‹  ru  rŒ  r¶   Úfiltered_tokensr5   s   &&&&,  r   Ú_decodeÚPythonBackend._decodeI  sq   € ð ×4Ñ4°YÐ4ÓhˆÜ�o¤s×+Ò+Ø.Ð/ˆOà×,Ñ,¨_Ó=ˆð
 ,Ò7ñ )à×2Ñ2ð 	%÷
 (Ø×-Ñ-¨dÓ3ˆDàˆr   c          $      óX  <€ V ^8„  d   QhRS[ S[,          RS[ S[,          R,          RS[RS[S[,          S[,          RS[S[,          S[,          RS[R,          RS[R	S[R,          R
S[R,          RS[S[,          R,          RS[R,          RS[R,          RS[RS[RS[RS[RS[RS[/# )r&   rt  rD  Nr+  r<  rE  r.  r/  r1  r2  r3  r4  r5  r6  r7  r8  rö   rF  r6   )r7   rÄ   r’   r)   r   r   r   r   )r*   r+   s   "€r   r,   r¼   b  s%  ø€ ÷ lpñ lpá‘#�Yðlpñ ‘s•)˜dÕ"ðlpñ !ð	lpñ
 ™•™oÕ-ðlpñ ™3•JÑ!3Õ3ðlpñ ˜$•Jðlpñ ðlpñ   $�Jðlpñ ˜D•jðlpñ ™jÕ(¨4Õ/ðlpñ  $ d�{ðlpñ  $ d�{ðlpñ $(ðlpñ %)ðlpñ  ð!lpñ" ð#lpñ$ !ð%lpñ( 
ñ)lpr   c                ó¨  € V P                   ! RRVRVRVRVRV/VB w  ppppV'       d%   V\        P                  8X  d   Ve   \        R4      hVf   RV P                  9   pVf   R	V P                  9   pVRJpV'       d   V P                  VR
7      M^ p\        V4      \        T;'       g    . 4      ,           V,           p. pV\        P                  8w  d0   V'       d(   VV8”  d!   V P                  VVVV,
          VVR7      w  rpV'       d$   V P                  W4      pV P                  W4      pM%Y'       d   TM. ,           p^ .\        V4      ,          pRV/pV'       d   VVR&   V'       d0   V'       d   V P                  W4      M^ .\        V4      ,          VR&   V'       d,   V
'       g$   V'       d   VVR&   V'       d
   VV,
          M^ VR&   V P                  VR,          VV4       V\        P                  8w  g	   V'       d"   V P                  VVVP                   VV	VR7      pV'       d   \        VR,          4      VR&   \#        VV
VR7      # )zì
Prepares a sequence of input ids so it can be used by the model. Adds special tokens, truncates, and pads.

Args:
    ids: Tokenized input ids of the first sequence.
    pair_ids: Tokenized input ids of the second sequence (optional).
r<  rE  r.  r1  rö   NzÅNot possible to return overflowing tokens for pair of sequences with the `longest_first`. Please select another truncation strategy than `longest_first`, for instance `only_second` or `only_first`.Útoken_type_idsÚattention_mask)r  )rD  Únum_tokens_to_remover-  r/  Ú	input_idsÚspecial_tokens_maskr:  r;  )r.  r<  r1  r2  r5  Úlength)r=  rF  rx   )Ú"_get_padding_truncation_strategiesr   ÚLONGEST_FIRSTr@  Úmodel_input_namesr
  r;   ÚDO_NOT_TRUNCATEÚtruncate_sequencesr  Ú$create_token_type_ids_from_sequencesrm  Ú&_eventual_warn_about_too_long_sequencer   rI  rJ  r×   r   )r   rt  rD  r+  r<  rE  r.  r/  r1  r2  r3  r4  r5  r6  r7  r8  rö   rF  r¶   r,  r-  Ú_r  Únum_specialÚ	total_lenr:  Úsequencer”  Úencoded_inputss   &&&&&&&&&&&&&&&&&&,          r   rK  ÚPythonBackend.prepare_for_modelb  s‡  € ð: @D×?fÒ?fñ @
Øð@
à!ð@
ð "ð@
ð  2ð	@
ð
 ð@
ð ñ@
Ñ<ÐÐ-¨z¸1÷ &Ø#Ô'9×'GÑ'GÔGØÒ$äð>óð ð !Ò(Ø$4¸×8NÑ8NÑ$NÐ!Ø Ò(Ø$4¸×8NÑ8NÑ$NÐ!ð ˜tÐ#ˆßCU�d×4Ñ4¸$Ð4Ô?Ð[\ˆÜ˜“Hœs 8§> >¨rÓ2Õ2°[Õ@ˆ	àÐØÔ"4×"DÑ"DÔDÏÐXaÐdnÔXnØ04×0GÑ0GØØ!Ø%.°Õ%;Ø$7Øð 1Hó 1Ñ-ˆCÐ-÷ Ø×<Ñ<¸SÓKˆHØ!×FÑFÀsÓU‰Nà®(™h¸Õ;ˆHØ˜S¤3 x£=Õ0ˆNð & xÐ0ˆß Ø/=ˆNÐ+Ñ,ß%ç?Q�×,Ñ,¨SÔ;ÐXYÐWZÔ]`ÐaiÓ]jÕWjð Ð0Ñ1÷ %¯^×@RØ3EˆNÐ/Ñ0ßOY°YÀÖ5KÐ_`ˆNÐ1Ñ2ð 	×3Ñ3°NÀ;Õ4OÐQ[Ð]dÔeð œ×9Ñ9Ô9×=RØ!ŸX™XØØ%Ø(×.Ñ.Ø#5Ø)Ø&;ð &ó ˆN÷ Ü'*¨>¸+Õ+FÓ'GˆN˜8Ñ$ä˜^¸Ð\nÔoÐor   c                óÆ   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          R,          RS[RS[S[,          RS[RS[S[ S[,          S[ S[,          S[ S[,          3,          /# )r&   rt  rD  Nr–  r-  r/  r6   )r7   rÄ   r)   r   r!   )r*   r+   s   "€r   r,   r¼   Ð  sz   ø€ ÷ A1ñ A1á‘#�YðA1ñ ‘s•)˜dÕ"ðA1ñ "ð	A1ñ
 !Ñ#5Õ5ðA1ñ ðA1ñ 
‰t‘C�y™$™s�)¡T©#¥YÐ.Õ	/ñA1r   c                ó6  € V^ 8:  d   W. 3# \        V\        4      '       g   \        V4      p. pV\        P                  8X  g   V\        P                  8X  dI   VfE   \	        \        V4      WS,           4      pV P                  R8X  d   VRV pWR pEMƒW) R pVRV)  pEMvV\        P                  8X  Ed   \        P                  R\        P                  P                   R24       \        V4      V'       d   \        V4      M^ r˜\	        \        W˜,
          4      V4      p
W:,
          pW‰8”  d    W«^,          ,           pW»^,          ,
          pMV^,          pW«,           V^,          ,
          pV P                  R8X  d(   V^ 8”  d   VRV)  MTpV'       d   V^ 8”  d   VRV)  MTpMqWR pV'       d   W-R MRpM^V\        P                  8X  dJ   V'       dB   \	        \        V4      WS,           4      pV P                  R8X  d   W') R pVRV)  pM	VRV pW#R pWV3# )z8Truncates sequences according to the specified strategy.Nr  zmBe aware, overflowing tokens are not returned for the setting you have chosen, i.e. sequence pairs with the 'zg' truncation strategy. So the returned list will always be empty even if some tokens have been removed.r  )rÙ   r   Ú
ONLY_FIRSTr›  Úminr;   Útruncation_siderP   Úwarningr×   ÚabsÚONLY_SECOND)r   rt  rD  r–  r-  r/  r:  Ú
window_lenÚlen_idsÚlen_pairÚfirst_removeÚsecond_removeÚids_to_moveÚpair_ids_to_moves   &&&&&&        r   rž  Ú PythonBackend.truncate_sequencesÐ  s6  € ð   1Ô$Ø "Ð$Ð$äÐ-Ô/A×BÒBÜ"4Ð5HÓ"IÐàÐð Ô"4×"?Ñ"?Ô?ØÔ#5×#CÑ#CÔCÈÒHXäœS ›X vÕ'DÓEˆJØ×#Ñ# vÔ-Ø%(¨¨*Ð%5Ð"ØÐ/Ð0’à%(¨¨Ð%6Ð"ØÐ0Ð0Ð0Ð1’ð !Ô$6×$DÑ$DÕDÜ�N‰Nð2Ü2D×2RÑ2R×2XÑ2XÐ1Yð Z,ð,ôô !$ C£¿8¬#¨h¬-È�XÜœs 8Õ#5Ó6Ð8LÓMˆLØ0Õ?ˆMàÔ!Ø*¸aÕ-?Õ?�Ø#0ÀAÕ3EÕ#EÑ à+¨qÕ0�Ø#/Õ#?À=ÐTUÕCUÕ#VÐ à×#Ñ# wÔ.Ø,7¸!¬O�c˜-˜K˜<Ñ(À�ß;CÐHXÐ[\ÔH\˜8Ð$6Ð&6Ð%6Ñ7Ðbj‘à˜,Ð'�ß:B˜8Ð$5Ñ6È‘ð !Ô$6×$BÑ$BÔBÇxÜœS ›]¨FÕ,IÓJˆJØ×#Ñ# wÔ.Ø%-¨k¨lÐ%;Ð"Ø#Ð$:Ð&:Ð%:Ð;‘à%-¨k¨zÐ%:Ð"Ø#Ð$9Ð:�àÐ0Ð0Ð0r   c                ój   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          R,          RS[ S[,          /# rZ  r[  )r*   r+   s   "€r   r,   r¼     s6   ø€ ÷ >/ñ >/Ù¡�9ð>/Ù37¹µ9¸tÕ3Cð>/á	‰c�ñ>/r   c                óˆ  € V P                   '       dd   Vf    V P                  V4      p\        V4      p^ pM\V P                  W4      pV P                  V4      p\        V4      p\        V4      V,
          pM\        V4      pVe   \        V4      M^ pV P                  R8X  dd   \        \	        V R. 4      4      \        V4      ,           pVe   V\        V4      ,          pV\        \	        V R. 4      4      ,          p^ .V,          # V P
                  R8X  d   Ve   ^ .V,          ^.V,          ,           # ^ .WE,           ,          # )aÝ  
Create a mask from the two sequences passed to be used in a sequence-pair classification task.

This method dynamically builds the token type IDs based on the tokenizer's configuration attributes:
- `token_type_ids_pattern`: Pattern to use ("all_zeros" or "bert_style")
- `token_type_ids_include_special_tokens`: Whether to account for special tokens in length calculation

Args:
    token_ids_0 (`list[int]`):
        List of IDs.
    token_ids_1 (`list[int]`, *optional*):
        Optional second list of IDs for sequence pairs.

Returns:
    `list[int]`: Token type IDs according to the configured pattern.

Examples:
    ```python
    # All zeros pattern (default, used by RoBERTa, BART, etc.)
    tokenizer.token_type_ids_pattern = "all_zeros"
    # Returns: [0, 0, 0, ...] for both sequences

    # BERT-style pattern (first sequence gets 0s, second gets 1s)
    tokenizer.token_type_ids_pattern = "bert_style"
    # Returns: [0, 0, 0, ..., 1, 1, 1, ...] for sequence pairs
    ```
rb  rc  rd  r¨   )r©   r  r;   rª   ró   r§   )	r   r  r	  r¤  Úseq0_lenÚseq1_lenÚfull_sequenceÚseq0_with_specialr£  s	   &&&      r   rŸ  Ú2PythonBackend.create_token_type_ids_from_sequences  s0  € ð> ×5×5Ð5àÒ"Ø×@Ñ@ÀÓM�Ü˜x›=�Ø‘à $× EÑ EÀkÓ _�ð %)×$IÑ$IÈ+Ó$VÐ!ÜÐ0Ó1�Ü˜}Ó-°Õ8‘ô ˜;Ó'ˆHØ+6Ò+B”s˜;Ô'ÈˆHð ×&Ñ&¨/Ô9ÜœG D¨/¸2Ó>Ó?Ä#ÀkÓBRÕRˆIØÒ&ØœS Ó-Õ-�	ØœœW T¨?¸BÓ?Ó@Õ@ˆIØ�3˜•?Ð"à×&Ñ&¨,Ô6¸;Ò;Rà�3˜•> Q C¨(¥NÕ2Ð2ð �3˜(Õ-Õ.Ð.r   c                óN   <€ V ^8„  d   QhRS[ RS[ R,          RS[S[ R3,          /# )r&   Úsave_directoryÚfilename_prefixNr6   .)r)   r!   )r*   r+   s   "€r   r,   r¼   S  s3   ø€ ÷ :(ñ :(©cð :(ÁCÈ$ÅJð :(ÑZ_Ñ`cÐehÐ`hÕZiñ :(r   c                ód  € ^ RI p^ RIp\        V RR4      ;'       g    \        V RR4      pVf   R# VP                  P	                  V4      '       g   \
        P                  RV R24       R# \        V R/ 4      pV'       d   V R2MRpVP                  P                  WVP                  R	R
4      ,           4      p\        VRRR7      ;_uu_ 4       p	V	P                  VP                  V^RRR7      R,           4       RRR4       \        V RR4      p
V
f   V3# VP                  P                  WVP                  RR4      ,           4      p\        VRRR7      ;_uu_ 4       p\        V RR4      '       d   VP                  R4       ^ p\        V
P                  4       R R7       FV  w  rïWß8w  d   \
        P                  RV R24       TpVP                  RP                  V4      R,           4       V^,          pKX  	  RRR4       W‹3#   + '       g   i     EL; i  + '       g   i     Y‹3# ; i)at  
Default implementation for common vocabulary saving patterns.
Saves self.encoder/self.vocab as JSON, optionally with self.bpe_ranks as merges.
Returns empty tuple if no vocabulary exists.

Override this method if your tokenizer needs custom saving logic (e.g., SentencePiece models,
multiple vocabulary files, or special file formats).

Args:
    save_directory (`str`):
        The directory in which to save the vocabulary.
    filename_prefix (`str`, *optional*):
        An optional prefix to add to the named of the saved files.

Returns:
    `tuple[str, ...]`: Paths to the files saved, or empty tuple if no files saved.
NÚencoderÚvocabzVocabulary path (z) should be a directoryÚvocab_files_namesÚ-r   Ú
vocab_filez
vocab.jsonÚwzutf-8)ÚencodingTF)ÚindentÚ	sort_keysÚensure_asciir~   Ú	bpe_ranksÚmerges_filez
merges.txtÚadd_bpe_version_headerz#version: 0.2
c                 ó   € V ^,          # )é   rx   )Úkvs   &r   rÊ   Ú/PythonBackend.save_vocabulary.<locals>.<lambda>ƒ  s   € ÐTVÐWXÖTYr   rÌ   zSaving vocabulary to zZ: BPE merge indices are not consecutive. Please check that the tokenizer is not corrupted!r|   rx   )ÚjsonÚosró   ÚpathÚisdirrP   rQ   r‡  r  ÚopenÚwriteÚdumpsrÎ   r:   r¬  )r   r¿  rÀ  rÓ  rÔ  Ú
vocab_attrrÄ  rc   rÆ  ÚfrÌ  Ú
merge_fileÚwriterrÜ   Ú
bpe_tokensrý   s   &&&             r   Úsave_vocabularyÚPythonBackend.save_vocabularyS  sü  € ó$ 	Ûä˜T 9¨dÓ3×SÐS´w¸tÀWÈdÓ7Sˆ
ØÒØˆIà�w‰w�}‰}˜^×,Ò,Ü�L‰LÐ,¨^Ð,<Ð<SÐTÔUØˆIä# DÐ*=¸rÓBÐß*9�OÐ$ AÑ&¸rˆð —W‘W—\‘\ .Ð;L×;PÑ;PÐQ]Ð_kÓ;lÕ2lÓmˆ
Ü�*˜c¨G×4Õ4¸Ø�G‰G�D—J‘J˜z°!¸tÐRW�JÓXÐ[_Õ_Ô`÷ 5ô ˜D +¨tÓ4ˆ	ØÒØ�=Ð à—W‘W—\‘\ .Ð;L×;PÑ;PÐQ^Ð`lÓ;mÕ2mÓnˆ
Ü�*˜c¨G×4Õ4¸Ü�tÐ5°u×=Ò=Ø—‘Ð.Ô/àˆEÜ+1°)·/±/Ó2CÑIY×+ZÑ'�
ØÔ'Ü—N‘NØ/°
¨|ð <Mð Môð (�EØ—‘˜SŸX™X jÓ1°DÕ8Ô9Ø˜•
’ñ ,[÷ 5ð Ð'Ð'÷1 5×4Ð4ú÷ 5Ö4ð Ð'Ð'ús   Ã,H	Å!BHÈ	H	ÈH/	)r¥   r³   rª   r©   r§   r®   r¯   r¾   r^   )NF)FN)NTFFNrO   NNNNNFFFTF)NrO   Úlongest_firstrO   ))rT   rU   rV   rW   rX   r   ÚpropertyrÀ   rÏ   r¦   Úsetterrß   râ   rÛ   r´   rø   r
  r  r  r$  r"  r   rI  r   r�  rH  r  r  rm  r   rx  r  rˆ  r�  rK  rž  rŸ  rß  rY   rZ   ry   rz   s   @@r   r£   r£   �  s±  ù‡ € ñ
õ&
ðP ÷ó ðð ÷oó ðoð ÷Zó ðZð × Ñ ÷
(ó !ð
(÷	*ð 	*ò%ò6÷Lò L÷\,ò ,÷fò f÷.5ð 5òn"ò0ò"ð JNØ#'Ø,;×,FÑ,FØ2D×2TÑ2TØ!%ØØ$)Ø)-Ø#'Ø26Ø-1Ø-1Ø*/Ø+0Ø#Ø÷%I
ò I
÷Vò ÷0g-ò g-÷RNWõ NWð` ß\Ñ\ó Ø\àßhÑhó Øh÷!ò !÷F"ð "÷ ð  ÷ò ÷2lpò lp÷\A1ò A1÷F>/ò >/÷@:(÷ :(ò :(r   r£   )&rX   r�   r�   Úcollectionsr   Útypingr   r   Útokenization_utils_baser   r   r   r   r	   r
   r   r   Úutilsr   r   r   r   Ú
get_loggerrT   rP   ÚSPECIAL_TOKENS_MAP_FILEÚADDED_TOKENS_FILEÚTOKENIZER_CONFIG_FILEr   r\   r…   r‰   rŽ   r”   r—   r¡   r£   ÚPreTrainedTokenizerrx   r   r   Ú<module>rí     s¾   ðñó
 Û Ý #ß  ÷	÷ 	ó 	÷ LÓ Kð 
×	Ò	˜HÓ	%€ð 4Ð Ø'Ð Ø/Ð ÷dñ dôN8�Tô 8òv	ò	òòaòdõ
4ñ Ð,Ó-ô}(Ð+ó }(ó .ð}(ðB  $Ò r   