o
    Zh2                     @   s*   d Z ddlmZ G dd deZdgZdS )z
Processor class for CLVP
   )ProcessorMixinc                       sH   e Zd ZdZdZdZg dZ fddZdd Zd	d
 Z	dd Z
  ZS )ClvpProcessoras  
    Constructs a CLVP processor which wraps a CLVP Feature Extractor and a CLVP Tokenizer into a single processor.

    [`ClvpProcessor`] offers all the functionalities of [`ClvpFeatureExtractor`] and [`ClvpTokenizer`]. See the
    [`~ClvpProcessor.__call__`], [`~ClvpProcessor.decode`] and [`~ClvpProcessor.batch_decode`] for more information.

    Args:
        feature_extractor (`ClvpFeatureExtractor`):
            An instance of [`ClvpFeatureExtractor`]. The feature extractor is a required input.
        tokenizer (`ClvpTokenizer`):
            An instance of [`ClvpTokenizer`]. The tokenizer is a required input.
    ZClvpFeatureExtractorZClvpTokenizer)	input_idsZinput_featuresattention_maskc                    s   t  || d S )N)super__init__)selffeature_extractor	tokenizer	__class__ W/var/www/auris/lib/python3.10/site-packages/transformers/models/clvp/processing_clvp.pyr   -   s   zClvpProcessor.__init__c                 O   s   | dd}| dd}| dd}|du r|du rtd|dur-| j|fd|i|}|dur:| j|fi |}|du r@|S |du rF|S |d |d< |d |d< |S )z
        Forwards the `audio` and `sampling_rate` arguments to [`~ClvpFeatureExtractor.__call__`] and the `text`
        argument to [`~ClvpTokenizer.__call__`]. Please refer to the docstring of the above two methods for more
        information.
        
raw_speechNsampling_ratetextzFYou need to specify either an `raw_speech` or `text` input to process.r   r   )pop
ValueErrorr	   r
   )r   argskwargsr   r   r   Zinputs	encodingsr   r   r   __call__0   s    zClvpProcessor.__call__c                 O      | j j|i |S )z
        This method forwards all its arguments to ClvpTokenizer's [`~PreTrainedTokenizer.batch_decode`]. Please
        refer to the docstring of this method for more information.
        )r
   batch_decoder   r   r   r   r   r   r   M      zClvpProcessor.batch_decodec                 O   r   )z
        This method forwards all its arguments to ClvpTokenizer's [`~PreTrainedTokenizer.decode`]. Please refer to
        the docstring of this method for more information.
        )r
   decoder   r   r   r   r   U   r   zClvpProcessor.decode)__name__
__module____qualname____doc__Zfeature_extractor_classZtokenizer_classZmodel_input_namesr   r   r   r   __classcell__r   r   r   r   r      s    r   N)r    Zprocessing_utilsr   r   __all__r   r   r   r   <module>   s   
F