o
    wiB                     @   sl  d Z ddlZddlZddlZddlZddlmZ ddlmZm	Z	m
Z
 ddlmZ ddlmZmZ ddlmZ dd	lmZ dd
lmZ ddlmZmZmZmZmZmZ ddlmZ ddlm Z  ddl!m"Z"m#Z#m$Z$m%Z%m&Z& e rvddl'm(Z( ndZ(e)e*Z+ee,e-e	e, e	e, f f g de rdnde rdndffdde rdndffdde rdndffdde rdndffdde rdndffdde rdndffdd e rd!nde rd"ndffd#d$de rdndffd%e rd&nddffd'd(d)e rd*nde rd+ndffd,d-e rd.ndffd/d0de r(d1ndffd2d3d4de r8dndffd5d6e rDd7ndffd8de rPd9ndffd:d;e r\d<ndffd=de rhdndffd>d?e rud@nde r|dAndffdBdCe rdnde rdndffdDde rdndffdEd;e rd<ndffdFdGe rdHndffdIdGe rdHndffdJdKe rdLnde rdMndffdNdOe rdPndffdQde rdndffdRde rdndffdSde rdndffdTdUe rdVndffdWdXe rdYndffdZe r'd[nde r.d\ndffd]d^d_d`d;e r@d<ndffdad6e rLd7ndffdbdce rXddndffdee rcdfnde rjdgndffdhe rudnde r|dndffdidje rdnde rdndffdkdle rdmndffdndoe rdpndffdqdre rdsndffdtd6e rd7ndffdude rdndffdve rdwnddffdxdyde rd1ndffdzde rd{ndffd|e rd}nddffd~dde rdndffddde rdndffde r%dnde r,dndffde r7dnde r>dndffde rIdnde rPdndffde r[dnde rbdndffde rmdnde rtdndffde rdnde rdndffdde rdndffdde rd1ndffdde rd1ndffdde rd1ndffde rdnddffdd6e rd7ndffdd6e rd7ndffdd6e rd7ndffdde rd{ndffddd6e r d7ndffddddddde rdndffddGe r"dHndffdde r.d1ndffdde r:dndffddd;e rHd<ndffdde rTdndffdde r`dndffdde rldndffdd6e rxd7ndffdd6e rd7ndffddUe rdVndffde rdnde rdndffdde rdndffde rdnde rdndffdde rdnde rdndffdde rdndffdde rdndffdde rdndffdde rdndffdde rdndffdde rdndffde r'dnde r.dndffde r9dnde r@dndffde rKdnde rRdndffdde r^dndffdde rjdndffdde rvdndffdde rdndffdde rdndffde rdnde rdndffdёdde rdndffde rdnddffdde rd{ndffdde rd{ndffde rdnddffde rdnde rdndffde rdnde rdndffdd;e rd<ndffdde rdndffdde r'd6nde r.d7ndffde r9dnde r@dndffde rKdnde rRdndffdde r^dndffde ridnddffdde rvdndffdde rd1ndffdde rd1ndffdde rd1ndffdde rdndffdde rd{ndffdd;e rd<ndffde rdnde rdndffdde rdndffdde rdndffdde rdndffddde rd1ndffdde rdndffd e rdnde r#dndffde r0dnde r8dndffde rDdnde rKdndffdde rXd{ndffdde red{ndffdde rrd{ndffddGe rdHndffd	dGe rdHndffd
de rdndffdd6e rd7ndffddGe rdHndffddGe rdHndffdde rdndffde rd-nde rd.ndffde rd-nde rd.ndffdde rdnde rdndffddOe rdPndffdde r%dndffdde r2dndffddde rBdndffdde rOd1ndffde r\dnddffddde rmdndffddUe rzdVndffd dUe rdVndffd!dUe rdVndffd"dUe rdVndffd#dUe rdVndffd$dUe rdVndffd%dUe rdVndffd&dUe rdVndffd'd(d)e rd*ndffd+e rdnde rdndffd,e 	rd-nde 	rd.ndffd/e 	rd0nde 	r$d1ndffd2d3e 	r3d4ndffd5d;e 	r@d<ndffd6d;e 	rMd<ndffd7d8d9e 	r_d:ndffd;de 	rld{ndffd<e 	ryd=nde 	rd>ndffd?e 	rd=nde 	rd>ndffd@e 	rdnde 	rdndffdAe 	rdBnddffdCe 	rdnde 	rdndffdDde 	rd1ndffdEe 	rdFnddffdGdHe 	rdInddffdJdKdLe 
rdMndffdNde 
rd{ndffdOd6e 
r"d7ndffdPe 
r.dnde 
r5dndffdQe 
rAdnde 
rHdndffdRe 
rTdnde 
r[dndffdSdTdUdVde 
rqdndffdWe 
r~dXnde 
rdYndffdZe 
rdnde 
rdndffd[de 
rdndffd\de 
rdndffd]de 
rdndffd^de 
rdndffd_d`dadbdcdddee 
rdfndffdgdGe 
rdHndffdhe rdinde rdjndffdkdle rdmnddffdne r*dnde r1dndffdoe r=dnde rDdndffdpe rQdqnde rYdrndffdse rednde rldndffdte rxdnde rdndffdue rdnde rdndffdve rdnde rdndffZ.e e"e.Z/dwdx e"0 D Z1dye,dze
e2e df fd{d|Z3		}					}	~dde
e,ej4e, f de	e
e,ej4e, f  de5de	e5 de	e6e,e,f  de	e
e5e,f  de	e, de5de,dze6e,ef fddZ7G dd dZ8ddgZ9dS (  zAuto Tokenizer class.    N)OrderedDict)AnyOptionalUnion   )PretrainedConfig)get_class_from_dynamic_moduleresolve_trust_remote_code)load_gguf_checkpoint)PreTrainedTokenizer)TOKENIZER_CONFIG_FILE)cached_fileextract_commit_hashis_g2p_en_availableis_sentencepiece_availableis_tokenizers_availablelogging   )EncoderDecoderConfig   )_LazyAutoMapping)CONFIG_MAPPING_NAMES
AutoConfigconfig_class_to_model_typemodel_type_to_module_name!replace_list_option_in_docstrings)PreTrainedTokenizerFastalbertAlbertTokenizerAlbertTokenizerFastalignBertTokenizerBertTokenizerFastarceeLlamaTokenizerLlamaTokenizerFastaria
aya_visionCohereTokenizerFastbark)bart)BartTokenizerBartTokenizerFastbarthezBarthezTokenizerBarthezTokenizerFast)bartpho)BartphoTokenizerNbertzbert-generationBertGenerationTokenizer)zbert-japanese)BertJapaneseTokenizerN)bertweet)BertweetTokenizerNbig_birdBigBirdTokenizerBigBirdTokenizerFastbigbird_pegasusPegasusTokenizerPegasusTokenizerFast)biogpt)BioGptTokenizerNbitnetr   )
blenderbot)BlenderbotTokenizerBlenderbotTokenizerFast)zblenderbot-small)BlenderbotSmallTokenizerNblipzblip-2GPT2TokenizerGPT2TokenizerFastbloomBloomTokenizerFastbridgetowerRobertaTokenizerRobertaTokenizerFastbros)byt5)ByT5TokenizerN	camembertCamembertTokenizerCamembertTokenizerFast)canine)CanineTokenizerN	chameleonchinese_clipclapclipCLIPTokenizerCLIPTokenizerFastclipseg)clvp)ClvpTokenizerN
code_llamaCodeLlamaTokenizerCodeLlamaTokenizerFastcodegenCodeGenTokenizerCodeGenTokenizerFastcoherecohere2colpalicolqwen2Qwen2TokenizerQwen2TokenizerFastconvbertConvBertTokenizerConvBertTokenizerFastcpmCpmTokenizerCpmTokenizerFast)cpmant)CpmAntTokenizerN)ctrl)CTRLTokenizerN)zdata2vec-audioWav2Vec2CTCTokenizerNzdata2vec-textdbrxdebertaDebertaTokenizerDebertaTokenizerFastz
deberta-v2DebertaV2TokenizerDebertaV2TokenizerFastdeepseek_v3)dia)DiaTokenizerN	diffllama
distilbertDistilBertTokenizerDistilBertTokenizerFastdprDPRQuestionEncoderTokenizerDPRQuestionEncoderTokenizerFastelectraElectraTokenizerElectraTokenizerFastemu3ernieernie_mErnieMTokenizer)esm)EsmTokenizerNfalconfalcon_mambaGPTNeoXTokenizerFastfastspeech2_conformerFastSpeech2ConformerTokenizer)flaubert)FlaubertTokenizerNfnetFNetTokenizerFNetTokenizerFast)fsmt)FSMTTokenizerNfunnelFunnelTokenizerFunnelTokenizerFastgemmaGemmaTokenizerGemmaTokenizerFastgemma2gemma3gemma3_textgemma3ngemma3n_textgitglmglm4glm4vzgpt-sw3GPTSw3Tokenizergpt2gpt_bigcodegpt_neogpt_neox)gpt_neox_japanese)GPTNeoXJapaneseTokenizerNgptj)zgptsan-japanese)GPTSanJapaneseTokenizerN)graniterE   N)
granitemoer   )granitemoehybridr   )granitemoesharedr   zgrounding-dinogroupvitheliumherbertHerbertTokenizerHerbertTokenizerFast)hubertrs   ibertideficsidefics2idefics3instructblipinstructblipvideointernvljambajanusjetmoe)jukebox)JukeboxTokenizerNzkosmos-2XLMRobertaTokenizerXLMRobertaTokenizerFastlayoutlmLayoutLMTokenizerLayoutLMTokenizerFast
layoutlmv2LayoutLMv2TokenizerLayoutLMv2TokenizerFast
layoutlmv3LayoutLMv3TokenizerLayoutLMv3TokenizerFast	layoutxlmLayoutXLMTokenizerLayoutXLMTokenizerFastledLEDTokenizerLEDTokenizerFastliltllamallama4llama4_textllava
llava_nextllava_next_videollava_onevision
longformerLongformerTokenizerLongformerTokenizerFastlongt5T5TokenizerT5TokenizerFast)luke)LukeTokenizerNlxmertLxmertTokenizerLxmertTokenizerFastm2m_100M2M100Tokenizermambamamba2marianMarianTokenizermbartMBartTokenizerMBartTokenizerFastmbart50MBart50TokenizerMBart50TokenizerFastmegazmegatron-bert)zmgp-str)MgpstrTokenizerNminimaxmistralmixtralmllamamlukeMLukeTokenizer
mobilebertMobileBertTokenizerMobileBertTokenizerFast
modernbert	moonshinemoshimpnetMPNetTokenizerMPNetTokenizerFastmptmramt5MT5TokenizerMT5TokenizerFastmusicgenmusicgen_melodymvpMvpTokenizerMvpTokenizerFast)myt5)MyT5TokenizerNnemotronnezhanllbNllbTokenizerNllbTokenizerFastznllb-moenystromformerolmoolmo2olmoezomdet-turbo	oneformerz
openai-gptOpenAIGPTTokenizerOpenAIGPTTokenizerFastoptowlv2owlvit	paligemmapegasus	pegasus_x)	perceiver)PerceiverTokenizerN	persimmonphiphi3phimoe)phobert)PhobertTokenizerN
pix2structpixtralplbartPLBartTokenizer)
prophetnet)ProphetNetTokenizerNqdqbertqwen2qwen2_5_omni
qwen2_5_vlqwen2_audio	qwen2_moeqwen2_vlqwen3	qwen3_moe)rag)RagTokenizerNrealmRealmTokenizerRealmTokenizerFastrecurrent_gemmareformerReformerTokenizerReformerTokenizerFastrembertRemBertTokenizerRemBertTokenizerFast	retribertRetriBertTokenizerRetriBertTokenizerFastrobertazroberta-prelayernorm)roc_bert)RoCBertTokenizerNroformerRoFormerTokenizerRoFormerTokenizerFastrwkvseamless_m4tSeamlessM4TTokenizerSeamlessM4TTokenizerFastseamless_m4t_v2shieldgemma2siglipSiglipTokenizersiglip2smollm3speech_to_textSpeech2TextTokenizer)speech_to_text_2)Speech2Text2TokenizerNspeecht5SpeechT5Tokenizer)splinter)SplinterTokenizerSplinterTokenizerFastsqueezebertSqueezeBertTokenizerSqueezeBertTokenizerFaststablelm
starcoder2switch_transformerst5t5gemma)tapas)TapasTokenizerN)tapex)TapexTokenizerN)z
transfo-xl)TransfoXLTokenizerNtvpudopUdopTokenizerUdopTokenizerFastumt5video_llavaviltvipllavavisual_bert)vits)VitsTokenizerN)wav2vec2rs   )zwav2vec2-bertrs   )zwav2vec2-conformerrs   )wav2vec2_phoneme)Wav2Vec2PhonemeCTCTokenizerNwhisperWhisperTokenizerWhisperTokenizerFastxclipxglmXGLMTokenizerXGLMTokenizerFast)xlm)XLMTokenizerNzxlm-prophetnetXLMProphetNetTokenizerzxlm-robertazxlm-roberta-xlxlnetXLNetTokenizerXLNetTokenizerFastxmodyosozambazamba2c                 C   s   i | ]\}}||qS  r  ).0kvr  r  g/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py
<dictcomp>  s    r  
class_namereturnc              	   C   s   | dkrt S t D ]'\}}| |v r1t|}td| d}zt|| W   S  ty0   Y q
w q
tj	 D ]\}}|D ]}t|dd | krM|    S q=q7td}t
|| r^t|| S d S )Nr   .ztransformers.models__name__transformers)r   TOKENIZER_MAPPING_NAMESitemsr   	importlibimport_modulegetattrAttributeErrorTOKENIZER_MAPPING_extra_contenthasattr)r  module_name
tokenizersmoduleconfig	tokenizermain_moduler  r  r  tokenizer_class_from_name  s,   	


r  F pretrained_model_name_or_path	cache_dirforce_downloadresume_downloadproxiestokenrevisionlocal_files_only	subfolderc	                 K   s   |	 dd}
|
durtdt |durtd|
}|	dd}t| t||||||||ddd|d}|du r=t	d i S t
||}t|d	d
}t|}W d   n1 sXw   Y  ||d< |S )a	  
    Loads the tokenizer configuration from a pretrained model tokenizer configuration.

    Args:
        pretrained_model_name_or_path (`str` or `os.PathLike`):
            This can be either:

            - a string, the *model id* of a pretrained model configuration hosted inside a model repo on
              huggingface.co.
            - a path to a *directory* containing a configuration file saved using the
              [`~PreTrainedTokenizer.save_pretrained`] method, e.g., `./my_model_directory/`.

        cache_dir (`str` or `os.PathLike`, *optional*):
            Path to a directory in which a downloaded pretrained model configuration should be cached if the standard
            cache should not be used.
        force_download (`bool`, *optional*, defaults to `False`):
            Whether or not to force to (re-)download the configuration files and override the cached versions if they
            exist.
        resume_download:
            Deprecated and ignored. All downloads are now resumed by default when possible.
            Will be removed in v5 of Transformers.
        proxies (`dict[str, str]`, *optional*):
            A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
            'http://hostname': 'foo.bar:4012'}.` The proxies are used on each request.
        token (`str` or *bool*, *optional*):
            The token to use as HTTP bearer authorization for remote files. If `True`, will use the token generated
            when running `huggingface-cli login` (stored in `~/.huggingface`).
        revision (`str`, *optional*, defaults to `"main"`):
            The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
            git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any
            identifier allowed by git.
        local_files_only (`bool`, *optional*, defaults to `False`):
            If `True`, will only try to load the tokenizer configuration from local files.
        subfolder (`str`, *optional*, defaults to `""`):
            In case the tokenizer config is located inside a subfolder of the model repo on huggingface.co, you can
            specify the folder name here.

    <Tip>

    Passing `token=True` is required when you want to use a private model.

    </Tip>

    Returns:
        `dict`: The configuration of the tokenizer.

    Examples:

    ```python
    # Download configuration from huggingface.co and cache.
    tokenizer_config = get_tokenizer_config("google-bert/bert-base-uncased")
    # This model does not have a tokenizer config so the result will be an empty dict.
    tokenizer_config = get_tokenizer_config("FacebookAI/xlm-roberta-base")

    # Save a pretrained tokenizer locally and you can reload its config
    from transformers import AutoTokenizer

    tokenizer = AutoTokenizer.from_pretrained("google-bert/bert-base-cased")
    tokenizer.save_pretrained("tokenizer-test")
    tokenizer_config = get_tokenizer_config("tokenizer-test")
    ```use_auth_tokenNrThe `use_auth_token` argument is deprecated and will be removed in v5 of Transformers. Please use `token` instead.V`token` and `use_auth_token` are both specified. Please set only the argument `token`._commit_hashF)r  r  r  r  r  r  r  r   _raise_exceptions_for_gated_repo%_raise_exceptions_for_missing_entries'_raise_exceptions_for_connection_errorsr  z\Could not locate the tokenizer configuration file, will try to use the model config instead.zutf-8)encoding)popwarningswarnFutureWarning
ValueErrorgetr   r   loggerinfor   openjsonload)r  r  r  r  r  r  r  r  r  kwargsr  commit_hashresolved_config_filereaderresultr  r  r  get_tokenizer_config  sF   I

