






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


UpperCamelCase								=		logging.get_logger(__name__)

UpperCamelCase								=		{
    'sayakpaul/vit-msn-base': 'https://huggingface.co/sayakpaul/vit-msn-base/resolve/main/config.json',
    # See all ViT MSN models at https://huggingface.co/models?filter=vit_msn
}

class 				lowerCAmelCase_	(		__SCREAMING_SNAKE_CASE			):
				_UpperCamelCase					:       Union[str, Any]							       = "vit_msn"


				def __init__(					self ,						_lowerCAmelCase=7_6_8 ,						_lowerCAmelCase=1_2 ,						_lowerCAmelCase=1_2 ,						_lowerCAmelCase=3_0_7_2 ,						_lowerCAmelCase="gelu" ,						_lowerCAmelCase=0.0 ,						_lowerCAmelCase=0.0 ,						_lowerCAmelCase=0.02 ,						_lowerCAmelCase=1E-06 ,						_lowerCAmelCase=2_2_4 ,						_lowerCAmelCase=1_6 ,						_lowerCAmelCase=3 ,						_lowerCAmelCase=True ,						**_lowerCAmelCase ,						):
											super().__init__(**lowerCAmelCase__      )

											_lowercase							:   Tuple 							=   hidden_size
											_lowercase							:   List[Any] 							=   num_hidden_layers
											_lowercase							:   Tuple 							=   num_attention_heads
											_lowercase							:   Optional[int] 							=   intermediate_size
											_lowercase							:   Optional[Any] 							=   hidden_act
											_lowercase							:   List[str] 							=   hidden_dropout_prob
											_lowercase							:   Dict 							=   attention_probs_dropout_prob
											_lowercase							:   Optional[Any] 							=   initializer_range
											_lowercase							:   Union[str, Any] 							=   layer_norm_eps
											_lowercase							:   str 							=   image_size
											_lowercase							:   Optional[Any] 							=   patch_size
											_lowercase							:   Any 							=   num_channels
											_lowercase							:   int 							=   qkv_bias








from ...processing_utils import ProcessorMixin







class 	__lowercase    (__SCREAMING_SNAKE_CASE  ):





							"""simple docstring"""







							_UpperCAmelCase      =						"""WhisperFeatureExtractor"""
							_UpperCAmelCase      =						"""WhisperTokenizer"""






							def __init__(      self			,						lowerCAmelCase__			,						lowerCAmelCase__       ):





										"""simple docstring"""




										super().__init__(lowerCAmelCase__			,						lowerCAmelCase__       )
										SCREAMING_SNAKE_CASE_		:     Union[str, Any]					=					self.feature_extractor
										SCREAMING_SNAKE_CASE_		:     List[Any]					=					False






							def 					UpperCamelCase__     (      self			,						lowerCAmelCase__=None			,						lowerCAmelCase__=None			,						lowerCAmelCase__=True       ):





										"""simple docstring"""




										return self.tokenizer.get_decoder_prompt_ids(task=lowerCAmelCase__			,						language=lowerCAmelCase__			,						no_timestamps=lowerCAmelCase__       )






							def __call__(      self			,						*lowerCAmelCase__			,						**lowerCAmelCase__       ):





										"""simple docstring"""




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

										SCREAMING_SNAKE_CASE_		:     Tuple					=					kwargs.pop('audio'			,						lowerCAmelCase__       )
										SCREAMING_SNAKE_CASE_		:     str					=					kwargs.pop('sampling_rate'			,						lowerCAmelCase__       )
										SCREAMING_SNAKE_CASE_		:     Optional[Any]					=					kwargs.pop('text'			,						lowerCAmelCase__       )
										if len(lowerCAmelCase__       ) > 0:
													SCREAMING_SNAKE_CASE_		:     List[Any]					=					args[0]
													SCREAMING_SNAKE_CASE_		:     List[Any]					=					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_		:     List[Any]					=					self.feature_extractor(lowerCAmelCase__			,						*lowerCAmelCase__			,						sampling_rate=lowerCAmelCase__			,						**lowerCAmelCase__       )
										if text is not None:
													SCREAMING_SNAKE_CASE_		:     Optional[int]					=					self.tokenizer(lowerCAmelCase__			,						**lowerCAmelCase__       )

										if text is None:
													return inputs

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






							def 					UpperCamelCase__     (      self			,						*lowerCAmelCase__			,						**lowerCAmelCase__       ):





										"""simple docstring"""




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






							def 					UpperCamelCase__     (      self			,						*lowerCAmelCase__			,						**lowerCAmelCase__       ):





										"""simple docstring"""




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






							def 					UpperCamelCase__     (      self			,						lowerCAmelCase__			,						lowerCAmelCase__="np"       ):





										"""simple docstring"""




										return self.tokenizer.get_prompt_ids(lowerCAmelCase__			,						return_tensors=lowerCAmelCase__       )





