+
    œ°³jÅ,  ã                   ó~   € R t ^ RIt^RIHt ^RIHt ^RIHtH	t	H
t
 ]
P                  ! ]4      t ! R R]4      tR.tR# )z&
Feature extractor class for Wav2Vec2
N)ÚSequenceFeatureExtractor)ÚBatchFeature)ÚPaddingStrategyÚ
TensorTypeÚloggingc                   óx   a a€ ] tR t^t oRtRR.tR
V 3R llt]RV3R lR ll4       tRV3R lR llt	R	t
VtV ;t# )ÚWav2Vec2FeatureExtractoraº  
Constructs a Wav2Vec2 feature extractor.

This feature extractor inherits from [`~feature_extraction_sequence_utils.SequenceFeatureExtractor`] which contains
most of the main methods. Users should refer to this superclass for more information regarding those methods.

Args:
    feature_size (`int`, *optional*, defaults to 1):
        The feature dimension of the extracted features.
    sampling_rate (`int`, *optional*, defaults to 16000):
        The sampling rate at which the audio files should be digitalized expressed in hertz (Hz).
    padding_value (`float`, *optional*, defaults to 0.0):
        The value that is used to fill the padding values.
    do_normalize (`bool`, *optional*, defaults to `True`):
        Whether or not to zero-mean unit-variance normalize the input. Normalizing can help to significantly
        improve the performance for some models, *e.g.*,
        [wav2vec2-lv60](https://huggingface.co/models?search=lv60).
    return_attention_mask (`bool`, *optional*, defaults to `False`):
        Whether or not [`~Wav2Vec2FeatureExtractor.__call__`] should return `attention_mask`.

        <Tip>

        Wav2Vec2 models that have set `config.feat_extract_norm == "group"`, such as
        [wav2vec2-base](https://huggingface.co/facebook/wav2vec2-base-960h), have **not** been trained using
        `attention_mask`. For such models, `input_values` should simply be padded with 0 and no `attention_mask`
        should be passed.

        For Wav2Vec2 models that have set `config.feat_extract_norm == "layer"`, such as
        [wav2vec2-lv60](https://huggingface.co/facebook/wav2vec2-large-960h-lv60-self), `attention_mask` should be
        passed for batched inference.

        </Tip>Úinput_valuesÚattention_maskc           	     óL   <€ \         SV `  ! RR VRVRV/VB  W@n        WPn        R# )Úfeature_sizeÚsampling_rateÚpadding_valueN© )ÚsuperÚ__init__Úreturn_attention_maskÚdo_normalize)Úselfr   r   r   r   r   ÚkwargsÚ	__class__s   &&&&&&,€Úy/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/wav2vec2/feature_extraction_wav2vec2.pyr   Ú!Wav2Vec2FeatureExtractor.__init__@   s2   ø€ ô 	‰ÒÑw lÐwÀ-ÐwÐ_lÐwÐpvÒwØ%:Ô"Ø(Öó    c          	      óž   <€ V ^8„  d   QhRS[ S[P                  ,          RS[ S[P                  ,          RS[RS[ S[P                  ,          /# )é   r	   r
   r   Úreturn)ÚlistÚnpÚndarrayÚfloat)ÚformatÚ__classdict__s   "€r   Ú__annotate__Ú%Wav2Vec2FeatureExtractor.__annotate__N   sH   ø€ ÷ #ñ #Ù™2Ÿ:™:Õ&ð#Ù8<¹R¿Z¹ZÕ8Hð#ÙY^ð#á	‰b�j‰jÕ	ñ#r   c                óJ  € VeÅ   \         P                  ! V\         P                  4      p. p\        WP	                  R4      4       F}  w  rEWDRV P                  4       ,
          \         P                  ! VRV P                  4       R,           4      ,          pWVP                  ^ ,          8  d   W&VR% VP                  V4       K  	  V# V  Uu. uFI  qwVP                  4       ,
          \         P                  ! VP                  4       R,           4      ,          NKK  	  ppV# u upi )zK
Every array in the list is normalized to have zero mean and unit variance
NgH¯¼šò×z>éÿÿÿÿ)
r   ÚarrayÚint32ÚzipÚsumÚmeanÚsqrtÚvarÚshapeÚappend)r	   r
   r   Únormed_input_valuesÚvectorÚlengthÚnormed_sliceÚxs   &&&     r   Úzero_mean_unit_var_normÚ0Wav2Vec2FeatureExtractor.zero_mean_unit_var_normM   sù   € ð Ò%ÜŸXšX n´b·h±hÓ?ˆNØ"$Ðä"% l×4FÑ4FÀrÓ4JÖ"K‘�Ø &°°¨×)=Ñ)=Ó)?Õ ?Ä2Ç7Â7È6ÐRYÐSYÈ?×K^ÑK^ÓK`ÐcgÕKgÓChÕh�Ø×.Ñ.¨qÕ1Ô1Ø,9  Ð)à#×*Ñ*¨<Ö8ñ #Lð #Ð"ñ VbÓ"bÑUaÐPQ¨¯©«¥L´B·G²G¸A¿E¹E»GÀd½NÓ4K×#KÐ#KÑUaÐÐ"bà"Ð"ùò #cs   ÃAD c                ó^  <€ V ^8„  d   QhRS[ P                  S[S[,          ,          S[S[ P                  ,          ,          S[S[S[,          ,          ,          RS[S[,          S[,          RS[R,          RS[RS[R,          RS[R,          RS[S[,          R,          R	S[R,          R
S[	/	# )r   Ú
raw_speechÚpaddingÚ
max_lengthNÚ
truncationÚpad_to_multiple_ofr   Úreturn_tensorsr   r   )
r   r   r   r    ÚboolÚstrr   Úintr   r   )r!   r"   s   "€r   r#   r$   c   s¼   ø€ ÷ Iñ Iá—J‘J¡¡e¥Õ,©t±B·J±JÕ/?Õ?Á$ÁtÉEÅ{ÕBSÕSðIñ ™•™oÕ-ðIñ ˜$•Jð	Iñ
 ðIñ   $�JðIñ  $ d�{ðIñ ™jÕ(¨4Õ/ðIñ ˜T•zðIñ 
ñIr   c	                ó†  € Ve>   W€P                   8w  d-   \        RV  RV P                    RV P                    RV R2	4      hM-\        P                  RV P                  P
                   R24       \        V\        P                  4      ;'       d    \        VP                  4      ^8„  p
V
'       d)   \        VP                  4      ^8”  d   \        R	V  24      hT
;'       gK    \        V\        \        34      ;'       d-    \        V^ ,          \        P                  \        \        34      pV'       g   V.p\        R
V/4      pV P                  VVVVVVR7      pVR
,          p\        V^ ,          \        P                  4      '       g<   V Uu. uF)  p\        P                  ! V\        P                   R7      NK+  	  upVR
&   EM&\        V\        P                  4      '       g“   \        V^ ,          \        P                  4      '       dl   V^ ,          P"                  \        P"                  ! \        P$                  4      J d3   V Uu. uF!  qÿP'                  \        P                   4      NK#  	  upVR
&   Mt\        V\        P                  4      '       dU   VP"                  \        P"                  ! \        P$                  4      J d#   VP'                  \        P                   4      VR
&   VP)                  R4      pVe:   V Uu. uF)  p\        P                  ! V\        P*                  R7      NK+  	  upVR&   V P,                  '       dQ   V P/                  W#R7      \0        P2                  Jd   TMRpV P5                  VR
,          VV P6                  R7      VR
&   Ve   VP9                  V4      pV# u upi u upi u upi )a5  
Main method to featurize and prepare for the model one or several sequence(s).

Args:
    raw_speech (`np.ndarray`, `list[float]`, `list[np.ndarray]`, `list[list[float]]`):
        The sequence or batch of sequences to be padded. Each sequence can be a numpy array, a list of float
        values, a list of numpy arrays or a list of list of float values. Must be mono channel audio, not
        stereo, i.e. single float per timestep.
    padding (`bool`, `str` or [`~utils.PaddingStrategy`], *optional*, defaults to `False`):
        Select a strategy to pad the returned sequences (according to the model's padding side and padding
        index) among:

        - `True` or `'longest'`: Pad to the longest sequence in the batch (or no padding if only a single
          sequence if provided).
        - `'max_length'`: Pad to a maximum length specified with the argument `max_length` or to the maximum
          acceptable input length for the model if that argument is not provided.
        - `False` or `'do_not_pad'` (default): No padding (i.e., can output a batch with sequences of different
          lengths).
    max_length (`int`, *optional*):
        Maximum length of the returned list and optionally padding length (see above).
    truncation (`bool`):
        Activates truncation to cut input sequences longer than *max_length* to *max_length*.
    pad_to_multiple_of (`int`, *optional*):
        If set will pad the sequence to a multiple of the provided value.

        This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
        `>= 7.5` (Volta), or on TPUs which benefit from having sequence lengths be a multiple of 128.
    return_attention_mask (`bool`, *optional*):
        Whether to return the attention mask. If left to the default, will return the attention mask according
        to the specific feature_extractor's default.

        [What are attention masks?](../glossary#attention-mask)

        <Tip>

        Wav2Vec2 models that have set `config.feat_extract_norm == "group"`, such as
        [wav2vec2-base](https://huggingface.co/facebook/wav2vec2-base-960h), have **not** been trained using
        `attention_mask`. For such models, `input_values` should simply be padded with 0 and no
        `attention_mask` should be passed.

        For Wav2Vec2 models that have set `config.feat_extract_norm == "layer"`, such as
        [wav2vec2-lv60](https://huggingface.co/facebook/wav2vec2-large-960h-lv60-self), `attention_mask` should
        be passed for batched inference.

        </Tip>

    return_tensors (`str` or [`~utils.TensorType`], *optional*):
        If set, will return tensors instead of list of python integers. Acceptable values are:

        - `'pt'`: Return PyTorch `torch.Tensor` objects.
        - `'np'`: Return Numpy `np.ndarray` objects.
    sampling_rate (`int`, *optional*):
        The sampling rate at which the `raw_speech` input was sampled. It is strongly recommended to pass
        `sampling_rate` at the forward call to prevent silent errors.
    padding_value (`float`, *optional*, defaults to 0.0):
Nz3The model corresponding to this feature extractor: z& was trained using a sampling rate of zI. Please make sure that the provided `raw_speech` input was sampled with z	 and not Ú.zDIt is strongly recommended to pass the `sampling_rate` argument to `zN()`. Failing to do so can result in silent errors that might be hard to debug.z2Only mono-channel audio is supported for input to r	   )r9   r:   r;   r<   r   )Údtyper
   )r:   )r
   r   )r   Ú