r  c                   @   s:   e Zd ZdZdd Zeeedd Ze	d
dd	Z
dS )AutoTokenizera  
    This is a generic tokenizer class that will be instantiated as one of the tokenizer classes of the library when
    created with the [`AutoTokenizer.from_pretrained`] class method.

    This class cannot be instantiated directly using `__init__()` (throws an error).
    c                 C   s   t d)Nz}AutoTokenizer is designed to be instantiated using the `AutoTokenizer.from_pretrained(pretrained_model_name_or_path)` method.)OSError)selfr  r  r  __init__R  s   zAutoTokenizer.__init__c              	   O   sz  | dd}|dur tdt |dddurtd||d< | dd}d|d< | d	d}| d
d}| dd}|dd}	|durd}
t|d}|du rgtd| dddd t D  d|\}}|r{|durvt	|}
nt
d |
du rt	|}
|
du rtd| d|
j|g|R i |S t|fi |}d|v r|d |d< |d}d}d|v rt|d ttfr|d }n|d dd}|du rt|ts|	rt||	fi |}t|ddd }tjd)i |}ntj|fd|i|}|j}t|drd|jv r|jd }|du}t|tv p1|duo1t	|dup1t	|d du}|r_|rD|d durD|d }n|d }d|v rU|dd }nd}t|||||}|r|rt||fi |}
| d d}|
  |
