
    hX                         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j"                  e      Z G d	 d
e      Zd
gZy)z%
Audio/Text processor class for CLAP
    )OptionalUnion   )
AudioInput)ProcessingKwargsProcessorMixinUnpack)PreTokenizedInput	TextInput)logging)deprecate_kwargc                        e Zd ZdZdZdZ fdZ e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       Z x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                 &    t         |   ||       y )N)super__init__)selffeature_extractor	tokenizer	__class__s      g/var/www/html/aiagenthome/venv/lib/python3.12/site-packages/transformers/models/clap/processing_clap.pyr   zClapProcessor.__init__0   s    *I6    audioszv4.59.0audio)versionnew_nametextkwargsc                 ^    ||t         j                  d       |}t        |   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.
        z^Using `audios` keyword argument is deprecated when calling ClapProcessor, instead use `audio`.)r    r    )loggerwarningr   __call__)r   r    r   r   r!   r   s        r   r&   zClapProcessor.__call__3   s?     %-NNp EwATA&AAr   )NNN)__name__
__module____qualname____doc__feature_extractor_classtokenizer_classr   r   r   r   r   r
   listr   r	   r   r&   __classcell__)r   s   @r   r   r      s     5BO7 Xy7C im'+&*	BuY(94	?DQbLccdeB $B 
#	B
 )*B DBr   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   <module>r7      sN    # % H H C  0 
		H	%)BN )BX 
r   