+
    œ°³j63  ã                   óî   € ^ RI t^RIHt ^RIHt ^RIHtHtH	t	H
t
 ^RIHt ]	! 4       '       d   ^ RIt]! 4       '       d   ^ RItRtR
t]
P"                  ! ]4      t]! RR7       ! R R	]4      4       tR	.tR# )é    N)ÚSequenceFeatureExtractor)ÚBatchFeature)Ú
TensorTypeÚis_librosa_availableÚis_torch_availableÚlogging)Úrequiresgñhãˆµøä>)Úbackendsc                   ób   a a€ ] tR t^%t oRtRR.tR	V 3R lltR
R ltRV3R lR lltRt	Vt
V ;t# )ÚParakeetFeatureExtractoraB  
Constructs a Parakeet 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.

This class extracts mel-filter bank features from raw speech using a custom numpy implementation of the `Short Time
Fourier Transform` which should match pytorch's `torch.stft` equivalent.

Args:
    feature_size (`int`, *optional*, defaults to 80):
        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).
    hop_length (`int`, *optional*, defaults to 160):
        Length of the overlapping windows for the STFT used to obtain the Mel Frequency coefficients.
    n_fft (`int`, *optional*, defaults to 512):
        Size of the Fourier transform.
    win_length (`int`, *optional*, defaults to 400):
        The window length for the STFT computation.
    preemphasis (`float`, *optional*, defaults to 0.97):
        A preemphasis filter coefficient. 0.0 means no preemphasis filter.
    padding_value (`float`, *optional*, defaults to 0.0):
        Padding value used to pad the audio. Should correspond to silences.
Úinput_featuresÚattention_maskc           	     ó*  <€ \         S
V `  ! RR VRVRV/VB  W0n        W@n        WPn        W`n        \        P                  P                  W$VRV^,          RR7      p	\        P                  ! V	4      P                  \        P                  4      V n        R# )Úfeature_sizeÚsampling_rateÚpadding_valueç        Úslaney)ÚsrÚn_fftÚn_melsÚfminÚfmaxÚnormN© )ÚsuperÚ__init__Ú
hop_lengthr   Ú
win_lengthÚpreemphasisÚlibrosaÚfiltersÚmelÚtorchÚ
from_numpyÚtoÚfloat32Úmel_filters)Úselfr   r   r   r   r   r    r   Úkwargsr(   Ú	__class__s   &&&&&&&&, €Úy/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/parakeet/feature_extraction_parakeet.pyr   Ú!ParakeetFeatureExtractor.__init__C   sŒ   ø€ ô 	‰ÒÑw lÐwÀ-ÐwÐ_lÐwÐpvÒwà$ŒØŒ
Ø$ŒØ&Ôô —o‘o×)Ñ)Ø°,ÀSÈ}Ð_`ÕO`Ðgoð *ó 
ˆô !×+Ò+¨KÓ8×;Ñ;¼E¿M¹MÓJˆÖó    c           
     ó&  € \         P                  ! V P                  R VR7      p\         P                  ! VV P                  V P
                  V P                  VRRR7      p\         P                  ! V4      p\         P                  ! VP                  ^4      P                  R4      4      pVP                  ^4      pV P                  P                  V4      pWe,          p\         P                  ! V\        ,           4      pVP                  ^ ^^4      pV# )F)ÚperiodicÚdeviceTÚconstant)r   r   ÚwindowÚreturn_complexÚpad_modeéÿÿÿÿ)r$   Úhann_windowr   Ústftr   r   Úview_as_realÚsqrtÚpowÚsumr(   r&   ÚlogÚLOG_ZERO_GUARD_VALUEÚpermute)r)   Úwaveformr1   r3   r8   Ú
