






'''simple docstring'''




import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin

class    _UpperCAmelCase			(     snake_case_						):




   """simple docstring"""

   snake_case    				=						'''Speech2TextFeatureExtractor'''
   snake_case    				=						'''Speech2TextTokenizer'''

   def __init__(		self :	str      ,      __UpperCAmelCase :	Tuple      ,      __UpperCAmelCase :	Tuple		):





         '''simple docstring'''





         super().__init__(__UpperCAmelCase      ,      __UpperCAmelCase		)
         _A			     =	self.feature_extractor
         _A			     =	False

   def __call__(		self :	Tuple      ,      *__UpperCAmelCase :	Union[str, Any]      ,      **__UpperCAmelCase :	Tuple		):





         '''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			     =	kwargs.pop("raw_speech"		)
         else:
               _A			     =	kwargs.pop("audio"      ,      __UpperCAmelCase		)
         _A			     =	kwargs.pop("sampling_rate"      ,      __UpperCAmelCase		)
         _A			     =	kwargs.pop("text"      ,      __UpperCAmelCase		)
         if len(__UpperCAmelCase		) > 0:
               _A			     =	args[0]
               _A			     =	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			     =	self.feature_extractor(__UpperCAmelCase      ,      *__UpperCAmelCase      ,      sampling_rate=__UpperCAmelCase      ,      **__UpperCAmelCase		)
         if text is not None:
               _A			     =	self.tokenizer(__UpperCAmelCase      ,      **__UpperCAmelCase		)

         if text is None:
               return inputs
         elif audio is None:
               return encodings
         else:
               _A			     =	encodings["input_ids"]
               return inputs

   def 						lowerCAmelCase (		self :	List[Any]      ,      *__UpperCAmelCase :	Tuple      ,      **__UpperCAmelCase :	Optional[int]		):





         '''simple docstring'''





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

   def 						lowerCAmelCase (		self :	Any      ,      *__UpperCAmelCase :	Any      ,      **__UpperCAmelCase :	Optional[int]		):





         '''simple docstring'''





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

   @contextmanager
   def 						lowerCAmelCase (		self :	str		):





         '''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			     =	True
         _A			     =	self.tokenizer
         yield
         _A			     =	self.feature_extractor
         _A			     =	False












from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


UpperCAmelCase_     							= logging.get_logger(__name__)

UpperCAmelCase_     							= {
    'google/mobilenet_v2_1.4_224': 'https://huggingface.co/google/mobilenet_v2_1.4_224/resolve/main/config.json',
    'google/mobilenet_v2_1.0_224': 'https://huggingface.co/google/mobilenet_v2_1.0_224/resolve/main/config.json',
    'google/mobilenet_v2_0.75_160': 'https://huggingface.co/google/mobilenet_v2_0.75_160/resolve/main/config.json',
    'google/mobilenet_v2_0.35_96': 'https://huggingface.co/google/mobilenet_v2_0.35_96/resolve/main/config.json',
    # See all MobileNetV2 models at https://huggingface.co/models?filter=mobilenet_v2
}






class     lowercase__       (	__lowerCamelCase				):

   '''simple docstring'''


   a						:							List[str]   		=		"mobilenet_v2"




   def __init__(    self,		__magic_name__=3,		__magic_name__=224,		__magic_name__=1.0,		__magic_name__=8,		__magic_name__=8,		__magic_name__=6,		__magic_name__=32,		__magic_name__=True,		__magic_name__=True,		__magic_name__="relu6",		__magic_name__=True,		__magic_name__=0.8,		__magic_name__=0.02,		__magic_name__=0.001,		__magic_name__=255,		**__magic_name__,		) ->      List[Any]:






       """simple docstring"""
       super().__init__(**__magic_name__							)

       if depth_multiplier <= 0:
           raise ValueError('''depth_multiplier must be greater than zero.'''							)

       UpperCamelCase__							:				Union[str, Any]          =      num_channels
       UpperCamelCase__							:				int          =      image_size
       UpperCamelCase__							:				int          =      depth_multiplier
       UpperCamelCase__							:				Tuple          =      depth_divisible_by
       UpperCamelCase__							:				List[str]          =      min_depth
       UpperCamelCase__							:				Optional[int]          =      expand_ratio
       UpperCamelCase__							:				Optional[int]          =      output_stride
       UpperCamelCase__							:				Tuple          =      first_layer_is_expansion
       UpperCamelCase__							:				Union[str, Any]          =      finegrained_output
       UpperCamelCase__							:				str          =      hidden_act
       UpperCamelCase__							:				Optional[Any]          =      tf_padding
       UpperCamelCase__							:				Optional[int]          =      classifier_dropout_prob
       UpperCamelCase__							:				int          =      initializer_range
       UpperCamelCase__							:				Union[str, Any]          =      layer_norm_eps
       UpperCamelCase__							:				Tuple          =      semantic_loss_ignore_index






class     lowercase__       (	__lowerCamelCase				):

   '''simple docstring'''


   a						:							Union[str, Any]   		=		version.parse("1.11"				)




   @property
   def       UpperCamelCase__  (    self							) ->      Mapping[str, Mapping[int, str]]:






       """simple docstring"""
       return OrderedDict([('''pixel_values''', {0: '''batch'''})]							)




   @property
   def       UpperCamelCase__  (    self							) ->      Mapping[str, Mapping[int, str]]:






       """simple docstring"""
       if self.task == "image-classification":
           return OrderedDict([('''logits''', {0: '''batch'''})]							)
       else:
           return OrderedDict([('''last_hidden_state''', {0: '''batch'''}), ('''pooler_output''', {0: '''batch'''})]							)




   @property
   def       UpperCamelCase__  (    self							) ->      float:






       """simple docstring"""
       return 1E-4

