+
    œ°³jh$  ã                   óä   € R t ^ RIt^ RIt^ RIt^ RIHt ^RIHt ^RIH	t	H
t
HtHt ]	! 4       '       d   ^ RIt]
! 4       '       d   ^ RIt]P                   ! ]4      tRR/tR t ! R R	]4      tR	.tR# )
zTokenization class for VITS.N)ÚAny)ÚPreTrainedTokenizer)Úis_phonemizer_availableÚis_uroman_availableÚloggingÚrequires_backendsÚ
vocab_filez
vocab.jsonc                 ó\   € \         P                  ! R 4      pVP                  V 4      pVRJpV# )z[^\x00-\x7F]N)ÚreÚcompileÚsearch)Úinput_stringÚnon_roman_patternÚmatchÚhas_non_romans   &   Úk/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/vits/tokenization_vits.pyÚhas_non_roman_charactersr   $   s3   € äŸ
š
 ?Ó3Ðð ×$Ñ$ \Ó2€EØ Ð%€MØÐó    c                   óÐ   a a€ ] tR t^.t oRt]tRR.tRV3R lV 3R lllt]	R 4       t
R tR tR	 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 tR tRV3R lR lltRtVtV ;t# )ÚVitsTokenizera|  
Construct a VITS tokenizer. Also supports MMS-TTS.

This tokenizer inherits from [`PreTrainedTokenizer`] which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.

Args:
    vocab_file (`str`):
        Path to the vocabulary file.
    language (`str`, *optional*):
        Language identifier.
    add_blank (`bool`, *optional*, defaults to `True`):
        Whether to insert token id 0 in between the other tokens.
    normalize (`bool`, *optional*, defaults to `True`):
        Whether to normalize the input text by removing all casing and punctuation.
    phonemize (`bool`, *optional*, defaults to `True`):
        Whether to convert the input text into phonemes.
    is_uroman (`bool`, *optional*, defaults to `False`):
        Whether the `uroman` Romanizer needs to be applied to the input text prior to tokenizing.
Ú	input_idsÚattention_maskc                ó   <€ V ^8„  d   QhRR/# )é   ÚreturnN© )ÚformatÚ__classdict__s   "€r   Ú__annotate__ÚVitsTokenizer.__annotate__G   s   ø€ ÷ !
ñ !
ð 
ñ!
r   c	                óŽ  <€ \        VR R7      ;_uu_ 4       p
\        P                  ! V
4      V n        RRR4       V P                  P	                  4        UUu/ uF  w  r¼WËbK	  	  uppV n        W@n        WPn        W`n        Wpn	        W€n
        \        SV `0  ! RRVRVRVRVRVRVR	VR
R/V	B  R#   + '       g   i     Lƒ; iu uppi )úutf-8©ÚencodingNÚ	pad_tokenÚ	unk_tokenÚlanguageÚ	add_blankÚ	normalizeÚ	phonemizeÚ	is_uromanÚspecial_tokens_patternÚnoner   )ÚopenÚjsonÚloadÚencoderÚitemsÚdecoderr&   r'   r(   r)   r*   ÚsuperÚ__init__)Úselfr   r$   r%   r&   r'   r(   r)   r*   ÚkwargsÚvocab_handleÚkÚvÚ	__class__s   &&&&&&&&&,   €r   r4   ÚVitsTokenizer.__init__G   sÝ   ø€ ô �* w×/Õ/°<ÜŸ9š9 \Ó2ˆDŒL÷ 0ð *.¯©×);Ñ);Ô)=Ô>Ñ)=¡ ˜šÑ)=Ò>ˆŒØ ŒØ"ŒØ"ŒØ"Œà"Œä‰Òñ 
	
Øð
	
àð
	
ð ð
	
ð  ð	
	
ð
  ð
	
ð  ð
	
ð  ð
	
ð $*ð
	
ð ô
	
