
    	 @g&                    @   U d dl mZ ddlmZ ddlmZ ddddddddZded<   i d	dd
dddddddddddddddddddddddddddddddi ddddddddd dd!d"d#d"d$dd%dd&dd'dd(dd)dd*dd+dd,dd-dd.d.iZded/<   d7d3Z	d8d5Z
d6S )9    )annotations   )Encoding)get_encodingcl100k_base)zgpt-4-zgpt-3.5-turbo-zgpt-35-turbo-zft:gpt-4zft:gpt-3.5-turbozft:davinci-002zft:babbage-002zdict[str, str]MODEL_PREFIX_TO_ENCODINGzgpt-4zgpt-3.5-turbozgpt-35-turbozdavinci-002zbabbage-002ztext-embedding-ada-002ztext-davinci-003	p50k_baseztext-davinci-002ztext-davinci-001	r50k_baseztext-curie-001ztext-babbage-001ztext-ada-001davincicuriebabbageadazcode-davinci-002zcode-davinci-001zcode-cushman-002zcode-cushman-001zdavinci-codexzcushman-codexztext-davinci-edit-001	p50k_editzcode-davinci-edit-001ztext-similarity-davinci-001ztext-similarity-curie-001ztext-similarity-babbage-001ztext-similarity-ada-001ztext-search-davinci-doc-001ztext-search-curie-doc-001ztext-search-babbage-doc-001ztext-search-ada-doc-001zcode-search-babbage-code-001zcode-search-ada-code-001gpt2MODEL_TO_ENCODING
model_namestrreturnc                    d}| t           v rt           |          }n8t                                          D ]\  }}|                     |          r|c S |t	          d|  d          d|S )zrReturns the name of the encoding used by a model.

    Raises a KeyError if the model name is not recognised.
    NzCould not automatically map z_ to a tokeniser. Please use `tiktoken.get_encoding` to explicitly get the tokeniser you expect.)r   r   items
startswithKeyError)r   encoding_namemodel_prefixmodel_encoding_names       B/var/www/piapp/venv/lib/python3.11/site-packages/tiktoken/model.pyencoding_name_for_modelr   C   s    
 M&&&)*5
 2J1O1O1Q1Q 	+ 	+-L-$$\22 +****+ ]: ] ] ]
 
 	
     r   c                :    t          t          |                     S )zfReturns the encoding used by a model.

    Raises a KeyError if the model name is not recognised.
    )r   r   )r   s    r   encoding_for_modelr    \   s    
 /
;;<<<r   N)r   r   r   r   )r   r   r   r   )
__future__r   corer   registryr   r   __annotations__r   r   r     r   r   <module>r&      s   " " " " " " "       " " " " " "
 #"%##
, 
,  
 
 
 
-%]-% ]-% M	-% =-% =-% m-% -% -% -% k-%  !-%" K#-%$ {%-%& ['-%( {)-%* 
;+-%. /-% -%0 1-%2 3-%4 5-%6 [7-%8 [9-%< [=-%> [?-%B ";C-%D  E-%F ";G-%H {I-%J ";K-%L  M-%N ";O-%P {Q-%R #KS-%T U-% -%X FY-% -%  - - - -`   2= = = = = =r   