o
    	۷iX                     @   s   d Z ddlmZmZ ddlmZ ddlmZmZm	Z	 ddl
mZmZ ddlmZ ddlmZ eeZG d	d
 d
eZd
gZdS )z%
Audio/Text processor class for CLAP
    )OptionalUnion   )
AudioInput)ProcessingKwargsProcessorMixinUnpack)PreTokenizedInput	TextInput)logging)deprecate_kwargc                       s   e Zd ZdZdZdZ fddZedddd		
	
	
ddee	e
eee
 ee f  dee dee dee f fddZ  ZS )ClapProcessora  
    Constructs a CLAP processor which wraps a CLAP feature extractor and a RoBerta tokenizer into a single processor.

    [`ClapProcessor`] offers all the functionalities of [`ClapFeatureExtractor`] and [`RobertaTokenizerFast`]. See the
    [`~ClapProcessor.__call__`] and [`~ClapProcessor.decode`] for more information.

    Args:
        feature_extractor ([`ClapFeatureExtractor`]):
            The audio processor is a required input.
        tokenizer ([`RobertaTokenizerFast`]):
            The tokenizer is a required input.
    ClapFeatureExtractor)RobertaTokenizerRobertaTokenizerFastc                    s   t  || d S )N)super__init__)selffeature_extractor	tokenizer	__class__ ^/home/ubuntu/vllm_env/lib/python3.10/site-packages/transformers/models/clap/processing_clap.pyr   0   s   zClapProcessor.__init__audioszv4.59.0audio)versionnew_nameNtextkwargsc                    s6   |dur|du rt d |}t jd||d|S )a  
        Forwards the `audio` and `sampling_rate` arguments to [`~ClapFeatureExtractor.__call__`] and the `text`
        argument to [`~RobertaTokenizerFast.__call__`]. Please refer to the docstring of the above two methods for more
        information.
        Nz^Using `audios` keyword argument is deprecated when calling ClapProcessor, instead use `audio`.)r   r   r   )loggerwarningr   __call__)r   r   r   r   r   r   r   r   r"   3   s   zClapProcessor.__call__)NNN)__name__
__module____qualname____doc__feature_extractor_classtokenizer_classr   r   r   r   r
   r	   listr   r   r   r"   __classcell__r   r   r   r   r      s$    r   N)r&   typingr   r   audio_utilsr   processing_utilsr   r   r   tokenization_utils_baser	   r
   utilsr   utils.deprecationr   
get_loggerr#   r    r   __all__r   r   r   r   <module>   s   

,