"""simple docstring"""



from typing import TYPE_CHECKING

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


SCREAMING_SNAKE_CASE__:Tuple			=	{
    """configuration_convbert""": ["""CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """ConvBertConfig""", """ConvBertOnnxConfig"""],
    """tokenization_convbert""": ["""ConvBertTokenizer"""],
}

try:
			if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			SCREAMING_SNAKE_CASE__:Any			=	["""ConvBertTokenizerFast"""]

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			SCREAMING_SNAKE_CASE__:Dict			=	[
			    """CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
			    """ConvBertForMaskedLM""",
			    """ConvBertForMultipleChoice""",
			    """ConvBertForQuestionAnswering""",
			    """ConvBertForSequenceClassification""",
			    """ConvBertForTokenClassification""",
			    """ConvBertLayer""",
			    """ConvBertModel""",
			    """ConvBertPreTrainedModel""",
			    """load_tf_weights_in_convbert""",
			]


try:
			if not is_tf_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			SCREAMING_SNAKE_CASE__:int			=	[
			    """TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
			    """TFConvBertForMaskedLM""",
			    """TFConvBertForMultipleChoice""",
			    """TFConvBertForQuestionAnswering""",
			    """TFConvBertForSequenceClassification""",
			    """TFConvBertForTokenClassification""",
			    """TFConvBertLayer""",
			    """TFConvBertModel""",
			    """TFConvBertPreTrainedModel""",
			]


if TYPE_CHECKING:
			from .configuration_convbert import CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvBertConfig, ConvBertOnnxConfig
			from .tokenization_convbert import ConvBertTokenizer

			try:
						if not is_tokenizers_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .tokenization_convbert_fast import ConvBertTokenizerFast

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_convbert import (
						    CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
						    ConvBertForMaskedLM,
						    ConvBertForMultipleChoice,
						    ConvBertForQuestionAnswering,
						    ConvBertForSequenceClassification,
						    ConvBertForTokenClassification,
						    ConvBertLayer,
						    ConvBertModel,
						    ConvBertPreTrainedModel,
						    load_tf_weights_in_convbert,
						)

			try:
						if not is_tf_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_tf_convbert import (
						    TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
						    TFConvBertForMaskedLM,
						    TFConvBertForMultipleChoice,
						    TFConvBertForQuestionAnswering,
						    TFConvBertForSequenceClassification,
						    TFConvBertForTokenClassification,
						    TFConvBertLayer,
						    TFConvBertModel,
						    TFConvBertPreTrainedModel,
						)


else:
			import sys

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

"""simple docstring"""



from ...processing_utils import ProcessorMixin






class 				snake_case__     (   snake_case_   ):
 _snake_case   :			List[str]           =		"""WhisperFeatureExtractor"""
 _snake_case   :			Any           =		"""WhisperTokenizer"""


 def __init__(				self  ,						lowerCamelCase  ,						lowerCamelCase		):
        super().__init__(lowerCamelCase  ,						lowerCamelCase		)
        __a     				=  self.feature_extractor
        __a     				=  False


 def 		a__ (				self  ,						lowerCamelCase=None  ,						lowerCamelCase=None  ,						lowerCamelCase=True		):
        return self.tokenizer.get_decoder_prompt_ids(task=lowerCamelCase  ,						language=lowerCamelCase  ,						no_timestamps=lowerCamelCase		)


 def __call__(				self  ,						*lowerCamelCase  ,						**lowerCamelCase		):
        # For backward compatibility
        if self._in_target_context_manager:
               return self.current_processor(*lowerCamelCase  ,						**lowerCamelCase		)

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

        if text is None:
               return inputs

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


 def 		a__ (				self  ,						*lowerCamelCase  ,						**lowerCamelCase		):
        return self.tokenizer.batch_decode(*lowerCamelCase  ,						**lowerCamelCase		)


 def 		a__ (				self  ,						*lowerCamelCase  ,						**lowerCamelCase		):
        return self.tokenizer.decode(*lowerCamelCase  ,						**lowerCamelCase		)






 def 		a__ (				self  ,						lowerCamelCase  ,						lowerCamelCase="np"		):
        return self.tokenizer.get_prompt_ids(lowerCamelCase  ,						return_tensors=lowerCamelCase		)
