

from ...processing_utils import ProcessorMixin



class 		a_       (							lowerCamelCase_     ):



      """simple docstring"""







      __UpperCAmelCase					=      'WhisperFeatureExtractor'
      __UpperCAmelCase					=      'WhisperTokenizer'
      def __init__(      self     :							Any			,snake_case     :							Optional[Any]			,snake_case     :							Dict				):
           super().__init__(snake_case			,snake_case				)
           SCREAMING_SNAKE_CASE      						=self.feature_extractor
           SCREAMING_SNAKE_CASE      						=False
      def        _lowerCAmelCase     (      self     :							Optional[int]			,snake_case     :							str=None			,snake_case     :							Optional[Any]=None			,snake_case     :							Any=True				):
           return self.tokenizer.get_decoder_prompt_ids(task=snake_case			,language=snake_case			,no_timestamps=snake_case				)
      def __call__(      self     :							str			,*snake_case     :							List[str]			,**snake_case     :							Optional[Any]				):



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

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

           if text is None:
                return inputs

           elif audio is None:
                return encodings
           else:
                SCREAMING_SNAKE_CASE      						=encodings['input_ids']
                return inputs
      def        _lowerCAmelCase     (      self     :							Optional[Any]			,*snake_case     :							Union[str, Any]			,**snake_case     :							List[Any]				):
           return self.tokenizer.batch_decode(*snake_case			,**snake_case				)
      def        _lowerCAmelCase     (      self     :							List[Any]			,*snake_case     :							int			,**snake_case     :							int				):
           return self.tokenizer.decode(*snake_case			,**snake_case				)


      def        _lowerCAmelCase     (      self     :							Union[str, Any]			,snake_case     :							Union[str, Any]			,snake_case     :							str="np"				):
           return self.tokenizer.get_prompt_ids(snake_case			,return_tensors=snake_case				)






'''simple docstring'''





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
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


lowercase_		       =  logging.get_logger(__name__)

lowercase_		       =  {
    "microsoft/resnet-50": "https://huggingface.co/microsoft/resnet-50/blob/main/config.json",
}






class __A			(  A   ,   A						):



 '''simple docstring'''







 __lowerCamelCase    :       Tuple          =       'resnet'
 __lowerCamelCase    :       Any          =       ['basic', 'bottleneck']



 def __init__(self ,   A=3 ,   A=64 ,   A=[256, 512, 1_024, 2_048] ,   A=[3, 4, 6, 3] ,   A="bottleneck" ,   A="relu" ,   A=False ,   A=None ,   A=None ,   **A ,   )    ->     Dict:


      """simple docstring"""



      super().__init__(**A       )
      if layer_type not in self.layer_types:
           raise ValueError(f'''layer_type={layer_type} is not one of {','.join(self.layer_types       )}'''       )
      _a      =  num_channels
      _a      =  embedding_size
      _a      =  hidden_sizes
      _a      =  depths
      _a      =  layer_type
      _a      =  hidden_act
      _a      =  downsample_in_first_stage
      _a      =  ['''stem'''] + [f'''stage{idx}''' for idx in range(1 ,   len(A       ) + 1       )]
      _a  ,    _a      =  get_aligned_output_features_output_indices(
          out_features=A ,   out_indices=A ,   stage_names=self.stage_names       )






class __A			(  A						):



 '''simple docstring'''







 __lowerCamelCase    :       Any          =       version.parse('1.11'						)



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


      """simple docstring"""



      return OrderedDict(
          [
              ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
          ]       )



 @property
 def 					a__  (self       )    ->     float:


      """simple docstring"""



      return 1E-3



