





"""simple docstring"""



from ...processing_utils import ProcessorMixin






class 		__snake_case (		SCREAMING_SNAKE_CASE__					):





	"""simple docstring"""


	_lowerCamelCase				=					"""WhisperFeatureExtractor"""
	_lowerCamelCase				=					"""WhisperTokenizer"""

	def __init__(   self ,						__lowerCamelCase ,						__lowerCamelCase  ):



					'''simple docstring'''




					super().__init__(__lowerCamelCase ,						__lowerCamelCase  )
					__A   :						Dict									=					self.feature_extractor
					__A   :						Dict									=					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  )

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

					if text is None:
									return inputs

					elif audio is None:
									return encodings
					else:
									__A   :						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  )











"""simple docstring"""



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


a_			=      {
    """configuration_bloom""": ["""BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP""", """BloomConfig""", """BloomOnnxConfig"""],
}
try:
       if not is_tokenizers_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       a_			=      ["""BloomTokenizerFast"""]

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       a_			=      [
           """BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """BloomForCausalLM""",
           """BloomModel""",
           """BloomPreTrainedModel""",
           """BloomForSequenceClassification""",
           """BloomForTokenClassification""",
           """BloomForQuestionAnswering""",
       ]

if TYPE_CHECKING:
       from .configuration_bloom import BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP, BloomConfig, BloomOnnxConfig

       try:
              if not is_tokenizers_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_bloom_fast import BloomTokenizerFast

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_bloom import (
                  BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST,
                  BloomForCausalLM,
                  BloomForQuestionAnswering,
                  BloomForSequenceClassification,
                  BloomForTokenClassification,
                  BloomModel,
                  BloomPreTrainedModel,
              )

else:
       import sys

       a_			=      _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)




