+
    QV-jÎ  ã                   ó„   € ^ RI t ^ RIt^ RIHtHtHtHtHt ^ RIH	t	H
t
HtHtHtHtHt ^ RIHt ^RIHt  ! R R]4      tR# )é    N)ÚIteratorÚListÚOptionalÚUnionÚTuple)Ú
AddedTokenÚRegexÚ	TokenizerÚdecodersÚnormalizersÚpre_tokenizersÚtrainers)ÚUnigram)ÚBaseTokenizerc                   óŽ   a a€ ] tR t^t oRtRV3R lV 3R l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4       t	R
t
VtV ;t# )ÚSentencePieceUnigramTokenizerzrSentencePiece Unigram Tokenizer

Represents the Unigram algorithm, with the pretokenization used by SentencePiece
c                ób   <€ V ^8„  d   QhRS[ S[S[S[S[3,          ,          ,          RS[RS[/# )é   ÚvocabÚreplacementÚadd_prefix_space)r   r   r   ÚstrÚfloatÚbool)ÚformatÚ__classdict__s   "€Ú�/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/tokenizers/implementations/sentencepiece_unigram.pyÚ__annotate__Ú*SentencePieceUnigramTokenizer.__annotate__   s<   ø€ ÷ 0ñ 0á™™U¡3© :Õ.Õ/Õ0ð0ñ ð0ñ ñ	0ó    c           	     óÚ  <€ Ve   \        \        V4      4      pM\        \        4       4      p\        P                  ! \        P                  ! 4       \        P
                  ! 4       \        P                  ! \        R4      R4      .4      Vn        V'       d   RMRp\        P                  ! W%R7      Vn        \        P                  ! W%R7      Vn        RRRVR	V/p\        SV `=  WF4       R # )
Nú {2,}Ú ÚalwaysÚnever©r   Úprepend_schemeÚmodelÚSentencePieceUnigramr   r   )r
   r   r   ÚSequenceÚNmtÚNFKCÚReplacer	   Ú
normalizerr   Ú	MetaspaceÚpre_tokenizerr   ÚdecoderÚsuperÚ__init__)Úselfr   r   r   Ú	tokenizerr'   Ú
parametersÚ	__class__s   &&&&   €r   r3   Ú&SentencePieceUnigramTokenizer.__init__   s¾   ø€ ð Òä!¤'¨%£.Ó1‰Iä!¤'£)Ó,ˆIä*×3Ò3Ü�_Š_Ó¤× 0Ò 0Ó 2´K×4GÒ4GÌÈgËÐX[Ó4\Ð]ó 
ˆ	Ô÷ &6™¸7ˆÜ"0×":Ò":À{Ô"rˆ	ÔÜ$×.Ò.¸;Ôfˆ	Ôð Ð+Ø˜;ØÐ 0ð
ˆ
ô 	‰Ñ˜Ö/r    c                óÊ   <€ V ^8„  d   QhRS[ S[S[S[,          3,          RS[RS[RS[S[S[ S[S[3,          ,          ,          RS[S[S[,          ,          RS[S[,          /# )r   ÚfilesÚ
vocab_sizeÚshow_progressÚspecial_tokensÚinitial_alphabetÚ	unk_token)r   r   r   Úintr   r   r   )r   r   s   "€r   r   r   ,   st   ø€ ÷ .6ñ .6á‘S™$™s�)�^Õ$ð.6ñ ð.6ñ ð	.6ñ
 !¡¡e©C±¨OÕ&<Õ!=Õ>ð.6ñ #¡4©¥9Õ-ð.6ñ ™C•=ñ.6r    c                ó¾   € Vf   . pVf   . p\         P                  ! VVVVVR7      p\        V\        4      '       d   V.pV P                  P                  WR7       R# )a1  
Train the model using the given files

Args:
    files (:obj:`List[str]`):
        A list of path to the files that we should use for training
    vocab_size (:obj:`int`):
        The size of the final vocabulary, including all tokens and alphabet.
    show_progress (:obj:`bool`):
        Whether to show progress bars while training.
    special_tokens (:obj:`List[Union[str, AddedToken]]`, `optional`):
        A list of special tokens the model should know of.
    initial_alphabet (:obj:`List[str]`, `optional`):
        A list of characters to include in the initial alphabet, even
        if not seen in the training dataset.
        If the strings contain more than one character, only the first one
        is kept.
    unk_token (:obj:`str`, `optional`):
        The unknown token to be used by the model.
N©r;   r=   r<   r>   r?   )Útrainer)r   ÚUnigramTrainerÚ
isinstancer   Ú
_tokenizerÚtrain)r4   r:   r;   r<   r=   r>   r?   rC   s   &&&&&&& r   rG   Ú#SentencePieceUnigramTokenizer.train,   se   € ð< Ò!ØˆNàÒ#Ø!Ðä×)Ò)Ø!Ø)Ø'Ø-Øô
ˆô �eœS×!Ò!Ø�GˆEØ�‰×Ñ˜eÐÖ5r    c                ó   <€ V ^8„  d   QhRS[ S[S[,          S[S[S[,          ,          3,          RS[RS[RS[S[S[ S[S[3,          ,          ,          RS[S[S[,          ,          RS[S[,          RS[S[,          /# )r   Úiteratorr;   r<   r=   r>   r?   Úlength)r   r   r   r@   r   r   r   r   )r   r   s   "€r   r   r   \   sŒ   ø€ ÷ 4
ñ 4
á™¡�¡x±¹µÕ'>Ð>Õ?ð4
ñ ð4
ñ ð	4
ñ
 !¡¡e©C±¨OÕ&<Õ!=Õ>ð4
ñ #¡4©¥9Õ-ð4
ñ ™C•=ð4
ñ ™•ñ4
r    c                ó�   € Vf   . pVf   . p\         P                  ! VVVVVR7      pV P                  P                  VVVR7       R# )aå  
Train the model using the given iterator

Args:
    iterator (:obj:`Union[Iterator[str], Iterator[Iterator[str]]]`):
        Any iterator over strings or list of strings
    vocab_size (:obj:`int`):
        The size of the final vocabulary, including all tokens and alphabet.
    show_progress (:obj:`bool`):
        Whether to show progress bars while training.
    special_tokens (:obj:`List[Union[str, AddedToken]]`, `optional`):
        A list of special tokens the model should know of.
    initial_alphabet (:obj:`List[str]`, `optional`):
        A list of characters to include in the initial alphabet, even
        if not seen in the training dataset.
        If the strings contain more than one character, only the first one
        is kept.
    unk_token (:obj:`str`, `optional`):
        The unknown token to be used by the model.
    length (:obj:`int`, `optional`):
        The total number of sequences in the iterator. This is used to
        provide meaningful progress tracking
NrB   )rC   rK   )r   rD   rF   Útrain_from_iterator)	r4   rJ   r;   r<   r=   r>   r?   rK   rC   s	   &&&&&&&& r   rM   Ú1SentencePieceUnigramTokenizer.train_from_iterator\   s]   € ðD Ò!ØˆNàÒ#Ø!Ðä×)Ò)Ø!Ø)Ø'Ø-Øô
ˆð 	�‰×+Ñ+ØØØð 	,ö 	
r    c                ó    <€ V ^8„  d   QhRS[ /# )r   Úfilename)r   )r   r   s   "€r   r   r   “   s   ø€ ÷ 1ñ 1™3ñ 1r    c                ó|  €  ^ RI pVP                  P                  R4       ^ RIpTP                  4       pTP                  \        T R4      P                  4       4       TP                  P                  pTP                   Uu. uF  qUP                  TP                  3NK  	  ppTP                  P                  pTP                  P                   pTP                  P"                  p	T^8w  d   \	        R4      hRp
Rp\%        \'        YgT	4      4      pT'       dQ   \(        P*                  ! \(        P,                  ! T4      \(        P.                  ! \1        R4      R	4      .4      Tn        M:\(        P*                  ! \(        P.                  ! \1        R4      R	4      .4      Tn        T'       d   R
MRp\4        P6                  ! Y­R7      Tn        \:        P6                  ! Y­R7      Tn        RR/p\>        P@                  ! \B        YÎ4      p\>        PD                  ! YüT4       T#   \         d    \	        R4      hi ; iu upi )r   NÚ.a\  You don't seem to have the required protobuf file, in order to use this function you need to run `pip install protobuf` and `wget https://raw.githubusercontent.com/google/sentencepiece/master/python/src/sentencepiece/sentencepiece_model_pb2.py` for us to be able to read the intrinsics of your spm_file. `pip install sentencepiece` is not required.Úrbz]You're trying to run a `Unigram` model but you're file was trained with a different algorithmõ   â–�Tr"   r#   r$   r%   r&   r(   r)   )#ÚsysÚpathÚappendÚsentencepiece_model_pb2Ú	ExceptionÚ
ModelProtoÚParseFromStringÚopenÚreadÚnormalizer_specÚprecompiled_charsmapÚpiecesÚpieceÚscoreÚtrainer_specÚunk_idÚ
model_typeÚbyte_fallbackr
   r   r   r*   ÚPrecompiledr-   r	   r.   r   r/   r0   r   r1   r   Ú__new__r   r3   )rP   rU   r(   Úmr_   ra   r   rd   re   rf   r   r   r5   r'   r6   Úobjs   &               r   Úfrom_spmÚ&SentencePieceUnigramTokenizer.from_spm’   sÝ  € ð		Ûà�H‰H�O‰O˜CÔ ã3ð ×ÑÓˆØ	×Ñœ$˜x¨Ó.×3Ñ3Ó5Ô6à ×0Ñ0×EÑEÐØ9:¿ºÓB¹°—+‘+˜uŸ{™{Ó+¹ˆÐBØ—‘×&Ñ&ˆØ—^‘^×.Ñ.ˆ
ØŸ™×4Ñ4ˆØ˜Œ?ÜØoóð ð ˆØÐäœg e°]ÓCÓDˆ	çÜ#.×#7Ò#7ä×+Ò+Ð,@ÓAÜ×'Ò'¬¨g«¸Ó<ðó$ˆIÕ ô $/×#7Ò#7¼×9LÒ9LÌUÐSZË^Ð]`Ó9aÐ8bÓ#cˆIÔ ß%5™¸7ˆÜ"0×":Ò":À{Ô"rˆ	ÔÜ$×.Ò.¸;Ôfˆ	Ôð Ð+ð
ˆ
ô ×#Ò#Ô$AÀ9ÓYˆÜ×Ò˜s¨zÔ:Øˆ
øôU ô 	Üð oóð ð	üò Cs   ‚#H Â H9ÈH6© )NrT   T)é@  TNNN)rn   TNNNN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r3   rG   rM   Ústaticmethodrk   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r7   r   s   @@r   r   r      sC   ù‡ € ñ÷
0õ 0÷6.6ò .6÷`4
ò 4
ðl ÷1ó ÷1ð 1r    r   )ÚjsonÚosÚtypingr   r   r   r   r   Ú
tokenizersr   r	   r
   r   r   r   r   Útokenizers.modelsr   Úbase_tokenizerr   r   rm   r    r   Ú<module>r~      s.   ðÛ Û 	ß 9Õ 9ç d× dÑ dÝ %å )ôy Mö yr    