





"""simple docstring"""





from ...processing_utils import ProcessorMixin






class    _lowerCAmelCase  (	a			):
       """simple docstring"""




       __magic_name__	:Tuple						    =   """WhisperFeatureExtractor"""
       __magic_name__	:Dict						    =   """WhisperTokenizer"""






       def __init__(       self       ,					__UpperCAmelCase       ,					__UpperCAmelCase ):



         '''simple docstring'''

         super().__init__(__UpperCAmelCase       ,					__UpperCAmelCase )
         lowerCAmelCase__     :str											=				self.feature_extractor
         lowerCAmelCase__     :Any											=				False






       def 	snake_case		(       self       ,					__UpperCAmelCase=None       ,					__UpperCAmelCase=None       ,					__UpperCAmelCase=True ):



         '''simple docstring'''

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






       def __call__(       self       ,					*__UpperCAmelCase       ,					**__UpperCAmelCase ):



         '''simple docstring'''

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

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

         if text is None:
           return inputs

         elif audio is None:
           return encodings
         else:
           lowerCAmelCase__     :Optional[int]											=				encodings['input_ids']
           return inputs






       def 	snake_case		(       self       ,					*__UpperCAmelCase       ,					**__UpperCAmelCase ):



         '''simple docstring'''

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






       def 	snake_case		(       self       ,					*__UpperCAmelCase       ,					**__UpperCAmelCase ):



         '''simple docstring'''

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






       def 	snake_case		(       self       ,					__UpperCAmelCase       ,					__UpperCAmelCase="np" ):



         '''simple docstring'''

         return self.tokenizer.get_prompt_ids(__UpperCAmelCase       ,					return_tensors=__UpperCAmelCase )







"""simple docstring"""





from collections import OrderedDict
from typing import TYPE_CHECKING, Any, Mapping, Optional, Union

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


if TYPE_CHECKING:
  from ... import FeatureExtractionMixin, PreTrainedTokenizerBase, TensorType


__A											=						logging.get_logger(__name__)

__A											=						{
    """microsoft/deberta-v2-xlarge""": """https://huggingface.co/microsoft/deberta-v2-xlarge/resolve/main/config.json""",
    """microsoft/deberta-v2-xxlarge""": """https://huggingface.co/microsoft/deberta-v2-xxlarge/resolve/main/config.json""",
    """microsoft/deberta-v2-xlarge-mnli""": (
        """https://huggingface.co/microsoft/deberta-v2-xlarge-mnli/resolve/main/config.json"""
    ),
    """microsoft/deberta-v2-xxlarge-mnli""": (
        """https://huggingface.co/microsoft/deberta-v2-xxlarge-mnli/resolve/main/config.json"""
    ),
}






class    _lowerCAmelCase  (	a			):
       """simple docstring"""




       __magic_name__	:Union[str, Any]						    =   """deberta-v2"""






       def __init__(       self       ,					__UpperCAmelCase=1_2_8_1_0_0       ,					__UpperCAmelCase=1_5_3_6       ,					__UpperCAmelCase=2_4       ,					__UpperCAmelCase=2_4       ,					__UpperCAmelCase=6_1_4_4       ,					__UpperCAmelCase="gelu"       ,					__UpperCAmelCase=0.1       ,					__UpperCAmelCase=0.1       ,					__UpperCAmelCase=5_1_2       ,					__UpperCAmelCase=0       ,					__UpperCAmelCase=0.02       ,					__UpperCAmelCase=1E-7       ,					__UpperCAmelCase=False       ,					__UpperCAmelCase=-1       ,					__UpperCAmelCase=0       ,					__UpperCAmelCase=True       ,					__UpperCAmelCase=None       ,					__UpperCAmelCase=0       ,					__UpperCAmelCase="gelu"       ,					**__UpperCAmelCase       ,					):



         '''simple docstring'''

         super().__init__(**__UpperCAmelCase )

         lowerCAmelCase__     :Optional[int]											=				hidden_size
         lowerCAmelCase__     :Optional[int]											=				num_hidden_layers
         lowerCAmelCase__     :Optional[int]											=				num_attention_heads
         lowerCAmelCase__     :int											=				intermediate_size
         lowerCAmelCase__     :Dict											=				hidden_act
         lowerCAmelCase__     :Tuple											=				hidden_dropout_prob
         lowerCAmelCase__     :Optional[int]											=				attention_probs_dropout_prob
         lowerCAmelCase__     :Optional[Any]											=				max_position_embeddings
         lowerCAmelCase__     :Optional[Any]											=				type_vocab_size
         lowerCAmelCase__     :List[Any]											=				initializer_range
         lowerCAmelCase__     :Dict											=				relative_attention
         lowerCAmelCase__     :Union[str, Any]											=				max_relative_positions
         lowerCAmelCase__     :List[str]											=				pad_token_id
         lowerCAmelCase__     :Optional[int]											=				position_biased_input

         # Backwards compatibility
         if type(__UpperCAmelCase ) == str:
           lowerCAmelCase__     :Dict											=				[x.strip() for x in pos_att_type.lower().split('|' )]

         lowerCAmelCase__     :str											=				pos_att_type
         lowerCAmelCase__     :Dict											=				vocab_size
         lowerCAmelCase__     :Tuple											=				layer_norm_eps

         lowerCAmelCase__     :Optional[Any]											=				kwargs.get('pooler_hidden_size'       ,					__UpperCAmelCase )
         lowerCAmelCase__     :Union[str, Any]											=				pooler_dropout
         lowerCAmelCase__     :int											=				pooler_hidden_act






class    _lowerCAmelCase  (	a			):
       """simple docstring"""




       @property
       def 	snake_case		(       self ):



         '''simple docstring'''

         if self.task == "multiple-choice":
           lowerCAmelCase__     :str											=				{0: 'batch', 1: 'choice', 2: 'sequence'}
         else:
           lowerCAmelCase__     :Tuple											=				{0: 'batch', 1: 'sequence'}
         if self._config.type_vocab_size > 0:
           return OrderedDict(
               [('input_ids', dynamic_axis), ('attention_mask', dynamic_axis), ('token_type_ids', dynamic_axis)] )
         else:
           return OrderedDict([('input_ids', dynamic_axis), ('attention_mask', dynamic_axis)] )






       @property
       def 	snake_case		(       self ):



         '''simple docstring'''

         return 1_2






       def 	snake_case		(       self       ,					__UpperCAmelCase       ,					__UpperCAmelCase = -1       ,					__UpperCAmelCase = -1       ,					__UpperCAmelCase = -1       ,					__UpperCAmelCase = False       ,					__UpperCAmelCase = None       ,					__UpperCAmelCase = 3       ,					__UpperCAmelCase = 4_0       ,					__UpperCAmelCase = 4_0       ,					__UpperCAmelCase = None       ,					):



         '''simple docstring'''

         lowerCAmelCase__     :Union[str, Any]											=				super().generate_dummy_inputs(preprocessor=__UpperCAmelCase       ,					framework=__UpperCAmelCase )
         if self._config.type_vocab_size == 0 and "token_type_ids" in dummy_inputs:
           del dummy_inputs["token_type_ids"]
         return dummy_inputs
