
    
`iM                         d dl mZmZmZ ddlmZ erd dlZdddddddee         d	ee         d
eee                  def
dZ	dS )    )ListOptionalTYPE_CHECKING   )LLTokenizerN)n_vocab	eos_tokenslicesencodingztiktoken.Encodingr   r	   r
   returnc                f    t          j        | j        | j        | j        || j        n|||          S )a  
    Create a new tokenizer from a tiktoken Encoding object.
    This is an expensive operation (~1s), so the result should be cached.

    Args:
        encoding: tiktoken.Encoding - the encoding object to use
        n_vocab: int - override the size of the vocabulary
        eos_token: int - override the EOS token
        slices: List[str] - configuration for slicer optimization; pass [] to disable,
            or None to use the default configuration
    N)encoderspecial_tokenspatternr	   r   r
   )r   from_tiktoken_mergeable_ranks_special_tokens_pat_str	eot_token)r   r   r	   r
   s       g/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/llguidance/tiktoken.pylltokenizer_from_encodingr   	   sF    & $)/!(1(9($$y       )
typingr   r   r   _libr   tiktokenintstrr    r   r   <module>r      s    0 0 0 0 0 0 0 0 0 0       OOO "#"&  ! c] }	
 T#Y      r   