


'''simple docstring'''
from ...processing_utils import ProcessorMixin




class 			lowerCamelCase_   (	__a      ):
      lowerCAmelCase__		     =     'WhisperFeatureExtractor'
      lowerCAmelCase__		     =     'WhisperTokenizer'






      def __init__(					self				:    Optional[int]						,						_A				:    Optional[int]						,						_A				:    Any ):


          '''simple docstring'''


          super().__init__(_A						,						_A )
          UpperCAmelCase__			:		int													=				self.feature_extractor
          UpperCAmelCase__			:		int													=				False






      def lowercase_							(					self				:    Optional[int]						,						_A				:    Any=None						,						_A				:    Optional[Any]=None						,						_A				:    Optional[Any]=True ):


          '''simple docstring'''


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






      def __call__(					self				:    Any						,						*_A				:    Optional[Any]						,						**_A				:    Dict ):


          '''simple docstring'''


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

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

          if text is None:
              return inputs

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






      def lowercase_							(					self				:    Optional[Any]						,						*_A				:    int						,						**_A				:    Any ):


          '''simple docstring'''


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






      def lowercase_							(					self				:    List[Any]						,						*_A				:    List[Any]						,						**_A				:    int ):


          '''simple docstring'''


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






      def lowercase_							(					self				:    List[str]						,						_A				:    str						,						_A				:    List[Any]="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_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


UpperCamelCase__    					=      {
    '''configuration_rembert''': ['''REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''RemBertConfig''', '''RemBertOnnxConfig''']
}

try:
  if not is_sentencepiece_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCamelCase__    					=      ['''RemBertTokenizer''']

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCamelCase__    					=      ['''RemBertTokenizerFast''']

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCamelCase__    					=      [
      '''REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
      '''RemBertForCausalLM''',
      '''RemBertForMaskedLM''',
      '''RemBertForMultipleChoice''',
      '''RemBertForQuestionAnswering''',
      '''RemBertForSequenceClassification''',
      '''RemBertForTokenClassification''',
      '''RemBertLayer''',
      '''RemBertModel''',
      '''RemBertPreTrainedModel''',
      '''load_tf_weights_in_rembert''',
  ]


try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCamelCase__    					=      [
      '''TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
      '''TFRemBertForCausalLM''',
      '''TFRemBertForMaskedLM''',
      '''TFRemBertForMultipleChoice''',
      '''TFRemBertForQuestionAnswering''',
      '''TFRemBertForSequenceClassification''',
      '''TFRemBertForTokenClassification''',
      '''TFRemBertLayer''',
      '''TFRemBertModel''',
      '''TFRemBertPreTrainedModel''',
  ]


if TYPE_CHECKING:
  from .configuration_rembert import REMBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RemBertConfig, RemBertOnnxConfig

  try:
    if not is_sentencepiece_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_rembert import RemBertTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_rembert_fast import RemBertTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_rembert import (
        REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
        RemBertForCausalLM,
        RemBertForMaskedLM,
        RemBertForMultipleChoice,
        RemBertForQuestionAnswering,
        RemBertForSequenceClassification,
        RemBertForTokenClassification,
        RemBertLayer,
        RemBertModel,
        RemBertPreTrainedModel,
        load_tf_weights_in_rembert,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_rembert import (
        TF_REMBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFRemBertForCausalLM,
        TFRemBertForMaskedLM,
        TFRemBertForMultipleChoice,
        TFRemBertForQuestionAnswering,
        TFRemBertForSequenceClassification,
        TFRemBertForTokenClassification,
        TFRemBertLayer,
        TFRemBertModel,
        TFRemBertPreTrainedModel,
    )


else:
  import sys

  UpperCamelCase__    					=      _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)
