


'''simple docstring'''


import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin



class 	__lowerCAmelCase		(							_UpperCamelCase    ):


  '''simple docstring'''







  a_  					=							"""Speech2TextFeatureExtractor"""
  a_  					=							"""Speech2TextTokenizer"""






  def __init__(							self :       str	,_a :       Optional[int]	,_a :       Dict ):

        '''simple docstring'''




        super().__init__(_UpperCAmelCase	,_UpperCAmelCase )
        A_						:  str          =				self.feature_extractor
        A_						:  Dict          =				False






  def __call__(							self :       Any	,*_a :       str	,**_a :       str ):

        '''simple docstring'''




        if self._in_target_context_manager:
              return self.current_processor(*_UpperCAmelCase	,**_UpperCAmelCase )

        if "raw_speech" in kwargs:
              warnings.warn("""Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead.""" )
              A_						:  Tuple          =				kwargs.pop("""raw_speech""" )
        else:
              A_						:  Union[str, Any]          =				kwargs.pop("""audio"""	,_UpperCAmelCase )
        A_						:  Optional[int]          =				kwargs.pop("""sampling_rate"""	,_UpperCAmelCase )
        A_						:  Tuple          =				kwargs.pop("""text"""	,_UpperCAmelCase )
        if len(_UpperCAmelCase ) > 0:
              A_						:  str          =				args[0]
              A_						:  List[str]          =				args[1:]

        if audio is None and text is None:
              raise ValueError("""You need to specify either an `audio` or `text` input to process.""" )

        if audio is not None:
              A_						:  List[str]          =				self.feature_extractor(_UpperCAmelCase	,*_UpperCAmelCase	,sampling_rate=_UpperCAmelCase	,**_UpperCAmelCase )
        if text is not None:
              A_						:  str          =				self.tokenizer(_UpperCAmelCase	,**_UpperCAmelCase )

        if text is None:
              return inputs
        elif audio is None:
              return encodings
        else:
              A_						:  Optional[int]          =				encodings['''input_ids''']
              return inputs






  def        _a							(							self :       Dict	,*_a :       Dict	,**_a :       Tuple ):

        '''simple docstring'''




        return self.tokenizer.batch_decode(*_UpperCAmelCase	,**_UpperCAmelCase )






  def        _a							(							self :       Dict	,*_a :       str	,**_a :       Tuple ):

        '''simple docstring'''




        return self.tokenizer.decode(*_UpperCAmelCase	,**_UpperCAmelCase )






  @contextmanager
  def        _a							(							self :       Any ):

        '''simple docstring'''




        warnings.warn(
            """`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your """
            """labels by using the argument `text` of the regular `__call__` method (either in the same call as """
            """your audio inputs, or in a separate call.""" )
        A_						:  List[str]          =				True
        A_						:  Union[str, Any]          =				self.tokenizer
        yield
        A_						:  Optional[int]          =				self.feature_extractor
        A_						:  Optional[Any]          =				False




'''simple docstring'''


import warnings

from ...utils import logging
from .image_processing_owlvit import OwlViTImageProcessor


__magic_name__			=      logging.get_logger(__name__)



class 	__lowerCAmelCase		(							__SCREAMING_SNAKE_CASE    ):


  '''simple docstring'''







  def __init__(							self :       Union[str, Any]	,*_a :       Optional[Any]	,**_a :       Optional[int] ):

        '''simple docstring'''




        warnings.warn(
            """The class OwlViTFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please"""
            """ use OwlViTImageProcessor instead."""	,_a	,)
        super().__init__(*_a	,**_a )
