


from ...processing_utils import ProcessorMixin







class        __lowercase       (							a_  ):



		"""simple docstring"""

		UpperCamelCase     :					Dict			       =		"WhisperFeatureExtractor"
		UpperCamelCase     :					Optional[int]			       =		"WhisperTokenizer"







		def __init__( self		,      A		,      A	)  -> Optional[int]:







					'''simple docstring'''







					super().__init__(A		,      A	)
					lowerCamelCase    		=  self.feature_extractor
					lowerCamelCase    		=  False







		def 					__A   ( self		,      A=None		,      A=None		,      A=True	)  -> Dict:







					'''simple docstring'''







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







		def __call__( self		,      *A		,      **A	)  -> str:







					'''simple docstring'''







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

					lowerCamelCase    		=  kwargs.pop("""audio"""		,      A	)
					lowerCamelCase    		=  kwargs.pop("""sampling_rate"""		,      A	)
					lowerCamelCase    		=  kwargs.pop("""text"""		,      A	)
					if len(A	) > 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(A		,      *A		,      sampling_rate=A		,      **A	)
					if text is not None:
								lowerCamelCase    		=  self.tokenizer(A		,      **A	)

					if text is None:
								return inputs

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







		def 					__A   ( self		,      *A		,      **A	)  -> List[str]:







					'''simple docstring'''







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







		def 					__A   ( self		,      *A		,      **A	)  -> Optional[int]:







					'''simple docstring'''







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







		def 					__A   ( self		,      A		,      A="np"	)  -> Any:







					'''simple docstring'''







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





import logging
from dataclasses import dataclass, field
from typing import Optional

from seqaseq_trainer import arg_to_scheduler

from transformers import TrainingArguments


UpperCAmelCase   :    Optional[Any]     =		logging.getLogger(__name__)







@dataclass
class        __lowercase       (							a_  ):



		"""simple docstring"""

		UpperCamelCase     :					Optional[float]			       =		field(
		    default=0.0			,							metadata={"help": "The label smoothing epsilon to apply (if not zero)."}  )
		UpperCamelCase     :					bool			       =		field(default=a_			,							metadata={"help": "Whether to SortishSamler or not."}  )
		UpperCamelCase     :					bool			       =		field(
		    default=a_			,							metadata={"help": "Whether to use generate to calculate generative metrics (ROUGE, BLEU)."}  )
		UpperCamelCase     :					bool			       =		field(default=a_			,							metadata={"help": "whether to use adafactor"}  )
		UpperCamelCase     :					Optional[float]			       =		field(
		    default=a_			,							metadata={"help": "Encoder layer dropout probability. Goes into model.config."}  )
		UpperCamelCase     :					Optional[float]			       =		field(
		    default=a_			,							metadata={"help": "Decoder layer dropout probability. Goes into model.config."}  )
		UpperCamelCase     :					Optional[float]			       =		field(default=a_			,							metadata={"help": "Dropout probability. Goes into model.config."}  )
		UpperCamelCase     :					Optional[float]			       =		field(
		    default=a_			,							metadata={"help": "Attention dropout probability. Goes into model.config."}  )
		UpperCamelCase     :					Optional[str]			       =		field(
		    default="linear"			,							metadata={"help": f'''Which lr scheduler to use. Selected in {sorted(arg_to_scheduler.keys()  )}'''}			,							)

