'''simple docstring'''


from ...processing_utils import ProcessorMixin






class 						A   (   UpperCAmelCase   ):
							a_        =      '''WhisperFeatureExtractor'''
							a_        =      '''WhisperTokenizer'''





							def __init__(      self				:							int     ,		__a				:							str     ,		__a				:							List[Any]	)							->	Dict:
								super().__init__(__a     ,		__a	)
								__UpperCAmelCase							=			self.feature_extractor
								__UpperCAmelCase							=			False





							def       snake_case__						(      self				:							Tuple     ,		__a				:							Tuple=None     ,		__a				:							Tuple=None     ,		__a				:							List[Any]=True	)							->	Dict:
								return self.tokenizer.get_decoder_prompt_ids(task=__a     ,		language=__a     ,		no_timestamps=__a	)





							def __call__(      self				:							Dict     ,		*__a				:							int     ,		**__a				:							Any	)							->	List[Any]:
								# For backward compatibility
								if self._in_target_context_manager:
									return self.current_processor(*__a     ,		**__a	)

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

								if text is None:
									return inputs

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





							def       snake_case__						(      self				:							Tuple     ,		*__a				:							List[str]     ,		**__a				:							Union[str, Any]	)							->	Any:
								return self.tokenizer.batch_decode(*__a     ,		**__a	)





							def       snake_case__						(      self				:							Optional[Any]     ,		*__a				:							List[str]     ,		**__a				:							Union[str, Any]	)							->	Tuple:
								return self.tokenizer.decode(*__a     ,		**__a	)






							def       snake_case__						(      self				:							str     ,		__a				:							str     ,		__a				:							List[Any]="np"	)							->	Dict:
								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,
)


__lowerCAmelCase	:       Optional[Any]						       =	{
    "configuration_llama": ["LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP", "LlamaConfig"],
}

try:
					if not is_sentencepiece_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					__lowerCAmelCase	:       str						       =	["LlamaTokenizer"]

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

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					__lowerCAmelCase	:       Union[str, Any]						       =	[
					    "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

					__lowerCAmelCase	:       Optional[Any]						       =	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
