+
    œ°³jT.  ã                   óÜ   € ^ RI t ^ RIt^ RIt^ RIHu Ht ^RIH	t	 ^RI
Ht ^RIHt ^RIHtHtHt ^RIHt ]P(                  ! ]4      tRR R llt]! RR	7       ! R
 R]4      4       tR.tR# )é    N)Úmel_filter_bank)ÚSequenceFeatureExtractor)ÚBatchFeature)ÚPaddingStrategyÚ
TensorTypeÚlogging)Úrequiresc                óH   € V ^8„  d   QhR\         R\        R\         R\        /# )é   ÚvalueÚnameÚ	toleranceÚreturn)ÚfloatÚstrÚint)Úformats   "Úw/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/inkling/feature_extraction_inkling.pyÚ__annotate__r      s(   € ÷ ñ œð ¤cð ´eð Äsñ ó    c                 óz   € \        V 4      p\        W,
          4      V8”  d   \        V R V  24      h\        V4      # )z. must resolve to an integer sample count, got )ÚroundÚabsÚ
ValueErrorr   )r   r   r   Úroundeds   &&& r   Ú_to_exact_intr      s<   € Ü�E‹l€GÜ
ˆ5�?Ó˜iÔ'Ü˜D˜6Ð!OÐPUÈwÐWÓXÐXÜˆw‹<Ðr   )Úbackendsc                   óz   a a€ ] tR t^%t oRtRR.tRV3R lV 3R llltRV3R lR lltRV3R lR	 lltR
t	Vt
V ;t# )ÚInklingFeatureExtractora™  
Constructs a TML audio feature extractor, which converts raw audio waveforms into log-mel spectrogram
features (mel filterbank energies in log10 space). The quantization of these features into discrete
dMel bins is performed downstream by [`InklingProcessor`].

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 80):
        The feature dimension of the extracted features, i.e. the number of mel filterbanks.
    sampling_rate (`int`, *optional*, defaults to 16000):
        The sampling rate at which the audio files should be digitized, expressed in hertz (Hz).
    padding_value (`float`, *optional*, defaults to 0.0):
        The value used to pad the log-mel spectrograms to the same length in a batch.
    audio_token_duration_s (`float`, *optional*, defaults to 0.05):
        Duration, in seconds, represented by a single audio token, i.e. the STFT hop length.
    window_size_multiplier (`float`, *optional*, defaults to 2.0):
        Multiplier applied to `audio_token_duration_s` to obtain the STFT window length.
    n_fft (`int`, *optional*):
        FFT size. Defaults to the window length (`audio_token_duration_s * window_size_multiplier *
        sampling_rate`) when not provided.
