+
    œ°³jêK  ã                   óˆ   € R t ^ RIt^RIHtHt ^RIHtHt ^RI	H
t
HtHtHtHt ]P                  ! ]4      t ! R R]4      tR# )zZ
Sequence feature extraction class for common feature extractors to preprocess sequences.
N)Úis_valid_audioÚ
load_audio)ÚBatchFeatureÚFeatureExtractionMixin)ÚPaddingStrategyÚ
TensorTypeÚis_torch_tensorÚloggingÚto_numpyc                   óÀ   a a€ ] tR t^t oRtV3R lV 3R lltRV3R lR lltR]P                  RR3V3R lR llt	RV3R	 lR
 llt
RR ltRV3R lR lltRtVtV ;t# )ÚSequenceFeatureExtractora}  
This is a general feature extraction class for speech recognition.

Args:
    feature_size (`int`):
        The feature dimension of the extracted features.
    sampling_rate (`int`):
        The sampling rate at which the audio files should be digitalized expressed in hertz (Hz).
    padding_value (`float`):
        The value that is used to fill the padding values / vectors.
c                ó,   <€ V ^8„  d   QhRS[ RS[ RS[/# )é   Úfeature_sizeÚsampling_rateÚpadding_value)ÚintÚfloat)ÚformatÚ__classdict__s   "€Úo/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/feature_extraction_sequence_utils.pyÚ__annotate__Ú%SequenceFeatureExtractor.__annotate__)   s"   ø€ ÷ #ñ #¡Sð #¹ð #ÉUñ #ó    c                ó¨   <€ Wn         W n        W0n        VP                  R R4      V n        VP                  RR4      V n        \        SV `  ! R/ VB  R# )Úpadding_sideÚrightÚreturn_attention_maskTN© )r   r   r   Úpopr   r   ÚsuperÚ__init__)Úselfr   r   r   ÚkwargsÚ	__class__s   &&&&,€r   r!   Ú!SequenceFeatureExtractor.__init__)   sL   ø€ Ø(ÔØ*ÔØ*Ôà"ŸJ™J ~°wÓ?ˆÔØ%+§Z¡ZÐ0GÈÓ%NˆÔ"ä‰ÒÑ"˜6Ô"r   Nc                ód  <€ V ^8„  d   QhRS[ S[S[ ,          ,          S[S[S[ 3,          ,          S[S[S[S[ ,          3,          ,          S[S[S[S[ 3,          ,          ,          RS[S[,          S[,          RS[R,          RS[RS[R,          RS[R,          RS[S[,          R,          R	S[ /# )
r   Úprocessed_featuresÚpaddingÚ
max_lengthNÚ
truncationÚpad_to_multiple_ofr   Úreturn_tensorsÚreturn)r   ÚlistÚdictÚstrÚboolr   r   r   )r   r   s   "€r   r   r   3   sß   ø€ ÷ kGñ kGá(Ù
‰|Õ
õá
‰s‘LÐ Õ
!õ"ñ ‰s‘D™Õ&Ð&Õ
'õ(ñ ‰t‘C™Ð%Õ&Õ
'õ	(ðkGñ ™•™oÕ-ðkGñ ˜$•JðkGñ ðkGñ   $�JðkGñ  $ d�{ðkGñ ™jÕ(¨4Õ/ðkGñ 
ñkGr   c           
     ó0	  a a€ \        V\        \        34      '       db   \        V^ ,          \        \        34      '       d?   V^ ,          P                  4        UU	u/ uF  qˆV U	u. uF  q™V,          NK  	  up	bK  	  ppp	S P                  ^ ,          V9  d:   \        RS P                  ^ ,           R\        VP                  4       4       24      hVS P                  ^ ,          ,          p
Ve   TMS P                  p\        V
4      ^ 8X  d   V'       d   . VR&   V# V
^ ,          p\        V\        \        34      '       dC   ^ p\        W¬,          4      ^ 8X  d   V^,          pK!  V\        V
4      8  d   W¬,          ^ ,          pVfh   \        V4      '       d   RpMS\        V\        \        \        \        \        P                  34      '       d   RpM\        RV R\        V4       R24      hVP!                  4        Fv  w  r�\        V^ ,          \        \        34      '       d   \#        V4      W&   K7  \        V\        P                  4      '       d   KY  V Uu. uF  p\#        V4      NK  	  upW&   Kx  	  S P%                  W#R	7      pVS P                  ^ ,          ,          p
\        V
4      o\&        ;QJ d-    V3R
 lVP)                  4        4       F  '       d   K   RM"	  RM! V3R
 lVP)                  4        4       4      '       g   \        R4      h. p\+        S4       FU  pVP!                  4        UUu/ uF  w  ppVVV,          bK  	  pppS P-                  VVVVR7      pVP/                  V4       KW  	  V\0        P2                  8X  d&   \5        V 3R lV 4       4      p\0        P6                  p/ p\+        S4       F®  pS P9                  VV,          VVVVR7      pVP!                  4        Fz  w  r�VV9  d   . VV&   VP:                  \        P:                  ! \        P<                  4      J d    VP?                  \        P@                  4      pVV,          P/                  V4       K|  	  K°  	  \	        VVR7      # u up	i u up	pi u upi u uppi )aÚ  
