


from typing import TYPE_CHECKING

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


lowerCamelCase_       :       List[str]      						=  {
    """configuration_squeezebert""": [
        """SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """SqueezeBertConfig""",
        """SqueezeBertOnnxConfig""",
    ],
    """tokenization_squeezebert""": ["""SqueezeBertTokenizer"""],
}

try:
       if not is_tokenizers_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCamelCase_       :       Tuple      						=  ["""SqueezeBertTokenizerFast"""]

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCamelCase_       :       Tuple      						=  [
           """SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """SqueezeBertForMaskedLM""",
           """SqueezeBertForMultipleChoice""",
           """SqueezeBertForQuestionAnswering""",
           """SqueezeBertForSequenceClassification""",
           """SqueezeBertForTokenClassification""",
           """SqueezeBertModel""",
           """SqueezeBertModule""",
           """SqueezeBertPreTrainedModel""",
       ]


if TYPE_CHECKING:
       from .configuration_squeezebert import (
           SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
           SqueezeBertConfig,
           SqueezeBertOnnxConfig,
       )
       from .tokenization_squeezebert import SqueezeBertTokenizer

       try:
              if not is_tokenizers_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_squeezebert_fast import SqueezeBertTokenizerFast

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_squeezebert import (
                  SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
                  SqueezeBertForMaskedLM,
                  SqueezeBertForMultipleChoice,
                  SqueezeBertForQuestionAnswering,
                  SqueezeBertForSequenceClassification,
                  SqueezeBertForTokenClassification,
                  SqueezeBertModel,
                  SqueezeBertModule,
                  SqueezeBertPreTrainedModel,
              )

else:
       import sys

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



"""simple docstring"""







from ...processing_utils import ProcessorMixin






class 				__A    (	_SCREAMING_SNAKE_CASE      ):






 """simple docstring"""




 __lowerCAmelCase			 =  "WhisperFeatureExtractor"
 __lowerCAmelCase			 =  "WhisperTokenizer"


 def __init__(		self			,   __A			,   __A						) ->					Dict:
     super().__init__(__A			,   __A						)
     a					=self.feature_extractor
     a					=False


 def 				SCREAMING_SNAKE_CASE							(		self			,   __A=None			,   __A=None			,   __A=True						) ->					int:
     return self.tokenizer.get_decoder_prompt_ids(task=__A			,   language=__A			,   no_timestamps=__A						)


 def __call__(		self			,   *__A			,   **__A						) ->					Tuple:
     # For backward compatibility
     if self._in_target_context_manager:
         return self.current_processor(*__A			,   **__A						)

     a					=kwargs.pop('''audio'''			,   __A						)
     a					=kwargs.pop('''sampling_rate'''			,   __A						)
     a					=kwargs.pop('''text'''			,   __A						)
     if len(__A						) > 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(__A			,   *__A			,   sampling_rate=__A			,   **__A						)
     if text is not None:
         a					=self.tokenizer(__A			,   **__A						)

     if text is None:
         return inputs

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


 def 				SCREAMING_SNAKE_CASE							(		self			,   *__A			,   **__A						) ->					Optional[Any]:
     return self.tokenizer.batch_decode(*__A			,   **__A						)


 def 				SCREAMING_SNAKE_CASE							(		self			,   *__A			,   **__A						) ->					Union[str, Any]:
     return self.tokenizer.decode(*__A			,   **__A						)





 def 				SCREAMING_SNAKE_CASE							(		self			,   __A			,   __A="np"						) ->					Optional[Any]:
     return self.tokenizer.get_prompt_ids(__A			,   return_tensors=__A						)