


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

						if text is None:
											return inputs

						elif audio is None:
											return encodings
						else:
											__a			:       Tuple					    =  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 typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


_A			:       Optional[int]   		=       {
    """configuration_llama""": ["""LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP""", """LlamaConfig"""],
}

try:
   if not is_sentencepiece_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _A			:       Union[str, Any]   		=       ["""LlamaTokenizer"""]

try:
   if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _A			:       Dict   		=       ["""LlamaTokenizerFast"""]

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _A			:       int   		=       [
       """LlamaForCausalLM""",
       """LlamaModel""",
       """LlamaPreTrainedModel""",
       """LlamaForSequenceClassification""",
   ]


if TYPE_CHECKING:
   from .configuration_llama import LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, LlamaConfig

   try:
      if not is_sentencepiece_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_llama import LlamaTokenizer

   try:
      if not is_tokenizers_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_llama_fast import LlamaTokenizerFast

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_llama import LlamaForCausalLM, LlamaForSequenceClassification, LlamaModel, LlamaPreTrainedModel


else:
   import sys

   _A			:       str   		=       _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)