j|g|R d|i|S |durd}
|r|ds| d}t	|}
|
du r|}t	|}
|
du rtd| d!|
j|g|R i |S t|t rt|j!t|j"urt
d"|j"j# d#|j!j# d$ |j"}t$t|j%}|dur'tt| \}}|r|s|du r|j|g|R i |S |dur#|j|g|R i |S td%td&|j# d'dd(d t D  d)*a]  
        Instantiate one of the tokenizer classes of the library from a pretrained model vocabulary.

        The tokenizer class to instantiate is selected based on the `model_type` property of the config object (either
        passed as an argument or loaded from `pretrained_model_name_or_path` if possible), or when it's missing, by
        falling back to using pattern matching on `pretrained_model_name_or_path`:

        List options

        Params:
            pretrained_model_name_or_path (`str` or `os.PathLike`):
                Can be either:

                    - A string, the *model id* of a predefined tokenizer hosted inside a model repo on huggingface.co.
                    - A path to a *directory* containing vocabulary files required by the tokenizer, for instance saved
                      using the [`~PreTrainedTokenizer.save_pretrained`] method, e.g., `./my_model_directory/`.
                    - A path or url to a single saved vocabulary file if and only if the tokenizer only requires a
                      single vocabulary file (like Bert or XLNet), e.g.: `./my_model_directory/vocab.txt`. (Not
                      applicable to all derived classes)
            inputs (additional positional arguments, *optional*):
                Will be passed along to the Tokenizer `__init__()` method.
            config ([`PretrainedConfig`], *optional*)
                The configuration object used to determine the tokenizer class to instantiate.
            cache_dir (`str` or `os.PathLike`, *optional*):
                Path to a directory in which a downloaded pretrained model configuration should be cached if the
                standard cache should not be used.
            force_download (`bool`, *optional*, defaults to `False`):
                Whether or not to force the (re-)download the model weights and configuration files and override the
                cached versions if they exist.
            resume_download:
                Deprecated and ignored. All downloads are now resumed by default when possible.
                Will be removed in v5 of Transformers.
            proxies (`dict[str, str]`, *optional*):
                A dictionary of proxy servers to use by protocol or endpoint, e.g., `{'http': 'foo.bar:3128',
                'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
            revision (`str`, *optional*, defaults to `"main"`):
                The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
                git-based system for storing models and other artifacts on huggingface.co, so `revision` can be any
                identifier allowed by git.
            subfolder (`str`, *optional*):
                In case the relevant files are located inside a subfolder of the model repo on huggingface.co (e.g. for
                facebook/rag-token-base), specify it here.
            use_fast (`bool`, *optional*, defaults to `True`):
                Use a [fast Rust-based tokenizer](https://huggingface.co/docs/tokenizers/index) if it is supported for
                a given model. If a fast tokenizer is not available for a given model, a normal Python-based tokenizer
                is returned instead.
            tokenizer_type (`str`, *optional*):
                Tokenizer type to be loaded.
            trust_remote_code (`bool`, *optional*, defaults to `False`):
                Whether or not to allow for custom models defined on the Hub in their own modeling files. This option
                should only be set to `True` for repositories you trust and in which you have read the code, as it will
                execute code present on the Hub on your local machine.
            kwargs (additional keyword arguments, *optional*):
                Will be passed to the Tokenizer `__init__()` method. Can be used to set special tokens like
                `bos_token`, `eos_token`, `unk_token`, `sep_token`, `pad_token`, `cls_token`, `mask_token`,
                `additional_special_tokens`. See parameters in the `__init__()` for more details.

        Examples:

        ```python
        >>> from transformers import AutoTokenizer

        >>> # Download vocabulary from huggingface.co and cache.
        >>> tokenizer = AutoTokenizer.from_pretrained("google-bert/bert-base-uncased")

        >>> # Download vocabulary from huggingface.co (user-uploaded) and cache.
        >>> tokenizer = AutoTokenizer.from_pretrained("dbmdz/bert-base-german-cased")

        >>> # If vocabulary files are in a directory (e.g. tokenizer was saved using *save_pretrained('./test/saved_model/')*)
        >>> # tokenizer = AutoTokenizer.from_pretrained("./test/bert_saved_model/")

        >>> # Download vocabulary from huggingface.co and define model-specific arguments
        >>> tokenizer = AutoTokenizer.from_pretrained("FacebookAI/roberta-base", add_prefix_space=True)
        ```r  Nr  r  r  r  T
_from_autouse_fasttokenizer_typetrust_remote_code	gguf_filezPassed `tokenizer_type` z3 does not exist. `tokenizer_type` should be one of z, c                 s   s    | ]}|V  qd S Nr  r  cr  r  r  	<genexpr>  s    z0AutoTokenizer.from_pretrained.<locals>.<genexpr>r  zt`use_fast` is set to `True` but the tokenizer class does not have a fast version.  Falling back to the slow version.zTokenizer class z is not currently imported.r  tokenizer_classauto_mapr  F)return_tensorsFastr   r   z--code_revisionz- does not exist or is not currently imported.z The encoder model config class: z3 is different from the decoder model config class: z. It is not recommended to use the `AutoTokenizer.from_pretrained()` method in this case. Please use the encoder and decoder specific tokenizer classes.zzThis tokenizer cannot be instantiated. Please make sure you have `sentencepiece` installed in order to use this tokenizer.z!Unrecognized configuration class z8 to build an AutoTokenizer.
Model type should be one of c                 s   s    | ]}|j V  qd S r  )r  r  r  r  r  r  9  s    r  )&r  r  r  r  r  r  r  joinkeysr  r  warningfrom_pretrainedr  
isinstancetuplelistr   r   r
   r   	for_modelr  r  r  typer  splitr	   r   register_for_auto_classendswithr   decoderencoder	__class__r   r  )clsr  inputsr  r  r  r  r  r  r  r  tokenizer_class_tupletokenizer_class_nametokenizer_fast_class_nametokenizer_configconfig_tokenizer_classtokenizer_auto_map	gguf_pathconfig_dicthas_remote_codehas_local_code	class_refupstream_repo_tokenizer_class_candidate
model_typetokenizer_class_pytokenizer_class_fastr  r  r  r  X  s   M

















zAutoTokenizer.from_pretrainedNFc                 C   s   |du r|du rt d|durt|trt d|dur&t|tr&t d|durD|durDt|trD|j|krDt d|j d| d| tjv r[t|  \}}|du rU|}|du r[|}tj| ||f|d dS )	a  
        Register a new tokenizer in this mapping.


        Args:
            config_class ([`PretrainedConfig`]):
                The configuration corresponding to the model to register.
            slow_tokenizer_class ([`PretrainedTokenizer`], *optional*):
                The slow tokenizer to register.
            fast_tokenizer_class ([`PretrainedTokenizerFast`], *optional*):
                The fast tokenizer to register.
        NzKYou need to pass either a `slow_tokenizer_class` or a `fast_tokenizer_classz:You passed a fast tokenizer in the `slow_tokenizer_class`.z:You passed a slow tokenizer in the `fast_tokenizer_class`.zThe fast tokenizer class you are passing has a `slow_tokenizer_class` attribute that is not consistent with the slow tokenizer class you passed (fast tokenizer has z and you passed z!. Fix one of those so they match!)exist_ok)r  
