

from ...processing_utils import ProcessorMixin







class 					lowercase							(			lowercase_     ):
				__SCREAMING_SNAKE_CASE   :					List[str]			     =     '''WhisperFeatureExtractor'''
				__SCREAMING_SNAKE_CASE   :					Union[str, Any]			     =     '''WhisperTokenizer'''




				def __init__(   self ,  snake_case ,  snake_case			):
											super().__init__(snake_case ,  snake_case			)
											snake_case_     							=       self.feature_extractor
											snake_case_     							=       False




				def        a				(   self ,  snake_case=None ,  snake_case=None ,  snake_case=True			):
											return self.tokenizer.get_decoder_prompt_ids(task=snake_case ,  language=snake_case ,  no_timestamps=snake_case			)




				def __call__(   self ,  *snake_case ,  **snake_case			):
											# For backward compatibility
											if self._in_target_context_manager:
																		return self.current_processor(*snake_case ,  **snake_case			)

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

											if text is None:
																		return inputs

											elif audio is None:
																		return encodings
											else:
																		snake_case_     							=       encodings['input_ids']
																		return inputs




				def        a				(   self ,  *snake_case ,  **snake_case			):
											return self.tokenizer.batch_decode(*snake_case ,  **snake_case			)




				def        a				(   self ,  *snake_case ,  **snake_case			):
											return self.tokenizer.decode(*snake_case ,  **snake_case			)




				def        a				(   self ,  snake_case ,  snake_case="np"			):
											return self.tokenizer.get_prompt_ids(snake_case ,  return_tensors=snake_case			)







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


_UpperCAmelCase						:  Union[str, Any]									=			logging.get_logger(__name__)

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







class 					lowercase							(			lowercase_      ,    lowercase_     ):
				__SCREAMING_SNAKE_CASE   :					List[str]			     =     '''resnet'''
				__SCREAMING_SNAKE_CASE   :					Dict			     =     ['''basic''', '''bottleneck''']




				def __init__(   self ,  snake_case=3 ,  snake_case=64 ,  snake_case=[256, 512, 1024, 2048] ,  snake_case=[3, 4, 6, 3] ,  snake_case="bottleneck" ,  snake_case="relu" ,  snake_case=False ,  snake_case=None ,  snake_case=None ,  **snake_case ,  ):
											super().__init__(**snake_case			)
											if layer_type not in self.layer_types:
																		raise ValueError(F'''layer_type={layer_type} is not one of {",".join(self.layer_types			)}'''			)
											snake_case_     							=       num_channels
											snake_case_     							=       embedding_size
											snake_case_     							=       hidden_sizes
											snake_case_     							=       depths
											snake_case_     							=       layer_type
											snake_case_     							=       hidden_act
											snake_case_     							=       downsample_in_first_stage
											snake_case_     							=       ['stem'] + [F'''stage{idx}''' for idx in range(1 ,  len(snake_case			) + 1			)]
											snake_case_							,       snake_case_     							=       get_aligned_output_features_output_indices(
											    out_features=snake_case ,  out_indices=snake_case ,  stage_names=self.stage_names			)







class 					lowercase							(			lowercase_     ):
				__SCREAMING_SNAKE_CASE   :					List[Any]			     =     version.parse('''1.11'''     )




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




				@property
				def        a				(   self			):
											return 1e-3