Pad input values / input vectors or a batch of input values / input vectors up to predefined length or to the
max sequence length in the batch.

Padding side (left/right) padding values are defined at the feature extractor level (with `self.padding_side`,
`self.padding_value`)

<Tip>

If the `processed_features` passed are dictionary of numpy arrays or PyTorch tensors  the
result will use the same type unless you provide a different tensor type with `return_tensors`. In the case of
PyTorch tensors, you will lose the specific device of your tensors however.

</Tip>

Args:
    processed_features ([`BatchFeature`], list of [`BatchFeature`], `dict[str, list[float]]`, `dict[str, list[list[float]]` or `list[dict[str, list[float]]]`):
        Processed inputs. Can represent one input ([`BatchFeature`] or `dict[str, list[float]]`) or a batch of
        input values / vectors (list of [`BatchFeature`], *dict[str, list[list[float]]]* or *list[dict[str,
        list[float]]]*) so you can use this method during preprocessing as well as in a PyTorch Dataloader
        collate function.

        Instead of `list[float]` you can have tensors (numpy arrays or PyTorch tensors),
        see the note above for the return type.
    padding (`bool`, `str` or [`~utils.PaddingStrategy`], *optional*, defaults to `True`):
        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)
    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.
z�You should supply an instance of `transformers.BatchFeature` or list of `transformers.BatchFeature` to this method that includes z, but you provided Úattention_maskÚptÚnpztype of z
 unknown: z6. Should be one of a python, numpy, or pytorch object.)r(   r)   c              3   ó@   <"  € T F  p\        V4      S8H  x € K  	  R # 5i©N)Úlen)Ú.0ÚvÚ
batch_sizes   & €r   Ú	<genexpr>Ú/SequenceFeatureExtractor.pad.<locals>.<genexpr>¸   s   øé € ÐMÑ1L¨A”3�q“6˜ZÖ'Ó1Lùs   ƒFTzLSome items in the output dictionary have a different batch size than others.)r)   r+   r*   c              3   ój   <"  € T F(  p\        VSP                  ^ ,          ,          4      x € K*  	  R# 5i)é    N)r8   Úmodel_input_names)r9   Úinput_slicer"   s   & €r   r<   r=   É   s+   øé € ÐmÑ\lÈ[œS ¨T×-CÑ-CÀAÕ-FÕ!G×HÐHÓ\lùs   ƒ03)r)   Úpadding_strategyr+   r   )Útensor_type)!Ú
isinstancer.   Útupler/   r   Úkeysr@   Ú
ValueErrorr   r8   r   r   r   r5   ÚndarrayÚtypeÚitemsr
   Ú_get_padding_strategiesÚallÚvaluesÚrangeÚ	_truncateÚappendr   ÚLONGESTÚmaxÚ
MAX_LENGTHÚ_padÚdtypeÚfloat64ÚastypeÚfloat32)r"   r'   r(   r)   r*   r+   r   r,   ÚkeyÚexampleÚrequired_inputÚfirst_elementÚindexÚvaluer:   rB   Útruncated_inputsÚiÚkÚinputsÚinputs_sliceÚbatch_outputsÚoutputsr;   s   f&&&&&&&               @r   ÚpadÚSequenceFeatureExtractor.pad3   s!  ù€ ôL Ð(¬4´¨-×8Ò8¼ZÐHZÐ[\ÕH]Ô`dÔfrÐ_s×=tÒ=tð RdÐdeÕQf×QkÑQkÔQmô"ÙQmÈ#Ñ2DÓEÑ2D w˜c—l�lÑ2DÑEÒEÑQmð ñ "ð
 ×!Ñ! !Õ$Ð,>Ô>Üð1Ø15×1GÑ1GÈÕ1JÐ0Kð LÜÐ+×0Ñ0Ó2Ó3Ð4ð6óð ð ,¨D×,BÑ,BÀ1Õ,EÕFˆà%:Ò%FÑ!ÈD×LfÑLfð 	ô ˆ~Ó !Ô#ß$Ø79Ð"Ð#3Ñ4Ø%Ð%ð ' qÕ)ˆÜ�m¤d¬E ]×3Ò3àˆEÜ�nÕ+Ó,°Ô1Ø˜•