issubclassr   r   slow_tokenizer_classr  r  register)config_classr  fast_tokenizer_classr  existing_slowexisting_fastr  r  r  r  <  s2   

zAutoTokenizer.register)NNF)r  
__module____qualname____doc__r  classmethodr   r  r  staticmethodr  r  r  r  r  r  J  s     cr  r  )NFNNNNFr  ):r  r  r  osr  collectionsr   typingr   r   r   configuration_utilsr   dynamic_module_utilsr   r	   modeling_gguf_pytorch_utilsr
   tokenization_utilsr   tokenization_utils_baser   utilsr   r   r   r   r   r   encoder_decoderr   auto_factoryr   configuration_autor   r   r   r   r   tokenization_utils_fastr   
get_loggerr  r  strr  r  r  r  CONFIG_TO_TYPEr  r  PathLikebooldictr  r  __all__r  r  r  r  <module>   s   	
	
!"#$%&'()*+-35;=DKQSYZ[\]^`fghijkmtz|                               "  )  0  7  >  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  [  \  ]  ^  _  a  g  i  o  q  w  x  y  z  {  |  ~                                            !    "    #    $    &    -    3    4    5    7    >    E    K    L    M    N    O    P    Q    R    S    U    [    \    ]    ^    _    `    b    i    p    v    w    x    z    }                                                         #      $      %      &      '      (      )      *      +      -      3      4      5      7      =      ?      F      L      M      O      V      ]      c      d      f      i      j      k      m      t      {                       
                                                                                $        *        +        ,        -        /        6        <        =        >        ?        @        A        B        C        D        E        F        H        N        O        Q        X        _        f        m        t        {         
&	
o  !