Ë
    GêñiÉ  ã                   óH   — d dl mZ d dlmZ d dlmZ d dlmZmZ dede	fd„Z
y)	é    )ÚPath)ÚAny)ÚTikTokenConverter)ÚTIKTOKEN_VOCAB_FILEÚTOKENIZER_FILEÚencodingÚ
output_dirc                 ó„  — t        |«      }|j                  d¬«       |dz  t        z  }|t        z  }|j                  j                  dd¬«       t        |j                  «       «      }t        |j                  «       «      }	 ddlm} ddl	m
} t        | t
        «      r || «      }  || j                  |«       t!        || j"                  | j$                  ¬«      j'                  «       }
|
j)                  |«       y# t        $ r:}t        |«      }	d|	j                  «       v rt        d	«      |‚t        d
«      |‚d}~ww xY w)a»  
    Converts given `tiktoken` encoding to `PretrainedTokenizerFast` and saves the configuration of converted tokenizer
    on disk.

    Args:
        encoding (`str` or `tiktoken.Encoding`):
            Tokenizer from `tiktoken` library. If `encoding` is `str`, the tokenizer will be loaded with
            `tiktoken.get_encoding(encoding)`.
        output_dir (`str`):
            Save path for converted tokenizer configuration file.
    T)Úexist_okÚtiktoken)Úparentsr   r   )Úget_encoding)Údump_tiktoken_bpeÚblobfilezY`blobfile` is required to save a `tiktoken` file. Install it with `pip install blobfile`.zY`tiktoken` is required to save a `tiktoken` file. Install it with `pip install tiktoken`.N)Ú
vocab_fileÚpatternÚextra_special_tokens)r   Úmkdirr   r   ÚparentÚstrÚabsoluter   r   Útiktoken.loadr   Ú
isinstanceÚ_mergeable_ranksÚImportErrorÚlowerÚ
ValueErrorr   Ú_pat_strÚ_special_tokensÚ	convertedÚsave)r   r	   Ú	save_fileÚtokenizer_fileÚsave_file_absoluteÚoutput_file_absoluter   r   ÚeÚ	error_msgÚ	tokenizers              úd/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/transformers/integrations/tiktoken.pyÚconvert_tiktoken_to_fastr*      s7  € ô �jÓ!€JØ×Ñ˜dÐÔ#à˜ZÑ'Ô*=Ñ=€IØ¤.Ñ0€Nð ×Ñ×Ñ 4°$ÐÔ7ä˜Y×/Ñ/Ó1Ó2ÐÜ˜~×6Ñ6Ó8Ó9ÐðÝ)Ý3ä�h¤Ô$Ù# HÓ-ˆHá˜(×3Ñ3Ð5GÔHô "Ø%¨x×/@Ñ/@ÐW_×WoÑWoôç�iƒkð ð ‡N�NÐ'Õ(øô ò Ü˜“Fˆ	Ø˜Ÿ™Ó*Ñ*ÜØkóàðô Øgó
àð	ûðús   Â7C< Ã<	D?Ä5D:Ä:D?N)Úpathlibr   Útypingr   Ú#transformers.convert_slow_tokenizerr   Ú*transformers.tokenization_utils_tokenizersr   r   r   r*   © ó    r)   ú<module>r1      s$   ðÝ Ý å Aß Zð-) sð -)¸ô -)r0   