’Ø”s˜>Ó*Ô*Ø .Õ 5°aÕ 8�àÒ!Ü˜}×-Ò-Ø!%‘Ü˜M¬C´¼¼eÄRÇZÁZÐ+P×QÒQØ!%‘ä Ø˜}˜o¨Z¼¸]Ó8KÐ7Lð MKð Kóð ð
 -×2Ñ2Ö4‰JˆCÜ˜% �(¤S¬% L×1Ò1Ü*2°5«/Ð"Ó'Ü ¤r§z¡z×2Ô2ñ AFÓ*FÁ¸1¬8°A®;ÁÑ*FÐ"Ó'ñ 5ð  ×7Ñ7ÀÐ7Ó_Ðà+¨D×,BÑ,BÀ1Õ,EÕFˆä˜Ó(ˆ
ß‹sÔMÐ1C×1JÑ1JÔ1LÓM�s�sŠsÔMÐ1C×1JÑ1JÔ1LÓM×MÒMÜÐkÓlÐlàÐÜ�zÖ"ˆAØ*<×*BÑ*BÔ*DÔEÑ*D¡$ ! Q�a˜˜1�’gÑ*DˆFÑEàŸ>™>ØØ%Ø#5Ø%ð	 *ó ˆLð ×#Ñ# LÖ1ñ #ð œ×6Ñ6Ô6äÔmÑ\lÓmÓmˆJÜ.×9Ñ9ÐàˆÜ�zÖ"ˆAà—i‘iØ  Õ#Ø%Ø!1Ø#5Ø&;ð  ó ˆGð &Ÿm™mžo‘
�Ø˜mÔ+Ø)+�M #Ñ&Ø—;‘;¤"§(¢(¬2¯:©:Ó"6Ó6Ø!ŸL™L¬¯©Ó4�EØ˜cÕ"×)Ñ)¨%Ö0ó .ñ #ô" ˜M°~ÔFÐFùòE Fùó"ùòj +Gùó Fs$   Á	RÁ%RÁ6RÉRÌ9RÒRc                ó¢   <€ V ^8„  d   QhRS[ S[S[P                  3,          S[,          RS[R,          RS[RS[R,          RS[R,          RS[ /# )r   r'   r)   NrB   r+   r   r-   )r/   r0   r5   rH   r   r   r   r1   )r   r   s   "€r   r   r   à   sm   ø€ ÷ F"ñ F"á ¡¡b§j¡j Õ1±LÕ@ðF"ñ ˜$•JðF"ñ *ð	F"ñ
   $�JðF"ñ  $ d�{ðF"ñ 
ñF"r   c                ó^  € WP                   ^ ,          ,          pV\        P                  8X  d   \        V4      pVe(   Ve$   W$,          ^ 8w  d   W$,          ^,           V,          pV\        P                  8g  ;'       d    \        V4      V8  pV'       d:   RV9  d3   \
        P                  ! \        V4      \
        P                  R7      VR&   V'       EdV   V\        V4      ,
          pV P                  R8X  d   V'       d$   \
        P                  ! VR,          ^ V34      VR&   V P                  ^8”  d   ^ V3R3M^ V3p	\
        P                  ! WiRV P                  R7      WP                   ^ ,          &   V# V P                  R8X  d   V'       d$   \
        P                  ! VR,          V^ 34      VR&   V P                  ^8”  d   V^ 3R3MV^ 3p	\
        P                  ! WiRV P                  R7      WP                   ^ ,          &   V# \        R\        V P                  4      ,           4      hV# )	aÐ  
Pad inputs (on left/right and up to predefined length or max length in the batch)