÷ 0×/üó ?s   —B.ÁCÂ.B>	c                ó,   € \        V P                  4      # ©N)Úlenr0   )r5   s   &r   Ú
vocab_sizeÚVitsTokenizer.vocab_sizej   s   € ä�4—<‘<Ó Ð r   c                ó¬   € \        V P                  4       Uu/ uF  qP                  V4      VbK  	  ppVP                  V P                  4       V# u upi r=   )Úranger?   Úconvert_ids_to_tokensÚupdateÚadded_tokens_encoder)r5   ÚiÚvocabs   &  r   Ú	get_vocabÚVitsTokenizer.get_vocabn   sL   € Ü;@ÀÇÁÔ;QÓRÑ;Q°a×+Ñ+¨AÓ.°Ò1Ñ;QˆÐRØ�‰�T×.Ñ.Ô/Øˆùò Ss   ˜Ac                ó¬  € \        V P                  P                  4       4      \        V P                  P                  4       4      ,           pRp^ pV\	        V4      8  du   RpV F:  pWV\	        V4      ,            V8X  g   K  W6,          pV\	        V4      ,          pRp M	  V'       d   K\  W1V,          P                  4       ,          pV^,          pK„  V# )zfLowercase the input string, respecting any special token ids that may be part or entirely upper-cased.Ú FT)Úlistr0   ÚkeysrE   r>   Úlower)r5   r   Úall_vocabularyÚfiltered_textrF   Úfound_matchÚwords   &&     r   Únormalize_textÚVitsTokenizer.normalize_texts   sµ   € ä˜dŸl™l×/Ñ/Ó1Ó2´T¸$×:SÑ:S×:XÑ:XÓ:ZÓ5[Õ[ˆØˆàˆØ”#�lÓ#Ô#ØˆKÛ&�Ø A¬¨D«	¥MÐ2°dÖ:Ø!Õ)�MØœ˜T›•N�AØ"&�KÙñ '÷ ‘;Ø¨a¥×!6Ñ!6Ó!8Õ8�Ø�Q•’àÐr   c                óL   € V P                   R8X  d   VP                  RR4      pV# )z4Special treatment of characters in certain languagesÚronu   È›u   Å£)r&   Úreplace)r5   Útexts   &&r   Ú_preprocess_charÚVitsTokenizer._preprocess_charˆ   s#   € à�=‰=˜EÔ!Ø—<‘<  dÓ+ˆDØˆr   c                ól   <€ V ^8„  d   QhRS[ RS[RS[R,          RS[S[ S[S[ S[3,          3,          /# )r   rX   Úis_split_into_wordsr(   Nr   )ÚstrÚboolÚtupleÚdictr   )r   r   s   "€r   r   r   Ž   sC   ø€ ÷ >%ñ >%Ùð>%Ù.2ð>%ÙGKÈdÅ{ð>%á	‰s‘D™™c˜•NÐ"Õ	#ñ>%r   c           	     óˆ  a € Ve   TMS P                   pV'       d   S P                  V4      pS P                  V4      p\        V4      '       d_   S P                  '       dM   \        4       '       g   \        P                  R4       M&\        P                  ! 4       pVP                  V4      pS P                  '       dE   \        S R.4       \        P                  ! VRRRRRR7      p\        P                  ! RRV4      pWT3# V'       d7   R	P!                  \#        \%        V 3R
 lV4      4      4      P'                  4       pWT3# )am  
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.
    normalize (`bool`, *optional*, defaults to `None`):
        Whether or not to apply punctuation and casing normalization to the text inputs. Typically, VITS is
        trained on lower-cased and un-punctuated text. Hence, normalization is used to ensure that the input
        text consists only of lower-case characters.
    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.
