ó
    pyüi?L  ã                   ó–  • 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J	r	  SSK
Jr  SSKJrJrJrJrJrJr  S	S
KJr  S	SKJrJrJrJr  \R4                  " \5      r\" / SQ5      r\" \\5      rS\4S jr       SS\\RB                  -  S\\RB                  -  S-  S\"S\#\\4   S-  S\"\-  S-  S\S-  S\"4S jjr$ " S S5      r%SS/r&g)zAutoFeatureExtractor class.é    N)ÚOrderedDicté   )ÚPreTrainedConfig)Úget_class_from_dynamic_moduleÚresolve_trust_remote_code)ÚFeatureExtractionMixin)ÚCONFIG_NAMEÚFEATURE_EXTRACTOR_NAMEÚPROCESSOR_NAMEÚcached_fileÚloggingÚsafe_load_json_fileé   )Ú_LazyAutoMapping)ÚCONFIG_MAPPING_NAMESÚ
AutoConfigÚmodel_type_to_module_nameÚ!replace_list_option_in_docstrings)6)zaudio-spectrogram-transformerÚASTFeatureExtractor)Úaudioflamingo3ÚWhisperFeatureExtractor)ÚclapÚClapFeatureExtractor)ÚclvpÚClvpFeatureExtractor)Ú
cohere_asrÚCohereAsrFeatureExtractor)ÚcsmÚEncodecFeatureExtractor)ÚdacÚDacFeatureExtractor)zdata2vec-audioÚWav2Vec2FeatureExtractor)ÚdiaÚDiaFeatureExtractor)Úencodecr   )Úgemma3nÚGemma3nAudioFeatureExtractor)Úgemma4ÚGemma4AudioFeatureExtractor)Úglmasrr   )Úgranite_speechÚGraniteSpeechFeatureExtractor)Úgranite_speech_plusr,   )Úhiggs_audio_v2_tokenizerr!   )Úhubertr"   )Úkyutai_speech_to_textÚ"KyutaiSpeechToTextFeatureExtractor)Úlasr_ctcÚLasrFeatureExtractor)Úlasr_encoderr3   )ÚmarkuplmÚMarkupLMFeatureExtractor)Úmimir   )Ú	moonshiner"   )Úmoshir   )Úmusicgenr   )Úmusicgen_melodyÚMusicgenMelodyFeatureExtractor)Úparakeet_ctcÚParakeetFeatureExtractor)Úparakeet_encoderr>   )Úpe_audioÚPeAudioFeatureExtractor)Úpe_audio_videorA   )Úphi4_multimodalÚPhi4MultimodalFeatureExtractor)Ú	pop2pianoÚPop2PianoFeatureExtractor)Úqwen2_5_omnir   )Úqwen2_audior   )Úqwen3_omni_moer   )Úseamless_m4tÚSeamlessM4TFeatureExtractor)Úseamless_m4t_v2rK   )Úsewr"   )zsew-dr"   )Úspeech_to_textÚSpeech2TextFeatureExtractor)Úspeecht5ÚSpeechT5FeatureExtractor)Ú	unispeechr"   )zunispeech-satr"   )ÚunivnetÚUnivNetFeatureExtractor)Úvibevoice_acoustic_tokenizerÚ*VibeVoiceAcousticTokenizerFeatureExtractor)Úvibevoice_asrrV   )Úvoxtralr   )Úvoxtral_realtimeÚVoxtralRealtimeFeatureExtractor)Úwav2vec2r"   )zwav2vec2-bertr"   )zwav2vec2-conformerr"   )Úwavlmr"   )Úwhisperr   )Úxcodecr!   Ú
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)ÚFEATURE_EXTRACTOR_MAPPING_NAMESÚitemsr   Ú	importlibÚimport_moduleÚgetattrÚAttributeErrorÚFEATURE_EXTRACTOR_MAPPINGÚ_extra_contentÚvaluesÚhasattr)r_   Úmodule_nameÚ
extractorsÚmoduleÚ	extractorÚmain_modules         Úm/home/mande/repo/quber/.venv/lib/python3.13/site-packages/transformers/models/auto/feature_extraction_auto.pyÚ!feature_extractor_class_from_namert   b   sÅ   € Ü#B×#HÑ#HÖ#JÑˆØÕ#Ü3°KÓ@ˆKä×,Ò,¨q°°Ð->Ð@UÓVˆFðÜ˜vÓ2Ò2ñ $Kô /×=Ñ=×DÑDÖFˆ	Ü�9˜j¨$Ó/°:Õ=ØÒñ Gô ×)Ò)¨.Ó9€KÜˆ{×'Ñ'Ü�{Ó/Ð/àøô "ó Úðús   Á
CÃ
CÃCÚpretrained_model_name_or_pathÚ	cache_dirÚforce_downloadÚproxiesÚtokenÚrevisionÚlocal_files_onlyc                 ó   • [        U [        UUUUUUSSS9
n[        U [        UUUUUUSSS9
n	U	(       d  U(       d  [        R	                  S5        0 $ 0 n
Ub  [        U5      nSU;   a  US   n
U	b  U
c  [        U	5      n
U
$ )ae
  
Loads the feature extractor configuration from a pretrained model feature extractor 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
          [`~FeatureExtractionMixin.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.
    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.
    local_files_only (`bool`, *optional*, defaults to `False`):
        If `True`, will only try to load the feature extractor configuration from local files.

<Tip>

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

</Tip>

Returns:
    `Dict`: The configuration of the feature extractor.

Examples:

```python
# Download configuration from huggingface.co and cache.
feature_extractor_config = get_feature_extractor_config("facebook/wav2vec2-base-960h")
# This model does not have a feature extractor config so the result will be an empty dict.
feature_extractor_config = get_feature_extractor_config("FacebookAI/xlm-roberta-base")

# Save a pretrained feature extractor locally and you can reload its config
from transformers import AutoFeatureExtractor

feature_extractor = AutoFeatureExtractor.from_pretrained("facebook/wav2vec2-base-960h")
feature_extractor.save_pretrained("feature-extractor-test")
feature_extractor_config = get_feature_extractor_config("feature-extractor-test")
```F)	Úfilenamerv   rw   rx   ry   rz   r{   Ú _raise_exceptions_for_gated_repoÚ%_raise_exceptions_for_missing_entriesz:Could not locate the feature extractor configuration file.Úfeature_extractor)r   r   r
   ÚloggerÚinfor   )ru   rv   rw   rx   ry   rz   r{   ÚkwargsÚresolved_processor_fileÚresolved_feature_extractor_fileÚfeature_extractor_dictÚprocessor_dicts               rs   Úget_feature_extractor_configrˆ   z   s¾   € ôD *Ø%ÜØØ%ØØØØ)Ø).Ø.3ñÐô '2Ø%Ü'ØØ%ØØØØ)Ø).Ø.3ñ'Ð#ö +Ö3JÜ�‰ÐPÔQØˆ	ð
  ÐØÑ*Ü,Ð-DÓEˆØ .Ó0Ø%3Ð4GÑ%HÐ"à&Ñ2Ð7MÑ7UÜ!4Ð5TÓ!UÐØ!Ð!ó    c                   óX   • \ rS rSrSrS r\\" \5      S 5       5       r	\
SS j5       rSrg)	ÚAutoFeatureExtractoréè   a  
This is a generic feature extractor class that will be instantiated as one of the feature extractor classes of the
library when created with the [`AutoFeatureExtractor.from_pretrained`] class method.

This class cannot be instantiated directly using `__init__()` (throws an error).
c                 ó   • [        S5      e)Nz‹AutoFeatureExtractor is designed to be instantiated using the `AutoFeatureExtractor.from_pretrained(pretrained_model_name_or_path)` method.)ÚOSError)Úselfs    rs   Ú__init__ÚAutoFeatureExtractor.__init__ð   s   € Üðfó
ð 	
r‰   c                 óØ  • UR                  SS5      nUR                  SS5      nSUS'   [        R                  " U40 UD6u  pVUR                  SS5      nSnSUR                  S0 5      ;   a  US   S   nUcn  Uck  [	        U[
        5      (       d  [        R                  " U4SU0UD6n[        USS5      n[        US5      (       a  SUR                  ;   a  UR                  S   nUb  [        U5      nUSLn	USL=(       d    [        U5      [        ;   n
U
=(       a9    U=(       d    [        [        U5         R                  R                  S	5      (       + nU	(       a*  S
U;   a  UR!                  S
5      S   nOSn[#        XAX©U5      nU	(       aO  U(       aH  U(       dA  [%        X�40 UD6nUR                  SS5      nUR'                  5         UR                  " U40 UD6$ Ub  UR                  " U40 UD6$ [        U5      [        ;   a%  [        [        U5         nUR                  " U40 UD6$ [)        SU S[*         S[,         S[,         SSR/                  S [0         5       5       3
5      e)a
  
Instantiate one of the feature extractor classes of the library from a pretrained model vocabulary.

The feature extractor 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`):
        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 feature extractor file saved using the
          [`~feature_extraction_utils.FeatureExtractionMixin.save_pretrained`] method, e.g.,
          `./my_model_directory/`.
        - a path to a saved feature extractor JSON *file*, e.g.,
          `./my_model_directory/preprocessor_config.json`.
    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 AutoFeatureExtractor

>>> # Download feature extractor from huggingface.co and cache.
>>> feature_extractor = AutoFeatureExtractor.from_pretrained("facebook/wav2vec2-base-960h")

>>> # If feature extractor files are in a directory (e.g. feature extractor was saved using *save_pretrained('./test/saved_model/')*)
>>> # feature_extractor = AutoFeatureExtractor.from_pretrained("./test/saved_model/")
```ÚconfigNÚtrust_remote_codeTÚ
_from_autoÚfeature_extractor_typer‹   Úauto_mapztransformers.z--r   Úcode_revisionz"Unrecognized feature extractor in z4. Should have a `feature_extractor_type` key in its z of z3, or one of the following `model_type` keys in its z: z, c              3   ó$   #   • U  H  ov •  M     g 7f)N© )Ú.0Úcs     rs   Ú	<genexpr>Ú7AutoFeatureExtractor.from_pretrained.<locals>.<genexpr>s  s   é € Ð@lÒLkÀqÄÒLkùs   ‚)Úpopr   Úget_feature_extractor_dictÚgetÚ
isinstancer   r   Úfrom_pretrainedrh   rm   r—   rt   Útyperj   Ú
__module__Ú
startswithÚsplitr   r   Úregister_for_auto_classÚ
ValueErrorr
   r	   Újoinrd   )Úclsru   rƒ   r“   r”   Úconfig_dictÚ_Úfeature_extractor_classÚfeature_extractor_auto_mapÚhas_remote_codeÚhas_local_codeÚexplicit_local_codeÚupstream_repos                rs   r£   Ú$AutoFeatureExtractor.from_pretrainedö   sš  € ðL —‘˜H dÓ+ˆØ"ŸJ™JÐ':¸DÓAÐØ#ˆˆ|Ñä/×JÒJÐKhÑsÐlrÑs‰ˆØ"-§/¡/Ð2JÈDÓ"QÐØ%)Ð"Ø! [§_¡_°ZÀÓ%DÓDØ)4°ZÑ)@ÐAWÑ)XÐ&ð #Ñ*Ð/IÑ/QÜ˜fÔ&6×7Ñ7Ü#×3Ò3Ø1ñØEVðØZ`ñ�ô '.¨fÐ6NÐPTÓ&UÐ#Ü�v˜z×*Ñ*Ð/EÈÏÉÓ/XØ-3¯_©_Ð=SÑ-TÐ*à"Ñ.Ü&GÐH_Ó&`Ð#à4¸DÐ@ˆØ0¸Ð<×iÄÀVÃÔPiÑ@iˆØ,÷ 1Ø#×NÔ'@ÄÀfÃÑ'Nß
‰*—Z‘Z Ó0ô21Ðö ØÐ1Ó1Ø :× @Ñ @ÀÓ FÀqÑ I‘à $�Ü 9Ø!À.Ðcpó!Ðö Ö0Ö9LÜ&CØ*ñ'ØMSñ'Ð#ð —
‘
˜?¨DÓ1ˆAØ#×;Ñ;Ô=Ø*×:Ò:Ð;XÑcÐ\bÑcÐcØ$Ñ0Ø*×:Ò:Ð;XÑcÐ\bÑcÐcä�&‹\Ô6Ó6Ü&?ÄÀVÃÑ&MÐ#Ø*×:Ò:Ð;XÑcÐ\bÑcÐcäØ0Ð1NÐ0Oð P3Ü3IÐ2JÈ$Ì{Èmð \(Ü(3 }°B°t·y±yÑ@lÕLkÓ@lÓ7lÐ6mðoó
ð 	
r‰   c                 ó,   • [         R                  XUS9  g)a   
Register a new feature extractor for this class.

Args:
    config_class ([`PreTrainedConfig`]):
        The configuration corresponding to the model to register.
    feature_extractor_class ([`FeatureExtractorMixin`]): The feature extractor to register.
)Úexist_okN)rj   Úregister)Úconfig_classr®   r¶   s      rs   r·   ÚAutoFeatureExtractor.registerv  s   € ô 	"×*Ñ*¨<Ð[cÐ*Òdr‰   rš   N)F)rb   r¥   Ú__qualname__Ú__firstlineno__Ú__doc__r�   Úclassmethodr   rd   r£   Ústaticmethodr·   Ú__static_attributes__rš   r‰   rs   r‹   r‹   è   sH   † ñò
ð Ù&Ð'FÓGñ|
ó Hó ð|
ð| ó	eó ó	er‰   r‹   rj   )NFNNNF)'r¼   rf   ÚosÚcollectionsr   Úconfiguration_utilsr   Údynamic_module_utilsr   r   Úfeature_extraction_utilsr   Úutilsr	   r
   r   r   r   r   Úauto_factoryr   Úconfiguration_autor   r   r   r   Ú
get_loggerrb   r�   rd   rj   Ústrrt   ÚPathLikeÚboolÚdictrˆ   r‹   Ú__all__rš   r‰   rs   Ú<module>rÎ      s"  ðñ "ã Û 	Ý #õ 4ß \Ý >ß s× sÝ *÷ó ð 
×	Ò	˜HÓ	%€á"-ò7ó9#Ð ñv -Ð-AÐCbÓcÐ ð°#ô ð4 +/Ø Ø%)Ø#ØØ"ñk"Ø#&¨¯©Ñ#4ðk"à�R—[‘[Ñ  4Ñ'ðk"ð ðk"ð �#�s�(‰^˜dÑ"ð	k"ð
 �#‰:˜Ñðk"ð �D‰jðk"ð õk"÷\Xeñ Xeðv 'Ð(>Ð
?�r‰   