Args:
    processed_features (`Union[dict[str, np.ndarray], BatchFeature]`):
        Dictionary of input values (`np.ndarray[float]`) / input vectors (`list[np.ndarray[float]]`) or batch
        of inputs values (`list[np.ndarray[int]]`) / input vectors (`list[np.ndarray[int]]`)
    max_length (`int`, *optional*):
        Maximum length of the returned list and optionally padding length (see below)
    padding_strategy (`PaddingStrategy`, *optional*, default to `PaddingStrategy.DO_NOT_PAD`):
        PaddingStrategy to use for padding.

        - PaddingStrategy.LONGEST Pad to the longest sequence in the batch
        - PaddingStrategy.MAX_LENGTH: Pad to the max length (default)
        - PaddingStrategy.DO_NOT_PAD: Do not pad
        The feature_extractor padding sides are defined in self.padding_side:

            - 'left': pads on the left of the sequences
            - 'right': pads on the right of the sequences
    pad_to_multiple_of (`int`, *optional*):
        Integer if set will pad the sequence to a multiple of the provided value. This is especially useful to
        enable the use of Tensor Core 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*):
        Set to False to avoid returning attention mask (default: set to model specifics)
r3   )rU   r   Úconstant)Úconstant_valuesÚleftzInvalid padding strategy:)r?   r?   )r@   r   rQ   r8   Ú
DO_NOT_PADr5   ÚonesÚint32r   rf   r   r   rG   r0   )
r"   r'   r)   rB   r+   r   r[   Úneeds_to_be_paddedÚ
differenceÚpadding_shapes
   &&&&&&    r   rT   ÚSequenceFeatureExtractor._padà   s
  € ðD ,×,BÑ,BÀ1Õ,EÕFˆàœ×6Ñ6Ô6Ü˜^Ó,ˆJàÒ!Ð&8Ò&DÈ*ÕJiÐmnÔJnØ%Õ;¸qÕ@ÐDVÕVˆJà-´×1KÑ1KÑK×pÐpÔPSÐTbÓPcÐfpÑPpÐç Ð%5Ð=OÔ%OÜ35·7²7¼3¸~Ó;NÔVX×V^ÑV^Ô3_ÐÐ/Ñ0çÐØ#¤c¨.Ó&9Õ9ˆJØ× Ñ  GÔ+ß(Ü;=¿6º6Ø*Ð+;Õ<¸qÀ*¸oó<Ð&Ð'7Ñ8ð >B×=NÑ=NÐQRÔ=R ! Z °&Ñ 9ÐYZÐ\fÐXg�Ü@BÇÂØ"°:Èt×OaÑOaôAÐ"×#9Ñ#9¸!Õ#<Ñ=ð "Ð!ð ×"Ñ" fÔ,ß(Ü;=¿6º6Ø*Ð+;Õ<¸zÈ1¸oó<Ð&Ð'7Ñ8ð >B×=NÑ=NÐQRÔ=R *¨a °&Ñ 9ÐYcÐefÐXg�Ü@BÇÂØ"°:Èt×OaÑOaôAÐ"×#9Ñ#9¸!Õ#<Ñ=ð "Ð!ô !Ð!<¼sÀ4×CTÑCTÓ?UÕ!UÓVÐVà!Ð!r   c          	      ó–   <€ V ^8„  d   QhRS[ S[S[P                  3,          S[,          RS[R,          RS[R,          RS[R,          /# )r   r'   r)   Nr+   r*   )r/   r0   r5   rH   r   r   r1   )r   r   s   "€r   r   r   (  sQ   ø€ ÷ )"ñ )"á ¡¡b§j¡j Õ1±LÕ@ð)"ñ ˜$•Jð)"ñ   $�Jð	)"ñ
 ˜4•Kñ)"r   c                ó†  € V'       g   V# V'       d   Vf   \        R4      hWP                  ^ ,          ,          pVe(   Ve$   W#,          ^ 8w  d   W#,          ^,           V,          p\        V4      V8„  pV'       dF   WP                  ^ ,          ,          RV WP                  ^ ,          &   RV9   d   VR,          RV VR&   V# )a©  
Truncate inputs to predefined length or max length in the batch

Args:
    processed_features(`Union[dict[str, np.ndarray], BatchFeature]`):
        Dictionary of input values (`np.ndarray[float]`) / input vectors (`list[np.ndarray[float]]`) or batch
        of inputs values (`list[np.ndarray[int]]`) / input vectors (`list[np.ndarray[int]]`)
    max_length (`int`, *optional*):
        maximum length of the returned list and optionally padding length (see below)
    pad_to_multiple_of (`int`, *optional*) :
        Integer if set will pad the sequence to a multiple of the provided value. This is especially useful to
        enable the use of Tensor Core on NVIDIA hardware with compute capability `>= 7.5` (Volta), or on TPUs
        which benefit from having sequence lengths be a multiple of 128.
    truncation (`bool`, *optional*):
        Activates truncation to cut input sequences longer than `max_length` to `max_length`.
