
    Z j	                     v    S r SSKJrJrJr  SSKJrJrJr  SSK	J
r
   " S S\SS9r\
 " S	 S
\5      5       rS
/rg)z%
Speech processor class for Wav2Vec2
   )ProcessingKwargsProcessorMixinUnpack)
AudioInputPreTokenizedInput	TextInput)auto_docstringc                       \ rS rSr0 rSrg)Wav2Vec2ProcessorKwargs    N)__name__
__module____qualname____firstlineno__	_defaults__static_attributes__r       ځ/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/transformers/models/wav2vec2/processing_wav2vec2.pyr   r      s    Ir   r   F)totalc            	          ^  \ rS rSrU 4S jr\  SS\S-  S\\\   -  \	-  \
-  S-  S\\   4S jj5       rS r\S	 5       rS
rU =r$ )Wav2Vec2Processor   c                 $   > [         TU ]  X5        g )N)super__init__)selffeature_extractor	tokenizer	__class__s      r   r   Wav2Vec2Processor.__init__   s    *6r   Naudiotextkwargsc                 
   Uc  Uc  [        S5      eU R                  " [        4SU R                  R                  0UD6nUb  U R
                  " U40 US   D6nUb  U R                  " U40 US   D6nUc  W$ Uc  W$ WS   WS'   U$ )z
Returns:
    This method returns the results of each `call` method. If both are used, the output is a dictionary containing the results of both.
zAYou need to specify either an `audio` or `text` input to process.tokenizer_init_kwargsaudio_kwargstext_kwargs	input_idslabels)
ValueError_merge_kwargsr   r   init_kwargsr   )r   r"   r#   r$   output_kwargsinputs	encodingss          r   __call__Wav2Vec2Processor.__call__    s     =T\`aa**#
"&.."<"<
 
 ++ES]>5RSFtL}]/KLI<M](5F8Mr   c                 *   UR                  SS5      nUR                  SS5      n[        U5      S:  a
  US   nUSS nUb   U R                  R                  " U/UQ70 UD6nUb  U R                  R                  " U40 UD6nUc  U$ Uc  U$ US   US'   U$ )a  
This method operates on batches of extracted features and/or tokenized text. It forwards all arguments to
[`Wav2Vec2FeatureExtractor.pad`] and/or [`PreTrainedTokenizer.pad`] depending on the input modality and returns their outputs. If both modalities are passed, [`Wav2Vec2FeatureExtractor.pad`] and [`PreTrainedTokenizer.pad`] are called.

Args:
    input_features:
        When the first argument is a dictionary containing a batch of tensors, or the `input_features` argument is present, it is passed to [`Wav2Vec2FeatureExtractor.pad`].
    labels:
        When the `label` argument is present, it is passed to [`PreTrainedTokenizer.pad`].

Returns:
    This method returns the results of each `pad` method. If both are used, the output is a dictionary containing the results of both.
input_featuresNr*          r)   )poplenr   padr   )r   argsr$   r4   r*   s        r   r9   Wav2Vec2Processor.padA   s      $4d;Hd+t9q=!!WN8D%!3377XXQWXN^^''9&9F>!!#M'-k':N8$!!r   c                 :    U R                   R                  nUS/-   $ )Nr*   )r   model_input_names)r   feature_extractor_input_namess     r   r=   #Wav2Vec2Processor.model_input_namesb   s#     )-(>(>(P(P%,z99r   r   )NN)r   r   r   r   r   r	   r   strlistr   r   r   r   r1   r9   propertyr=   r   __classcell__)r    s   @r   r   r      s~    7  $(GKD  DIo	),==D 01	 @"B : :r   r   N)__doc__processing_utilsr   r   r   tokenization_utils_baser   r   r   utilsr	   r   r   __all__r   r   r   <module>rI      sT    I H O O #.e  J: J: J:Z 
r   