aC  Text to the tokenizer contains non-Roman characters. To apply the `uroman` pre-processing step automatically, ensure the `uroman` Romanizer is installed with: `pip install uroman` Note `uroman` requires python version >= 3.10Otherwise, apply the Romanizer manually as per the instructions: https://github.com/isi-nlp/uromanÚ
phonemizerzen-usÚespeakT)r&   ÚbackendÚstripÚpreserve_punctuationÚwith_stressz\s+Ú rK   c                 ó"   <€ V SP                   9   # r=   )r0   )Úcharr5   s   &€r   Ú<lambda>Ú8VitsTokenizer.prepare_for_tokenization.<locals>.<lambda>Ê   s   ø€ ¸TÀTÇ\Á\Ò=Qr   )r(   rS   rY   r   r*   r   ÚloggerÚwarningÚurÚUromanÚromanize_stringr)   r   rb   r
   ÚsubÚjoinrL   Úfilterre   )r5   rX   r\   r(   r6   rP   Úuromans   f&&&,  r   Úprepare_for_tokenizationÚ&VitsTokenizer.prepare_for_tokenizationŽ   s  ø€ ð4 "+Ò!6‘I¸D¿N¹Nˆ	çà×&Ñ& tÓ,ˆDà×-Ñ-¨dÓ3ˆä# M×2Ò2°t·~·~°~Ü&×(Ò(Ü—‘ðyõô Ÿš›�Ø &× 6Ñ 6°}Ó E�à�>�>ˆ>Ü˜d \ NÔ3ä&×0Ò0ØØ Ø ØØ%)Ø ôˆMô ŸFšF 6¨3°Ó>ˆMð
 Ð$Ð$÷	 àŸG™G¤D¬Ô0QÐS`Ó)aÓ$bÓc×iÑiÓkˆMàÐ$Ð$r   c                ó6   <€ V ^8„  d   QhRS[ RS[S[ ,          /# )r   rX   r   )r]   rL   )r   r   s   "€r   r   r   Î   s   ø€ ÷ 	ñ 	™cð 	¡d©3¥iñ 	r   c                ó¬   € \        V4      pV P                  '       d7   V P                  ^ 4      .\        V4      ^,          ^,           ,          pW#R&   TpV# )z]Tokenize a string by inserting the `<pad>` token at the boundary between adjacent characters.ºé   Nr   )rL   r'   Ú_convert_id_to_tokenr>   )r5   rX   ÚtokensÚintersperseds   &&  r   Ú	_tokenizeÚVitsTokenizer._tokenizeÎ   sK   € ä�d“ˆà�>�>ˆ>Ø ×5Ñ5°aÓ8Ð9¼SÀ»[È1½_ÈqÕ=PÕQˆLØ!'˜ÑØ!ˆFàˆr   c                ó6   <€ V ^8„  d   QhRS[ S[,          RS[/# )r   r}   r   )rL   r]   )r   r   s   "€r   r   r   Ù   s   ø€ ÷ ñ ©t±C­yð ¹Sñ r   c                óz   € V P                   '       d   \        V4      ^8”  d
   VR,          pRP                  V4      # )r{   rz   rK   )r'   r>   rs   )r5   r}   s   &&r   Úconvert_tokens_to_stringÚ&VitsTokenizer.convert_tokens_to_stringÙ   s,   € Ø�>�>ˆ>œc &›k¨AœoØ˜D•\ˆFØ�w‰w�v‹Ðr   c                ó`   € WP                   9   d   V P                   V,          # V P                  # )z0Converts a token (str) in an id using the vocab.)r0   Úunk_token_id)r5   Útokens   &&r   Ú_convert_token_to_idÚ"VitsTokenizer._convert_token_to_idÞ   s'   € à—L‘LÔ Ø—<‘< Õ&Ð&Ø× Ñ Ð r   c                ó8   € V P                   P                  V4      # )z=Converts an index (integer) in a token (str) using the vocab.)r2   Úget)r5   Úindexs   &&r   r|   Ú"VitsTokenizer._convert_id_to_tokenä   s   € à�|‰|×Ñ Ó&Ð&r   c                óX   <€ V ^8„  d   QhRS[ RS[ R,          RS[S[ ,          R,          /# )r   Úsave_directoryÚfilename_prefixNr   )r]   r_   )r   r   s   "€r   r   r   è   s3   ø€ ÷ ñ ©cð ÁCÈ$ÅJð ÑZ_Ñ`cÕZdÐgkÕZkñ r   c                óè  € \         P                  P                  V4      '       g   \        P	                  R V R24       R# \         P                  P                  Y'       d
   VR,           MR\        R,          ,           4      p\        VRRR7      ;_uu_ 4       pVP                  \        P                  ! V P                  ^R	R
R7      R,           4       RRR4       V3#   + '       g   i     T3# ; i)zVocabulary path (z) should be a directoryNÚ-rK   r   Úwr!   r"   TF)ÚindentÚ	sort_keysÚensure_asciiÚ
)ÚosÚpathÚisdirrm   Úerrorrs   ÚVOCAB_FILES_NAMESr-   Úwriter.   Údumpsr0   )r5   r�   r�   r   Úfs   &&&  r   Úsave_vocabularyÚVitsTokenizer.save_vocabularyè   s·   € Ü�w‰w�}‰}˜^×,Ò,Ü�L‰LÐ,¨^Ð,<Ð<SÐTÔUÙä—W‘W—\‘\Ø¶o˜_¨sÖ2È2ÔQbÐcoÕQpÕpó
ˆ
ô �*˜c¨G×4Õ4¸Ø�G‰G”D—J’J˜tŸ|™|°AÀÐTYÔZÐ]aÕaÔb÷ 5ð ˆ}Ð÷ 5Ö4ð ˆ}Ðús   Â;CÃC1	)r'   r2   r0   r*   r&   r(   r)   )z<pad>z<unk>NTTTF)FNr=   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rœ   Úvocab_files_namesÚmodel_input_namesr4   Úpropertyr?   rH   rS   rY   rv   r   rƒ   rˆ   r|   r    Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r:   r   s   @@r   r   r   .   s„   ù‡ € ñð* *ÐØ$Ð&6Ð7Ð÷!
õ !
ðF ñ!ó ð!òò
ò*÷>%ò >%÷@	ð 	÷ð ò
!ò'÷÷ ò r   r   )r¦   r.   r˜   r
   Útypingr   Útokenization_pythonr   Úutilsr   r   r   r   rb   ru   ro   Ú
get_loggerr¢   rm   rœ   r   r   Ú__all__r   r   r   Ú<module>r²      ss   ðñ #ã Û 	Û 	Ý å 6ß ]Ó ]ñ ×ÒÛá×ÒÛà	×	Ò	˜HÓ	%€à! <Ð0Ð òôFÐ'ô FðR Ð
‚r   