


'''simple docstring'''



from ...processing_utils import ProcessorMixin





class 							__UpperCamelCase    (		lowerCAmelCase_ ):
	A_           =   "WhisperFeatureExtractor"
	A_           =   "WhisperTokenizer"




	def __init__(       self						,    __a						,    __a							):

						'''simple docstring'''





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




	def 				__UpperCAmelCase							(       self						,    __a=None						,    __a=None						,    __a=True							):

						'''simple docstring'''





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




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

						'''simple docstring'''





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

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

						if text is None:
											return inputs

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




	def 				__UpperCAmelCase							(       self						,    *__a						,    **__a							):

						'''simple docstring'''





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




	def 				__UpperCAmelCase							(       self						,    *__a						,    **__a							):

						'''simple docstring'''





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





	def 				__UpperCAmelCase							(       self						,    __a						,    __a="np"							):

						'''simple docstring'''





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







'''simple docstring'''



from __future__ import annotations

from typing import Dict

from ...configuration_utils import PretrainedConfig


__lowercase     :						List[Any]	=     {
    'susnato/ernie-m-base_pytorch': 'https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json',
    'susnato/ernie-m-large_pytorch': 'https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json',
}





class 							__UpperCamelCase    (		lowerCAmelCase_ ):
	A_           =   "ernie_m"
	A_           =   {"dropout": "classifier_dropout", "num_classes": "num_labels"}




	def __init__(       self						,    __a = 25_0002						,    __a = 768						,    __a = 12						,    __a = 12						,    __a = 3072						,    __a = "gelu"						,    __a = 0.1						,    __a = 0.1						,    __a = 514						,    __a = 0.02						,    __a = 1						,    __a = 1E-0_5						,    __a=None						,    __a=False						,    __a=0.0						,    **__a						,    ):

						'''simple docstring'''





						super().__init__(pad_token_id=__a						,    **__a							)
						__a      :	int    =  vocab_size
						__a      :	Dict    =  hidden_size
						__a      :	str    =  num_hidden_layers
						__a      :	Dict    =  num_attention_heads
						__a      :	List[str]    =  intermediate_size
						__a      :	Union[str, Any]    =  hidden_act
						__a      :	List[Any]    =  hidden_dropout_prob
						__a      :	str    =  attention_probs_dropout_prob
						__a      :	Any    =  max_position_embeddings
						__a      :	int    =  initializer_range
						__a      :	Dict    =  layer_norm_eps
						__a      :	int    =  classifier_dropout
						__a      :	Dict    =  is_decoder
						__a      :	int    =  act_dropout



