ó
    pyüi•Z  ã                   ó¦  • % S r SSKrSSKrSSKJr  SSKJr  SSKJr  SSK	J
r
Jr  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJrJrJrJrJr  SSKJr  SSKJr  SSKJrJ r J!r!J"r"  SSK#J$r$  SSK%J&r&  SSK'J(r(  SSK)J*r*  \RV                  " \,5      r-\(       a  \" 5       r.\\/\/S-  4   \0S'   O
\" / SQ5      r.\" \\.5      r1S\/4S jr2 " S S5      r3SS/r4g)zAutoProcessor class.é    N)ÚOrderedDict)ÚTYPE_CHECKINGé   )ÚPreTrainedConfig)Úget_class_from_dynamic_moduleÚresolve_trust_remote_code)ÚFeatureExtractionMixin)ÚImageProcessingMixin)ÚProcessorMixin)ÚTOKENIZER_CONFIG_FILE)ÚFEATURE_EXTRACTOR_NAMEÚPROCESSOR_NAMEÚVIDEO_PROCESSOR_NAMEÚcached_fileÚlogging)ÚBaseVideoProcessoré   )Ú_LazyAutoMapping)ÚCONFIG_MAPPING_NAMESÚ
AutoConfigÚmodel_type_to_module_nameÚ!replace_list_option_in_docstrings)ÚAutoFeatureExtractor)ÚAutoImageProcessor)ÚAutoTokenizer)ÚAutoVideoProcessorÚPROCESSOR_MAPPING_NAMES)�)Úaimv2ÚCLIPProcessor)ÚalignÚAlignProcessor)ÚaltclipÚAltCLIPProcessor)ÚariaÚAriaProcessor)Úaudioflamingo3ÚAudioFlamingo3Processor)Ú
aya_visionÚAyaVisionProcessor)ÚbarkÚBarkProcessor)ÚblipÚBlipProcessor)zblip-2ÚBlip2Processor)ÚbridgetowerÚBridgeTowerProcessor)Ú	chameleonÚChameleonProcessor)Úchinese_clipÚChineseCLIPProcessor)ÚclapÚClapProcessor)Úclipr   )ÚclipsegÚCLIPSegProcessor)ÚclvpÚClvpProcessor)Úcohere2_visionÚCohere2VisionProcessor)Ú
cohere_asrÚCohereAsrProcessor)ÚcolmodernvbertÚColModernVBertProcessor)ÚcolpaliÚColPaliProcessor)Úcolqwen2ÚColQwen2Processor)Údeepseek_vlÚDeepseekVLProcessor)Údeepseek_vl_hybridÚDeepseekVLHybridProcessor)ÚdiaÚDiaProcessor)ÚedgetamÚSam2Processor)Úemu3ÚEmu3Processor)Úernie4_5_vl_moeÚErnie4_5_VLMoeProcessor)ÚevollaÚEvollaProcessor)Ú	exaone4_5ÚExaone4_5_Processor)ÚflavaÚFlavaProcessor)Ú	florence2ÚFlorence2Processor)ÚfuyuÚFuyuProcessor)Úgemma3ÚGemma3Processor)Úgemma3nÚGemma3nProcessor)Úgemma4ÚGemma4Processor)ÚgitÚGitProcessor)Úglm46vÚGlm46VProcessor)Úglm4vÚGlm4vProcessor)Ú	glm4v_moerg   )Ú	glm_imagerg   )ÚglmasrÚGlmAsrProcessor)Úgot_ocr2ÚGotOcr2Processor)Úgranite4_visionÚGranite4VisionProcessor)Úgranite_speechÚGraniteSpeechProcessor)Úgranite_speech_plusrq   )zgrounding-dinoÚGroundingDinoProcessor)Úgroupvitr   )Úhiggs_audio_v2ÚHiggsAudioV2Processor)ÚhubertÚWav2Vec2Processor)ÚideficsÚIdeficsProcessor)Úidefics2ÚIdefics2Processor)Úidefics3ÚIdefics3Processor)ÚinstructblipÚInstructBlipProcessor)ÚinstructblipvideoÚInstructBlipVideoProcessor)ÚinternvlÚInternVLProcessor)ÚjanusÚJanusProcessor)zkosmos-2ÚKosmos2Processor)z
kosmos-2.5ÚKosmos2_5Processor)Úkyutai_speech_to_textÚKyutaiSpeechToTextProcessor)Úlasr_ctcÚLasrProcessor)Úlasr_encoderrŒ   )Ú
layoutlmv2ÚLayoutLMv2Processor)Ú
layoutlmv3ÚLayoutLMv3Processor)Ú	layoutxlmÚLayoutXLMProcessor)Úlfm2_vlÚLfm2VlProcessor)Úlighton_ocrÚLightOnOcrProcessor)Úllama4ÚLlama4Processor)ÚllavaÚLlavaProcessor)Ú
llava_nextÚLlavaNextProcessor)Úllava_next_videoÚLlavaNextVideoProcessor)Úllava_onevisionÚLlavaOnevisionProcessor)ÚmarkuplmÚMarkupLMProcessor)Ú
metaclip_2r   )zmgp-strÚMgpstrProcessor)Úminicpmv4_6ÚMiniCPMV4_6Processor)Úmistral3ÚPixtralProcessor)ÚmllamaÚMllamaProcessor)zmm-grounding-dinors   )Úmodernvbertr~   )Ú	moonshinerx   )Úmoonshine_streamingÚMoonshineStreamingProcessor)ÚmusicflamingoÚMusicFlamingoProcessor)zomdet-turboÚOmDetTurboProcessor)Ú	oneformerÚOneFormerProcessor)Úovis2ÚOvis2Processor)Úowlv2ÚOwlv2Processor)ÚowlvitÚOwlViTProcessor)Úpaddleocr_vlÚPaddleOCRVLProcessor)Ú	paligemmaÚPaliGemmaProcessor)Úperception_lmÚPerceptionLMProcessor)Úphi4_multimodalÚPhi4MultimodalProcessor)Úpi0ÚPI0Processor)Ú
pix2structÚPix2StructProcessor)Úpixtralr©   )Ú	pop2pianoÚPop2PianoProcessor)Úpp_chart2tableÚPPChart2TableProcessor)Úpp_formulanetÚPPFormulaNetProcessor)Úqianfan_ocrÚQianfanOCRProcessor)Úqwen2_5_omniÚQwen2_5OmniProcessor)Ú
qwen2_5_vlÚQwen2_5_VLProcessor)Úqwen2_audioÚQwen2AudioProcessor)Úqwen2_vlÚQwen2VLProcessor)Úqwen3_5ÚQwen3VLProcessor)Úqwen3_5_moerÙ   )Úqwen3_omni_moeÚQwen3OmniMoeProcessor)Úqwen3_vlrÙ   )Úqwen3_vl_moerÙ   )ÚsamÚSamProcessor)Úsam2rM   )Úsam3ÚSam3Processor)Úsam3_lite_textrã   )Úsam_hqÚSamHQProcessor)Úseamless_m4tÚSeamlessM4TProcessor)Úsewrx   )zsew-drx   )Úshieldgemma2ÚShieldGemma2Processor)ÚsiglipÚSiglipProcessor)Úsiglip2ÚSiglip2Processor)ÚsmolvlmÚSmolVLMProcessor)Úspeech_to_textÚSpeech2TextProcessor)Úspeecht5ÚSpeechT5Processor)Út5gemma2r]   )Út5gemma2_encoderr]   )ÚtrocrÚTrOCRProcessor)ÚtvpÚTvpProcessor)ÚudopÚUdopProcessor)Ú	unispeechrx   )zunispeech-satrx   )Úvibevoice_asrÚVibeVoiceAsrProcessor)Úvideo_llavaÚVideoLlavaProcessor)ÚviltÚViltProcessor)Úvipllavar›   )zvision-text-dual-encoderÚVisionTextDualEncoderProcessor)ÚvoxtralÚVoxtralProcessor)Úvoxtral_realtimeÚVoxtralRealtimeProcessor)Úwav2vec2rx   )zwav2vec2-bertrx   )zwav2vec2-conformerrx   )Úwavlmrx   )ÚwhisperÚWhisperProcessor)ÚxclipÚXCLIPProcessorÚ
class_namec                 ó¦  • [         R                  5        H=  u  pX;   d  M  [        U5      n[        R                  " SU 3S5      n [        X05      s  $    [        R                  R                  5        H  n[        USS 5      U :X  d  M  Us  $    [        R                  " S5      n[        XP5      (       a  [        XP5      $ g ! [         a     Mº  f = f)NÚ.ztransformers.modelsÚ__name__Útransformers)r   Úitemsr   Ú	importlibÚimport_moduleÚgetattrÚAttributeErrorÚPROCESSOR_MAPPINGÚ_extra_contentÚvaluesÚhasattr)r  Úmodule_nameÚ
processorsÚmoduleÚ	processorÚmain_modules         Úe/home/mande/repo/quber/.venv/lib/python3.13/site-packages/transformers/models/auto/processing_auto.pyÚprocessor_class_from_namer%  Æ   sÄ   € Ü#:×#@Ñ#@Ö#BÑˆØÕ#Ü3°KÓ@ˆKä×,Ò,¨q°°Ð->Ð@UÓVˆFðÜ˜vÓ2Ò2ñ $Cô '×5Ñ5×<Ñ<Ö>ˆ	Ü�9˜j¨$Ó/°:Õ=ØÒñ ?ô ×)Ò)¨.Ó9€KÜˆ{×'Ñ'Ü�{Ó/Ð/àøô "ó Úðús   Á
CÃ
CÃCc                   óX   • \ rS rSrSrS r\\" \5      S 5       5       r	\
SS j5       rSrg)	ÚAutoProcessoréÞ   a  
This is a generic processor class that will be instantiated as one of the processor classes of the library when
created with the [`AutoProcessor.from_pretrained`] class method.

This class cannot be instantiated directly using `__init__()` (throws an error).
c                 ó   • [        S5      e)Nz}AutoProcessor is designed to be instantiated using the `AutoProcessor.from_pretrained(pretrained_model_name_or_path)` method.)ÚOSError)Úselfs    r$  Ú__init__ÚAutoProcessor.__init__æ   s   € Üð_ó
ð 	
ó    c                 ó	  • UR                  SS5      nUR                  SS5      nSUS'   SnSnSnU Vs0 s H  oˆU;   d  M
  X‚U   _M     n	nU	R                  SSSS.5        [        U[        40 U	D6n
U
bH  [        R
                  " U40 UD6u  p¼UR                  S	5      nS
UR                  S0 5      ;   a  US   S
   nUGc   [        U[        40 U	D6nUbI  [        R                  " U40 UD6u  p¼UR                  S	S5      nS
UR                  S0 5      ;   a  US   S
   nUc]  [        U[        40 U	D6nUbI  [        R                  " U40 UD6u  p¼UR                  S	S5      nS
UR                  S0 5      ;   a  US   S
   nUc`  [        U[        40 U	D6nUbL  UcI  [        R                  " U40 UD6u  p¼UR                  S	S5      nS
UR                  S0 5      ;   a  US   S
   nUcm  [        U[        40 U	D6nUbY  [!        USS9 n["        R$                  " U5      nSSS5        WR                  S	S5      nS
UR                  S0 5      ;   a  US   S
   nUcl   ['        U[(        5      (       d  [*        R,                  " U4SU0UD6n[/        US	S5      n[1        US5      (       a  S
UR2                  ;   a  UR2                  S
   nUb  [7        U5      nUSLnUSL=(       d    [9        U5      [:        ;   nU=(       a9    U=(       d    [:        [9        U5         R<                  R?                  S5      (       + nU(       a+  SU;   a  URA                  S5      S   nOSn[C        XAUUU5      nU(       aQ  U(       aJ  U(       dC  [E        Xa40 UD6nUR                  SS5      nURG                  5         UR,                  " U4SU0UD6$ Ub  UR,                  " U4SU0UD6$ [9        U5      [:        ;   a#  [:        [9        U5         R,                  " U40 UD6$ [H        [J        [L        [N        4 H  n UR,                  " U4SU0UD6s  $    [5        SU S35      es  snf ! , (       d  f       GN>= f! [4         a     GN¯f = f! [P         a     Ma  f = f)a›  
Instantiate one of the processor classes of the library from a pretrained model vocabulary.

The processor 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):

List options

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

        - a string, the *model id* of a pretrained feature_extractor hosted inside a model repo on
          huggingface.co.
        - a path to a *directory* containing a processor files saved using the `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 feature extractor 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 feature extractor files and override the cached versions
        if they exist.
    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 `hf auth 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.
    return_unused_kwargs (`bool`, *optional*, defaults to `False`):
        If `False`, then this function returns just the final feature extractor object. If `True`, then this
        functions returns a `Tuple(feature_extractor, unused_kwargs)` where *unused_kwargs* is a dictionary
        consisting of the key/value pairs whose keys are not feature extractor attributes: i.e., the part of
        `kwargs` which has not been used to update `feature_extractor` and is otherwise ignored.
    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 (`dict[str, Any]`, *optional*):
        The values in kwargs of any keys which are feature extractor attributes will be used to override the
        loaded values. Behavior concerning key/value pairs whose keys are *not* feature extractor attributes is
        controlled by the `return_unused_kwargs` keyword parameter.

<Tip>

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

</Tip>

Examples:

```python
>>> from transformers import AutoProcessor

>>> # Download processor from huggingface.co and cache.
>>> processor = AutoProcessor.from_pretrained("facebook/wav2vec2-base-960h")

>>> # If processor files are in a directory (e.g. processor was saved using *save_pretrained('./test/saved_model/')*)
>>> # processor = AutoProcessor.from_pretrained("./test/saved_model/")
```ÚconfigNÚtrust_remote_codeTÚ
_from_auto)	Ú	cache_dirÚforce_downloadÚproxiesÚtokenÚrevisionÚlocal_files_onlyÚ	subfolderÚ	repo_typeÚ
user_agentF)Ú _raise_exceptions_for_gated_repoÚ%_raise_exceptions_for_missing_entriesÚ'_raise_exceptions_for_connection_errorsÚprocessor_classr'  Úauto_mapzutf-8)Úencodingztransformers.z--r   Úcode_revisionz!Unrecognized processing class in zÓ. Can't instantiate a processor, a tokenizer, an image processor, a video processor or a feature extractor for this model. Make sure the repository contains the files of at least one of those processing classes.))ÚpopÚupdater   r   r   Úget_processor_dictÚgetr   r
   Úget_image_processor_dictr   r   Úget_video_processor_dictr	   Úget_feature_extractor_dictr   ÚopenÚjsonÚloadÚ
isinstancer   r   Úfrom_pretrainedr  r  r@  Ú
ValueErrorr%  Útyper  Ú
__module__Ú
startswithÚsplitr   r   Úregister_for_auto_classr   r   r   r   Ú	Exception)ÚclsÚpretrained_model_name_or_pathÚkwargsr0  r1  r?  Úprocessor_auto_mapÚ_hub_valid_kwargsÚkeyÚcached_file_kwargsÚprocessor_config_fileÚconfig_dictÚ_Úpreprocessor_config_fileÚtokenizer_config_fileÚreaderÚhas_remote_codeÚhas_local_codeÚexplicit_local_codeÚupstream_repoÚklasss                        r$  rN  ÚAutoProcessor.from_pretrainedì   sZ  € ðD —‘˜H dÓ+ˆØ"ŸJ™JÐ':¸DÓAÐØ#ˆˆ|ÑàˆØ!Ðð

Ðñ ;LÓ]Ò:K°3ÐV\É}Ó.˜c¨#¡;Ò.Ñ:KÐÐ]à×!Ñ!à49Ø9>Ø;@ñô	
ô !,Ð,IÌ>Ñ pÐ]oÑ pÐØ Ñ,Ü+×>Ò>Ð?\ÑgÐ`fÑg‰NˆKØ)Ÿo™oÐ.?Ó@ˆOØ +§/¡/°*¸bÓ"AÓAØ%0°Ñ%<¸_Ñ%MÐ"àÒ"ä'2Ø-Ô/Eñ(ØI[ñ(Ð$ð (Ñ3Ü!5×!NÒ!NÐOlÑ!wÐpvÑ!w‘�Ø"-§/¡/Ð2CÀTÓ"J�Ø" k§o¡o°jÀ"Ó&EÓEØ)4°ZÑ)@ÀÑ)QÐ&ð (Ñ/Ü+6Ø1Ô3Gñ,ØK]ñ,Ð(ð ,Ñ7Ü%7×%PÒ%PØ5ñ&Ø9?ñ&‘N�Kð '2§o¡oÐ6GÈÓ&N�OØ&¨+¯/©/¸*ÀbÓ*IÓIØ-8¸Ñ-DÀ_Ñ-UÐ*à'Ñ/Ü+6Ø1Ô3Iñ,ØM_ñ,Ð(ð ,Ñ7¸OÑ<SÜ%;×%VÒ%VØ5ñ&Ø9?ñ&‘N�Kð '2§o¡oÐ6GÈÓ&N�OØ&¨+¯/©/¸*ÀbÓ*IÓIØ-8¸Ñ-DÀ_Ñ-UÐ*àÑ"ä$/Ø-Ô/Dñ%ØHZñ%Ð!ð %Ñ0ÜÐ/¸'ÒBÀfÜ"&§)¢)¨FÓ"3�K÷ Cð #.§/¡/Ð2CÀTÓ"J�Ø" k§o¡o°jÀ"Ó&EÓEØ)4°ZÑ)@ÀÑ)QÐ&àÑ"ðÜ! &Ô*:×;Ñ;Ü'×7Ò7Ø5ñØIZðØ^dñ�Fô #*¨&Ð2CÀTÓ"J�Ü˜6 :×.Ñ.°?ÀfÇoÁoÓ3UØ)/¯©¸Ñ)IÐ&ð Ñ&Ü7¸ÓHˆOà,°DÐ8ˆØ(°Ð4×Y¼¸V»ÔHYÑ8YˆØ,÷ 1Ø×>Ô0´°f³Ñ>ß
‰*—Z‘Z Ó0ô21Ðö ØÐ)Ó)Ø 2× 8Ñ 8¸Ó >¸qÑ A‘à $�Ü 9Ø!À.ÐRaÐcpó!Ðö Ö0Ö9LÜ;Ø"ñØEKñˆOð —
‘
˜?¨DÓ1ˆAØ×3Ñ3Ô5Ø"×2Ò2Ø-ñØARðØV\ñð ð Ñ(Ø"×2Ò2Ø-ñØARðØV\ñð ô �&‹\Ô.Ó.Ü$¤T¨&£\Ñ2×BÒBÐC`ÑkÐdjÑkÐkô $Ô%7Ô9KÔMaÓbˆEðØ×,Ò,Ø1ñØEVðØZ`ñò ñ cô Ø/Ð0MÐ/Nð Ogð gó
ð 	
ùòG ^÷x CÖBûô, ó ò ðûô\ ó Úðús<   ´	QÁ	QÈQÉA+Q" Ð#Q3Ñ
QÑ"
Q0Ñ/Q0Ñ3
RÒ Rc                 ó,   • [         R                  XUS9  g)zá
Register a new processor for this class.

Args:
    config_class ([`PreTrainedConfig`]):
        The configuration corresponding to the model to register.
    processor_class ([`ProcessorMixin`]): The processor to register.
)Úexist_okN)r  Úregister)Úconfig_classr?  rj  s      r$  rk  ÚAutoProcessor.registerË  s   € ô 	×"Ñ" <È8Ð"ÒTr.  © N)F)r  rQ  Ú__qualname__Ú__firstlineno__Ú__doc__r,  Úclassmethodr   r   rN  Ústaticmethodrk  Ú__static_attributes__rn  r.  r$  r'  r'  Þ   sH   † ñò
ð Ù&Ð'>Ó?ñ[
ó @ó ð[
ðz ó	Uó ó	Ur.  r'  r  )5rq  r  rK  Úcollectionsr   Útypingr   Úconfiguration_utilsr   Údynamic_module_utilsr   r   Úfeature_extraction_utilsr	   Úimage_processing_utilsr
   Úprocessing_utilsr   Útokenization_pythonr   Úutilsr   r   r   r   r   Úvideo_processing_utilsr   Úauto_factoryr   Úconfiguration_autor   r   r   r   Úfeature_extraction_autor   Úimage_processing_autor   Útokenization_autor   Úvideo_processing_autor   Ú
get_loggerr  Úloggerr   ÚstrÚ__annotations__r  r%  r'  Ú__all__rn  r.  r$  Ú<module>rŠ     sË   ðò ã Û Ý #Ý  õ 4ß \Ý >Ý :Ý .Ý 8ß gÕ gÝ 8Ý *÷ó õ :Ý 5Ý ,Ý 5ð 
×	Ò	˜HÓ	%€Þñ =H»MÐ˜[¨¨c°D©j¨Ñ9ÔIá)òN	
óPÐñd %Ð%9Ð;RÓSÐ ð¨#ô ÷0wUñ wUðt  Ð
0�r.  