magnitudesr(   Úmel_specs   &&&     r,   Ú_torch_extract_fbank_featuresÚ6ParakeetFeatureExtractor._torch_extract_fbank_featurese   sÚ   € ä×"Ò" 4§?¡?¸UÈ6ÔRˆÜ�zŠzØØ�J‰JØ—‘Ø—‘ØØØô
ˆô ×'Ò'¨Ó-ˆ
Ü—Z’Z 
§¡¨qÓ 1× 5Ñ 5°bÓ 9Ó:ˆ
Ø—^‘^ AÓ&ˆ
ð ×&Ñ&×)Ñ)¨&Ó1ˆØÕ+ˆÜ—9’9˜XÔ(<Õ<Ó=ˆð ×#Ñ# A q¨!Ó,ˆàˆr.   c                óˆ  <€ V ^8„  d   QhRS[ P                  S[S[,          ,          S[S[ P                  ,          ,          S[S[S[,          ,          ,          RS[RS[R,          RS[S[,          R,          RS[R,          RS[R,          RS[R,          R	S[R,          R
S[R,          RS[R,          RS[R,          RS[/# )é   Ú
raw_speechÚ
truncationÚpad_to_multiple_ofNÚreturn_tensorsÚreturn_attention_maskÚpaddingÚ
max_lengthr   Údo_normalizer1   Úreturn_token_timestampsÚreturn)	ÚnpÚndarrayÚlistÚfloatÚboolÚintÚstrr   r   )ÚformatÚ__classdict__s   "€r,   Ú__annotate__Ú%ParakeetFeatureExtractor.__annotate__�   sä   ø€ ÷ [
ñ [
á—J‘J¡¡e¥Õ,©t±B·J±JÕ/?Õ?Á$ÁtÉEÅ{ÕBSÕSð[
ñ ð[
ñ   $�Jð	[
ñ
 ™jÕ(¨4Õ/ð[
ñ  $ d�{ð[
ñ �t•ð[
ñ ˜$•Jð[
ñ ˜T•zð[
ñ ˜T•kð[
ñ �d•
ð[
ñ "&¨¥ð[
ñ 
ñ[
r.   c                óê
  € VeR   W€P                   8w  dA   \        RV P                  P                   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   \        P                  ! V4      pMh\        V\        \        34      '       dM   \        V^ ,          \        P                  4      '       d&   V Uu. uF  p\        P                  ! V4      NK  	  pp\        V\        P                  4      ;'       d    \        VP                  4      ^8„  pV'       dY   \        VP                  4      ^8”  d?   \        P                  R	V P                  P                   R
24       VP!                  R4      p\        V\        \        34      pV'       dd   V F]  p\        VP                  4      ^8”  g   K  \        P                  R	V P                  P                   R
24       VP!                  R4      pK_  	  V'       g	   V'       d6   V Uu. uF(  qÝR,          P#                  \        P$                  4      NK*  	  ppM'VR,          P#                  \        P$                  4      .pV Uu. uF  p\        V4      NK  	  pp\'        RVRV/4      pV P)                  VVVVVRR7      pVP*                  P-                  R4      pV P.                  e½   \        P0                  ! VP                  ^,          VP2                  R7      P5                  ^ 4      VP6                  P5                  ^4      8  p\        P8                  ! VR,          VR,          V P.                  VRRR13,          ,          ,
          .^R7      pVP;                  V( R4      pV P=                  VV
4      p\        P>                  ! VP6                  V P@                  ^,          ^,          ,           V P@                  ,
          V PB                  4      p\        P0                  ! VP                  ^,          V
R7      R,          VR,          8  pVP5                  R4      pVV,          pVPE                  ^R7      VP5                  R4      ,          pVP5                  ^4      pVV,
          ^,          V,          PE                  ^R7      V^,
          P5                  R4      ,          p\        PF                  ! V4      P5                  ^4      pVV,
          V\H        ,           ,          pVV,          p\'        RVRV/VR7      # u upi u upi u upi )až  
Main method to featurize and prepare for the model one or several sequence(s). Implementation uses PyTorch for
the STFT computation if available, otherwise a slower NumPy based one.

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.
    truncation (`bool`, *optional*, default to `True`):
        Activates truncation to cut input sequences longer than *max_length* to *max_length*.
    pad_to_multiple_of (`int`, *optional*, defaults to None):
        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>

        For Parakeet models, `attention_mask` should always be passed for batched inference, to avoid subtle
        bugs.

        </Tip>

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

        - `'tf'`: Return TensorFlow `tf.constant` objects.
        - `'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 and allow automatic speech recognition
        pipeline.
    padding_value (`float`, *optional*, defaults to 0.0):
        The value that is used to fill the padding values / vectors.
    do_normalize (`bool`, *optional*, defaults to `False`):
        Whether or not to zero-mean unit-variance normalize the input. Normalizing can help to significantly
        improve the performance of the model.
    device (`str`, *optional*, defaults to `'cpu'`):
        Specifies the device for computation of the log-mel spectrogram of audio signals in the
        `_torch_extract_fbank_features` method. (e.g., "cpu", "cuda")
    return_token_timestamps (`bool`, *optional*, defaults to `None`):
        Deprecated. Use `return_attention_mask` instead from which the number of frames can be inferred.

        Whether or not to return the number of frames of the input raw_speech.
        These num_frames can be used by the model to compute word level timestamps.
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 z;. We will take the mean of the channels to convert to mono.ºNNNr   Úaudio_lengthsÚpt)rL   rM   rH   rI   rJ   )r1   )Údimr   r   )ÚdataÚtensor_typer6   )r^   N)r^   :Né   N)r^   :rd   NN)Nr^   )%r   Ú
ValueErrorr+   Ú__name__ÚloggerÚwarningÚ
isinstancerQ   rR   r$   ÚtensorrS   ÚtupleÚTensorÚlenÚshapeÚmeanr&   r'   r   Úpadr   Úsqueezer    Úaranger1   Ú	unsqueezer_   ÚcatÚmasked_fillrC   Úfloor_divider   r   r<   r:   ÚEPSILON)r)   rG   rH   rI   rJ   rK   rL   rM   r   rN   r1   rO   r*   ÚspeechÚis_batched_torchÚis_batched_sequencer_   Úbatched_speechÚpadded_inputsr   ÚtimemaskÚfeatures_lengthsr   ÚmaskÚinput_features_maskedro   ÚvarianceÚstds   &&&&&&&&&&&&,               r,   Ú__call__Ú!ParakeetFeatureExtractor.__call__�   s¼  € ðH Ò$Ø× 2Ñ 2Ô2Ü ØIÈ$Ï.É.×JaÑJaÐIbð c)Ø)-×);Ñ);Ð(<ð =)Ø)-×);Ñ);Ð(<¸IÀmÀ_ÐTUðWóð ð 3ô �N‰NØVÐW[×WeÑWe×WnÑWnÐVoð p\ð \ôô �j¤"§*¡*×-Ò-ÜŸš jÓ1‰JÜ˜
¤T¬5 M×2Ò2´zÀ*ÈQÅ-ÔQS×Q[ÑQ[×7\Ò7\Ù=GÓH¹Z°6œ%Ÿ,š, vÖ.¹ZˆJÐHä% j´%·,±,Ó?×]Ð]ÄCÈ
×HXÑHXÓDYÐ\]ÑD]Ðß¤ J×$4Ñ$4Ó 5¸Ô 9Ü�N‰NØDÀTÇ^Á^×E\ÑE\ÐD]ð ^Lð Lôð $Ÿ™¨Ó,ˆJä(¨´d¼E°]ÓCÐßÛ$�Ü�v—|‘|Ó$ qÖ(Ü—N‘NØLÈTÏ^É^×MdÑMdÐLeð fTð Tôð $Ÿ[™[¨›_’Fñ %÷ ×2ÙJTÓUÉ*À �/×,Ñ,¬U¯]©]Ö;É*ˆJÐUˆJà$ WÕ-×0Ñ0´·±Ó?Ð@ˆJá3=Ó>±:¨œ˜Vž±:ˆÐ>Ü%Ð'7¸À_ÐVcÐ&dÓeˆàŸ™ØØØ!Ø!Ø1Øð !ó 
ˆð '×5Ñ5×=Ñ=¸bÓAˆð ×ÑÒ'Ü—|’| N×$8Ñ$8¸Õ$;ÀN×DYÑDYÔZ×dÑdØóà×+Ñ+×5Ñ5°aÓ8ñ9ˆHô #ŸYšYØ Õ&¨°uÕ(=À×@PÑ@PÐSaÐbcÐehÐfhÐehÐbhÕSiÕ@iÕ(iÐjÐpqôˆNð ,×7Ñ7¸¸	À3ÓGˆNà×;Ñ;¸NÈFÓSˆÜ ×-Ò-Ø×'Ñ'¨$¯*©*¸­/¸AÕ*=Õ=ÀÇ
Á
ÕJÈDÏOÉOó
Ðô Ÿš n×&:Ñ&:¸1Õ&=ÀfÔMÈgÕVÐYiÐjqÕYrÑrˆð ×'Ñ'¨Ó+ˆØ .°Õ 5ÐØ$×(Ñ(¨QÐ(Ó/Ð2B×2LÑ2LÈRÓ2PÕPˆØ�~‰~˜aÓ ˆØ*¨TÕ1°aÕ7¸$Õ>×CÑCÈÐCÓJÐN^ÐabÕNb×MmÑMmÐnpÓMqÕqˆÜ�jŠj˜Ó"×,Ñ,¨QÓ/ˆØ(¨4Õ/°C¼'µMÕBˆØ˜$Õˆäà  .Ø  .ðð 'ô
ð 	
ùòA Iùò* Vùò ?s   ÄU&É.U+Ê-U0)r   r(   r   r    r   )éP   i€>  é    i   i�  g
×£p=
ï?r   )Úcpu)
FNNNÚlongestNNNr‡   N)rf   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úmodel_input_namesr   rC   rƒ   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r+   rY   s   @@r,   r   r   %   s6   ù‡ € ñð4 *Ð+;Ð<Ð÷ KôD÷8[
÷ [
ò [
r.   r   g      p>)r$   r!   )ÚnumpyrQ   Ú!feature_extraction_sequence_utilsr   Úfeature_extraction_utilsr   Úutilsr   r   r   r   Úutils.import_utilsr	   r$   r!   rw   r>   Ú
get_loggerrf   rg   r   Ú__all__r   r.   r,   Ú<module>r˜      s‚   ðó å IÝ 4ß RÓ RÝ *ñ ×ÒÛá×ÒÛð €ØÐ ð 
×	Ò	˜HÓ	%€ñ 
Ð'Ô(ôv
Ð7ó v
ó )ðv
ðr &Ð
&‚r.   