NzKWhen setting ``truncation=True``, make sure that ``max_length`` is defined.r3   )rG   r@   r8   )r"   r'   r)   r+   r*   r[   Úneeds_to_be_truncateds   &&&&&  r   rO   Ú"SequenceFeatureExtractor._truncate(  sÉ   € ÷. Ø%Ð%ß˜JÒ.ÜÐjÓkÐkà+×,BÑ,BÀ1Õ,EÕFˆð Ò!Ð&8Ò&DÈ*ÕJiÐmnÔJnØ%Õ;¸qÕ@ÐDVÕVˆJä # NÓ 3°jÑ @Ðç Ø<N×OeÑOeÐfgÕOhÕ<iÐjuÐkuÐ<vÐ×5Ñ5°aÕ8Ñ9ØÐ#5Ô5Ø7IÐJZÕ7[Ð\gÐ]gÐ7hÐ"Ð#3Ñ4à!Ð!r   c                óž  € VRJdS   VRJ d   \         P                  pMK\        V\         4      '       g   \        V4      pM)\        V\         4      '       d   TpM\         P                  pVf3   X\         P                  8X  d   \        R\         P                   R24      hX\         P                  8w  d   V P                  f   \        R4      hV# )z#
Find the correct padding strategy
FTzWhen setting ``padding=z(``, make sure that max_length is definedz­Asking to pad but the feature_extractor does not have a padding value. Please select a value to use as `padding_value`. For example: `feature_extractor.padding_value = 0.0`.)r   rQ   rD   rm   rS   rG   r   )r"   r(   r)   rB   s   &&& r   rK   Ú0SequenceFeatureExtractor._get_padding_strategiesS  sÄ   € ð ˜%ÓØ˜$‹Ü#2×#:Ñ#:Ñ Ü ¬×9Ò9Ü#2°7Ó#;Ñ Ü˜G¤_×5Ò5Ø#*Ð øä.×9Ñ9Ðð ÒØ¤?×#=Ñ#=Ô=Ü Ø-¬o×.HÑ.HÐ-IÐIqÐróð ð
 œ×9Ñ9Ô9¸t×?QÑ?QÒ?YÜð]óð ð
  Ðr   c                ó„   <€ V ^8„  d   QhRS[ S[S[ ,          ,          S[S[S[ ,          ,          ,          RS[R,          /# )r   Úaudio_url_or_urlsr   N)r0   r.   r   )r   r   s   "€r   r   r   s  s;   ø€ ÷ wñ w©S±4¹µ9­_¹tÁDÉÅI½Õ-Nð wÑ_bÐeiÕ_iñ wr   c                óx  € V'       d   TMV P                   p\        V\        4      '       d?   \        V^ ,          \        4      '       g"   V Uu. uF  q0P	                  W2R7      NK  	  up# \        V\
        4      '       d   \        WR7      # \        V4      '       d   V# \        R\        V4       24      hu upi )zÊ
Convert a single or a list of urls into the corresponding `np.ndarray` objects.

If a single url is passed, the return value will be a single object. If a list is passed a list of objects is
returned.
)r   z=only a single or a list of entries is supported but got type=)
r   rD   r.   r   Úfetch_audior0   r   r   Ú	TypeErrorrI   )r"   r{   r   Úxs   &&& r   r}   Ú$SequenceFeatureExtractor.fetch_audios  s¥   € ÷ *7™¸D×<NÑ<NˆÜÐ'¬×.Ò.´zÐBSÐTUÕBVÔX]×7^Ò7^ÙN_Ó`ÑN_È×$Ñ$ QÐ$ÖDÑN_Ñ`Ð`ÜÐ)¬3×/Ò/ÜÐ/ÔMÐMÜÐ-×.Ò.Ø$Ð$äÐ[Ô\`ÐarÓ\sÐ[tÐuÓvÐvùò as   ÁB7)r   r   r   r   r   )TNFNNN)NNN)FNr7   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r!   rf   r   rm   rT   rO   rK   r}   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r$   r   s   @@r   r   r      sg   ù‡ € ñ
÷#ó #÷kGò kGð` "&Ø,;×,FÑ,FØ)-Ø-1÷F"ò F"÷P)"ò )"ôV ÷@w÷ wò wr   r   )r…   Únumpyr5   Úaudio_utilsr   r   Úfeature_extraction_utilsr   r   Úutilsr   r   r   r	   r
   Ú
get_loggerr�   Úloggerr   r   r   r   Ú<module>r�      s>   ðñó ç 3ß Jß RÕ Rð 
×	Ò	˜HÓ	%€ôgwÐ5ö gwr   