
"""simple docstring"""
from ...processing_utils import ProcessorMixin
class       lowerCAmelCase_		(				A__ ):



							'''simple docstring'''





							_snake_case						      =		'''WhisperFeatureExtractor'''
							_snake_case						      =		'''WhisperTokenizer'''




							def __init__( self    ,				snake_case_    ,				snake_case_				)       ->  Optional[Any]:
													super().__init__(snake_case_    ,				snake_case_				)
													__lowerCAmelCase     =  self.feature_extractor
													__lowerCAmelCase     =  False




							def    A__						( self    ,				snake_case_=None    ,				snake_case_=None    ,				snake_case_=True				)       ->  int:
													return self.tokenizer.get_decoder_prompt_ids(task=snake_case_    ,				language=snake_case_    ,				no_timestamps=snake_case_				)




							def __call__( self    ,				*snake_case_    ,				**snake_case_				)       ->  Any:
													# For backward compatibility
													if self._in_target_context_manager:
																			return self.current_processor(*snake_case_    ,				**snake_case_				)

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

													if text is None:
																			return inputs

													elif audio is None:
																			return encodings
													else:
																			__lowerCAmelCase     =  encodings["""input_ids"""]
																			return inputs




							def    A__						( self    ,				*snake_case_    ,				**snake_case_				)       ->  List[Any]:
													return self.tokenizer.batch_decode(*snake_case_    ,				**snake_case_				)




							def    A__						( self    ,				*snake_case_    ,				**snake_case_				)       ->  Optional[int]:
													return self.tokenizer.decode(*snake_case_    ,				**snake_case_				)




							def    A__						( self    ,				snake_case_    ,				snake_case_="np"				)       ->  Tuple:
													return self.tokenizer.get_prompt_ids(snake_case_    ,				return_tensors=snake_case_				)


"""simple docstring"""
from typing import List

from ...configuration_utils import PretrainedConfig
from ...utils import logging


SCREAMING_SNAKE_CASE_					     =	logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_					     =	{
    '''snap-research/efficientformer-l1-300''': (
        '''https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json'''
    ),
}
class       lowerCAmelCase_		(				A__ ):



							'''simple docstring'''





							_snake_case						      =		'''efficientformer'''




							def __init__( self    ,				snake_case_ = [3, 2, 6, 4]    ,				snake_case_ = [48, 96, 224, 448]    ,				snake_case_ = [True, True, True, True]    ,				snake_case_ = 448    ,				snake_case_ = 32    ,				snake_case_ = 4    ,				snake_case_ = 7    ,				snake_case_ = 5    ,				snake_case_ = 8    ,				snake_case_ = 4    ,				snake_case_ = 0.0    ,				snake_case_ = 16    ,				snake_case_ = 3    ,				snake_case_ = 3    ,				snake_case_ = 3    ,				snake_case_ = 2    ,				snake_case_ = 1    ,				snake_case_ = 0.0    ,				snake_case_ = 1    ,				snake_case_ = True    ,				snake_case_ = True    ,				snake_case_ = 1e-5    ,				snake_case_ = "gelu"    ,				snake_case_ = 0.02    ,				snake_case_ = 1e-1_2    ,				snake_case_ = 224    ,				snake_case_ = 1e-0_5    ,				**snake_case_    ,				)       ->  None:
													super().__init__(**snake_case_				)

													__lowerCAmelCase     =  hidden_act
													__lowerCAmelCase     =  hidden_dropout_prob
													__lowerCAmelCase     =  hidden_sizes
													__lowerCAmelCase     =  num_hidden_layers
													__lowerCAmelCase     =  num_attention_heads
													__lowerCAmelCase     =  initializer_range
													__lowerCAmelCase     =  layer_norm_eps
													__lowerCAmelCase     =  patch_size
													__lowerCAmelCase     =  num_channels
													__lowerCAmelCase     =  depths
													__lowerCAmelCase     =  mlp_expansion_ratio
													__lowerCAmelCase     =  downsamples
													__lowerCAmelCase     =  dim
													__lowerCAmelCase     =  key_dim
													__lowerCAmelCase     =  attention_ratio
													__lowerCAmelCase     =  resolution
													__lowerCAmelCase     =  pool_size
													__lowerCAmelCase     =  downsample_patch_size
													__lowerCAmelCase     =  downsample_stride
													__lowerCAmelCase     =  downsample_pad
													__lowerCAmelCase     =  drop_path_rate
													__lowerCAmelCase     =  num_metaad_blocks
													__lowerCAmelCase     =  distillation
													__lowerCAmelCase     =  use_layer_scale
													__lowerCAmelCase     =  layer_scale_init_value
													__lowerCAmelCase     =  image_size
													__lowerCAmelCase     =  batch_norm_eps