ValueErrorÚloggerÚwarningr   Ú__name__Ú
isinstancer   r   Úlenr.   r   Útupler   ÚpadÚasarrayÚfloat32rC   Úfloat64ÚastypeÚgetr(   r   Ú_get_padding_strategiesr   Ú
DO_NOT_PADr5   r   Úconvert_to_tensors)r   r8   r9   r:   r;   r<   r   r=   r   r   Úis_batched_numpyÚ
is_batchedÚencoded_inputsÚpadded_inputsr	   r'   r
   s   &&&&&&&&&,       r   Ú__call__Ú!Wav2Vec2FeatureExtractor.__call__c   sI  € ðJ Ò$Ø× 2Ñ 2Ô2Ü ØIÈ$Èð PØ×*Ñ*Ð+ð ,Ø×*Ñ*Ð+¨9°]°OÀ1ðFóð ð 3ô �N‰NØVÐW[×WeÑWe×WnÑWnÐVoð p\ð \ôô
 & j´"·*±*Ó=×[Ð[Ä#Àj×FVÑFVÓBWÐZ[ÑB[Ðß¤ J×$4Ñ$4Ó 5¸Ô 9ÜÐQÐRVÐQWÐXÓYÐYØ%÷ 
ð 
Ü�z¤D¬% =Ó1×lÐl´zÀ*ÈQÅ-ÔRT×R\ÑR\Ô^cÔeiÐQjÓ7kð 	÷
 Ø$˜ˆJô & ~°zÐ&BÓCˆàŸ™ØØØ!Ø!Ø1Ø"7ð !ó 
ˆð % ^Õ4ˆÜ˜, q�/¬2¯:©:×6Ò6Ù^jÓ,kÑ^jÐUZ¬R¯ZªZ¸ÄRÇZÁZ×-PÑ^jÑ,kˆM˜.Ó)ä˜<¬¯©×4Ò4Ü˜<¨�?¬B¯J©J×7Ò7Ø˜Q•×%Ñ%¬¯ª´"·*±*Ó)=Ó=áS_Ó,`ÑS_È%¯\©\¼"¿*¹*Ö-EÑS_Ñ,`ˆM˜.Ò)Ü˜¤b§j¡j×1Ò1°l×6HÑ6HÌBÏHÊHÔUW×U_ÑU_ÓL`Ó6`Ø,8×,?Ñ,?ÄÇ
Á
Ó,KˆM˜.Ñ)ð '×*Ñ*Ð+;Ó<ˆØÒ%Ù^lÓ.mÑ^lÐUZ¬r¯zªz¸%ÄrÇxÁx×/PÑ^lÑ.mˆMÐ*Ñ+ð ××Ðð ×/Ñ/°Ð/ÓOÔWf×WqÑWqÓqñ àð ð
 -1×,HÑ,HØ˜nÕ-¸nÐ\`×\nÑ\nð -Ió -ˆM˜.Ñ)ð Ò%Ø)×<Ñ<¸^ÓLˆMàÐùò; -lùò -aùò /ns   Æ/N4É'N9Ì/N>)r   r   )é   i€>  ç        FT)r[   )FNFNNNN)rG   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úmodel_input_namesr   Ústaticmethodr5   rX   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r   r"   s   @@r   r   r      sI   ù‡ € ñðB (Ð)9Ð:Ð÷)ð ÷#ñ #ó ð#÷*I÷ Iò Ir   r   )r_   Únumpyr   Ú!feature_extraction_sequence_utilsr   Úfeature_extraction_utilsr   Úutilsr   r   r   Ú
get_loggerrG   rE   r   Ú__all__r   r   r   Ú<module>rk      sG   ðñó å IÝ 4ß 9Ñ 9ð 
×	Ò	˜HÓ	%€ôPÐ7ô Pðf &Ð
&‚r   