Úinput_featuresÚinput_features_maskc                óL   <€ V ^8„  d   QhRS[ RS[ RS[RS[RS[RS[ R,          /# )r   Úfeature_sizeÚsampling_rateÚpadding_valueÚaudio_token_duration_sÚwindow_size_multiplierÚn_fftN)r   r   )r   Ú__classdict__s   "€r   r   Ú$InklingFeatureExtractor.__annotate__B   sS   ø€ ÷ +cñ +cáð+cñ ð+cñ ð	+cñ
 !&ð+cñ !&ð+cñ �T�zñ+cr   c           
     óÈ  <€ \         S	V `  ! RR VRVRV/VB  W@n        WPn        \	        WB,          R4      V n        \	        WE,          V,          R4      V n        T;'       g    V P                  V n        V P
                  ^ 8:  g#   V P                  ^ 8:  g   V P                  ^ 8:  d   \        R4      h\        P                  ! V P                  R\        P                  R7      V n        \        V P                  ^,          ^,           VRVR	,          VR
R
R7      p\        P                  ! \        P                   ! VP"                  \        P                  R7      4      V n        R# )r#   r$   r%   z&audio_token_duration_s * sampling_ratez?audio_token_duration_s * window_size_multiplier * sampling_ratez7hop_length, window_size, and n_fft must all be positiveT)ÚperiodicÚdtypeç        ç       @Úslaney)Únum_frequency_binsÚnum_mel_filtersÚmin_frequencyÚmax_frequencyr$   ÚnormÚ	mel_scale)r-   N© )ÚsuperÚ__init__r&   r'   r   Ú
hop_lengthÚwindow_sizer(   r   ÚtorchÚhann_windowÚfloat32Úwindowr   Ú
from_numpyÚnpÚascontiguousarrayÚTÚmel_filters)
Úselfr#   r$   r%   r&   r'   r(   ÚkwargsrD   Ú	__class__s
   &&&&&&&, €r   r9   Ú InklingFeatureExtractor.__init__B   s>  ø€ ô 	‰Òñ 	
Ø%ð	
à'ð	
ð (ð	
ð ò		
ð '=Ô#Ø&<Ô#ä'Ø"Õ2Ð4\ó
ˆŒô )Ø"Õ;¸mÕKØMó
ˆÔð ×.Ð.˜d×.Ñ.ˆŒ
Ø�?‰?˜aÔ 4×#3Ñ#3°qÔ#8¸D¿J¹JÈ!¼OÜÐVÓWÐWô ×'Ò'¨×(8Ñ(8À4ÌuÏ}É}Ô]ˆŒô &Ø#Ÿz™z¨Q�°Õ2Ø(ØØ'¨#Õ-Ø'ØØô
ˆô !×+Ò+¬B×,@Ò,@ÀÇÁÔVX×V`ÑV`Ô,aÓbˆÖr   c                óT   <€ V ^8„  d   QhRS[ P                  RS[RS[ P                  /# )r   ÚwaveformÚdevicer   )r<   ÚTensorr   )r   r)   s   "€r   r   r*   o   s-   ø€ ÷ (ñ (±e·l±lð (ÉCð (Ñ\a×\hÑ\hñ (r   c           
     óZ  € VP                  V4      p\        P                  ! VP                  R,          V P                  ,          4      V P                  ,          VP                  R,          ,
          p\        V P                  V P                  ,
          ^ 4      p\        P                  ! WV34      p\        P                  ! VV P                  V P                  V P                  V P                  P                  V4      RRR7      p\        P                  ! V4      pVP                  ^4      P                  R4      P!                  R4      P#                  4       pV P$                  P                  V4      pWv,          pVP!                  R4      P'                  4       pVP)                  ^^4      # )é   FT)r:   Ú
win_lengthr?   ÚcenterÚreturn_complexg»½×Ùß|Û=éÿÿÿÿ)ÚtoÚmathÚceilÚshaper:   Úmaxr(   ÚFÚpadr<   Ústftr;   r?   Úview_as_realÚpowÚsumÚ	clamp_minÚsqrtrD   Úlog10Ú	transpose)	rE   rJ   rK   Ú	right_padÚleft_padrZ   Ú
magnitudesrD   Úmel_specs	   &&&      r   Ú_torch_extract_fbank_featuresÚ5InklingFeatureExtractor._torch_extract_fbank_featureso   s@  € Ø—;‘;˜vÓ&ˆÜ—I’I˜hŸn™n¨RÕ0°4·?±?ÕBÓCÀdÇoÁoÕUÐX`×XfÑXfÐgiÕXjÕjˆ	Ü�t—z‘z D§O¡OÕ3°QÓ7ˆÜ—5’5˜¨iÐ#8Ó9ˆä�zŠzØØ�J‰JØ—‘Ø×'Ñ'Ø—;‘;—>‘> &Ó)ØØô
ˆô ×'Ò'¨Ó-ˆ
Ø—^‘^ AÓ&×*Ñ*¨2Ó.×8Ñ8¸Ó?×DÑDÓFˆ
à×&Ñ&×)Ñ)¨&Ó1ˆØÕ+ˆØ×%Ñ% eÓ,×2Ñ2Ó4ˆð ×!Ñ! ! QÓ'Ð'r   c                ór  <€ V ^8„  d   QhRS[ P                  S[S[,          ,          S[S[ P                  ,          ,          S[S[S[,          ,          ,          RS[R,          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_speechr$   NÚpaddingÚ
max_lengthÚ
truncationÚpad_to_multiple_ofÚreturn_attention_maskÚreturn_tensorsrK   r   )
rA   ÚndarrayÚlistr   r   Úboolr   r   r   r   )r   r)   s   "€r   r   r*   ˆ   s×   ø€ ÷ nCñ nCá—J‘J¡¡e¥Õ,©t±B·J±JÕ/?Õ?Á$ÁtÉEÅ{ÕBSÕSðnCñ ˜T•zðnCñ ™•™oÕ-ð	nCñ
 ˜$•JðnCñ ðnCñ   $�JðnCñ  $ d�{ðnCñ ™jÕ(¨4Õ/ðnCñ �d•
ðnCñ 
ñnCr   c
           	     óä  a€ Ve;   W P                   8w  d*   \        RV P                    RV P                    RV R24      hM\        P                  R4       V P                  P
                  oR V3R llp\        V\        P                  4      '       d   \        P                  ! V4      p\        V\        P                  4      '       d/   VP                  ^8”  d   \        RVP                   R	24      hV.pM¢\        V\        \        34      '       dm   \        V4      ^ 8X  d   \        R
4      h\        V^ ,          \         \"        \        P$                  \        P&                  34      '       d   V.pM&\        V4      pM\)        RS R\+        V4       24      hV Uu. uF  qÛ! V4      R,          NK  	  p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P0                  P3                  R4      pV P5                  VV	4      p\        P6                  ! VP8                  P;                  V	4      V P<                  ,           ^,
          V P<                  RR7      p\        P>                  ! VP@                  ^,          V	R7      R,          VR,          8  pVVPC                  R4      ,          pRV/pV'       d   VVR&   \-        VVR7      # u upi u upi )ay  
Extract log-mel spectrogram features from one or several audio clip(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 at `self.sampling_rate`, not stereo, i.e. single float per timestep. Decoding
        and resampling of raw audio (bytes / paths / URLs) is handled upstream by the processor's
        `apply_chat_template`, not here.
    sampling_rate (`int`, *optional*):
        The sampling rate of `raw_speech`, used only to validate against `self.sampling_rate`.
    device (`str`, *optional*, defaults to `"cpu"`):
        The device on which the log-mel spectrogram is computed in `_torch_extract_fbank_features`.
zWThe model corresponding to this feature extractor was trained using a sampling rate of zB. Please make sure that the provided audio input was sampled with z	 and not Ú.z›It is strongly recommended to pass the `sampling_rate` argument to this function. Failing to do so can result in silent errors that might be hard to debug.c                ó<   € V ^8„  d   QhRRR\         P                  /# )r   Úclipz np.ndarray | torch.Tensor | listr   )r<   rL   )r   s   "r   r   Ú6InklingFeatureExtractor.__call__.<locals>.__annotate__³   s   € ÷ 	ñ 	Ð=ð 	Ä%Ç,Á,ñ 	r   c                 óÀ  <€ \        V \        P                  4      '       d   T M)\        P                  ! \        P
                  ! V 4      4      pVP                  \        P                  4      pVP                  ^8X  d.   \        P                  RS R24       VP                  RR7      pV# VP                  ^8w  d#   \        R\        VP                  4       R24      hV# )r   z2Only mono-channel audio is supported for input to zB. Taking the mean over the channel (last) axis to convert to mono.)ÚdimzDEach audio clip must be 1-D (mono) or 2-D (multichannel), got shape rt   rR   )Ú
isinstancer<   rL   Ú	as_tensorrA   ÚasarrayrS   r>   ÚndimÚloggerÚwarning_onceÚmeanr   ÚtuplerV   )rv   ÚtensorÚcls_names   & €r   Ú_to_monoÚ2InklingFeatureExtractor.__call__.<locals>._to_mono³   sÆ   ø€ Ü'¨¬e¯l©l×;Ò;‘TÄÇÂÔQS×Q[ÒQ[Ð\`ÓQaÓAbˆFØ—Y‘YœuŸ}™}Ó-ˆFØ�{‰{˜aÔÜ×#Ñ#ØHÈÈ
ð SWð Wôð  Ÿ™¨˜Ó,�ð
 ˆMð	 —‘ Ô!Ü ØZÔ[`Ðag×amÑamÓ[nÐZoÐopÐqóð ð ˆMr   zCA single array input must be 1-D (mono) or 2-D (multichannel); got z2 dims. Pass a list of arrays for a batch of clips.zReceived an empty audio input.z!Unsupported audio input type for z: r    Úaudio_lengthsÚpt)rj   rk   rl   rm   ro   Úfloor)Úrounding_mode)rK   r!   )ÚdataÚtensor_type)ºNNNNrR   )NrŒ   )"r$   r   r~   r   rG   Ú__name__rz   rA   rp   r<   r@   rL   r}   rq   r�   Úlenr   r   ÚintegerÚfloatingÚ	TypeErrorÚtyper   rY   r    Úsqueezerf   Údivr†   rS   r:   ÚarangerV   Ú	unsqueeze)rE   ri   r$   rj   rk   rl   rm   rn   ro   rK   rF   r„   Úclipsrv   Úspeechr†   Úbatched_speechÚpadded_inputsÚinput_waveformsr    Ú
num_framesr!   rŠ   rƒ   s   &&&&&&&&&&,            @r   Ú__call__Ú InklingFeatureExtractor.__call__ˆ   sÊ  ø€ ð8 Ò$Ø× 2Ñ 2Ô2Ü ðØ#×1Ñ1Ð2ð 3(Ø(,×(:Ñ(:Ð';¸9À]ÀOÐSTðVóð ð 3ô ×Ñð\ôð
 —>‘>×*Ñ*ˆ÷	ð 	ô �j¤"§*¡*×-Ò-Ü×)Ò)¨*Ó5ˆJÜ�j¤%§,¡,×/Ò/à�‰ Ô"Ü ØYÐZd×ZiÑZiÐYjð kBð Bóð ð  �L‰EÜ˜
¤T¬5 M×2Ò2Ü�:‹ !Ô#Ü Ð!AÓBÐBä˜* Q�-¬#¬u´b·j±jÄ"Ç+Á+Ð)N×OÒOØ#˜‘ä˜ZÓ(‘äÐ?À¸zÈÌDÐQ[ÓL\ÐK]Ð^Ó_Ð_á:?Ó@¹%°$�h˜t“n W×-Ð-¹%ˆ
Ð@ñ 4>Ó>±:¨œ˜Vž±:ˆÐ>Ü%Ð'7¸À_ÐVcÐ&dÓeˆØŸ™ØØØ!Ø!Ø1Øð !ó 
ˆð (×6Ñ6×>Ñ>¸rÓBˆà×;Ñ;¸OÈVÓTˆô —Y’YØ×'Ñ'×*Ñ*¨6Ó2°T·_±_ÕDÀqÕHÈ$Ï/É/Ðipô
ˆ
ô $Ÿlšl¨>×+?Ñ+?ÀÕ+BÈ6ÔRÐSZÕ[Ð^hÐipÕ^qÑqÐØ'Ð*=×*GÑ*GÈÓ*KÕKˆà  .Ð1ˆß ð +>ˆDÐ&Ñ'Ü °>ÔBÐBùò? Aùò ?s   ÆK(Æ;K-)r&   r:   rD   r(   r?   r;   r'   )éP   i€>  r.   gš™™™™™©?r/   N)Úcpu)NTNFNTNr    )r�   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úmodel_input_namesr9   rf   r�   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)rG   r)   s   @@r   r   r   %   sD   ù‡ € ñð2 *Ð+@ÐAÐ÷+cõ +c÷Z(ò (÷2nC÷ nCò nCr   r   )g�íµ ÷Æ°>)r<   )rT   ÚnumpyrA   r<   Útorch.nn.functionalÚnnÚ
functionalrX   Úaudio_utilsr   Ú!feature_extraction_sequence_utilsr   Úfeature_extraction_utilsr   Úutilsr   r   r   Úutils.import_utilsr	   Ú
get_loggerr�   r~   r   r   Ú__all__r7   r   r   Ú<module>r´      sq   ðó ã Û ß Ð å *Ý IÝ 4ß 9Ñ 9Ý *ð 
×	Ò	˜HÓ	%€÷ñ 
�:ÔôPCÐ6ó PCó ðPCðf %Ð
%‚r   