


import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin







class     _lowercase				(							lowercase__):


       """simple docstring"""




       A__      		=    "Speech2TextFeatureExtractor"
       A__      		=    "Speech2TextTokenizer"





       def __init__(     self							:    Optional[int]      ,   __lowerCamelCase							:    Tuple      ,   __lowerCamelCase							:    Optional[int] ):


             '''simple docstring'''



             super().__init__(__lowerCamelCase      ,   __lowerCamelCase )
             lowerCamelCase__	:       str					=						self.feature_extractor
             lowerCamelCase__	:       Optional[int]					=						False





       def __call__(     self							:    Optional[int]      ,   *__lowerCamelCase							:    List[Any]      ,   **__lowerCamelCase							:    str ):


             '''simple docstring'''



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

             if "raw_speech" in kwargs:
                   warnings.warn("Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead." )
                   lowerCamelCase__	:       Tuple					=						kwargs.pop("raw_speech" )
             else:
                   lowerCamelCase__	:       Optional[int]					=						kwargs.pop("audio"      ,   __lowerCamelCase )
             lowerCamelCase__	:       Any					=						kwargs.pop("sampling_rate"      ,   __lowerCamelCase )
             lowerCamelCase__	:       Optional[int]					=						kwargs.pop("text"      ,   __lowerCamelCase )
             if len(__lowerCamelCase ) > 0:
                   lowerCamelCase__	:       List[str]					=						args[0]
                   lowerCamelCase__	:       int					=						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(__lowerCamelCase      ,   *__lowerCamelCase      ,   sampling_rate=__lowerCamelCase      ,   **__lowerCamelCase )
             if text is not None:
                   lowerCamelCase__	:       str					=						self.tokenizer(__lowerCamelCase      ,   **__lowerCamelCase )

             if text is None:
                   return inputs
             elif audio is None:
                   return encodings
             else:
                   lowerCamelCase__	:       List[str]					=						encodings["input_ids"]
                   return inputs





       def 		lowerCAmelCase  (     self							:    Optional[int]      ,   *__lowerCamelCase							:    str      ,   **__lowerCamelCase							:    Optional[Any] ):


             '''simple docstring'''



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





       def 		lowerCAmelCase  (     self							:    Union[str, Any]      ,   *__lowerCamelCase							:    int      ,   **__lowerCamelCase							:    List[Any] ):


             '''simple docstring'''



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





       @contextmanager
       def 		lowerCAmelCase  (     self							:    List[Any] ):


             '''simple docstring'''



             warnings.warn(
                 "`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your "
                 "labels by using the argument `text` of the regular `__call__` method (either in the same call as "
                 "your audio inputs, or in a separate call." )
             lowerCamelCase__	:       int					=						True
             lowerCamelCase__	:       Dict					=						self.tokenizer
             yield
             lowerCamelCase__	:       Tuple					=						self.feature_extractor
             lowerCamelCase__	:       Any					=						False






from collections import OrderedDict
from typing import Mapping

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


A   :					Union[str, Any]	=      logging.get_logger(__name__)

A   :					Dict	=      {
    "kssteven/ibert-roberta-base": "https://huggingface.co/kssteven/ibert-roberta-base/resolve/main/config.json",
    "kssteven/ibert-roberta-large": "https://huggingface.co/kssteven/ibert-roberta-large/resolve/main/config.json",
    "kssteven/ibert-roberta-large-mnli": (
        "https://huggingface.co/kssteven/ibert-roberta-large-mnli/resolve/main/config.json"
    ),
}







class     _lowercase				(							lowercase__):


       """simple docstring"""




       A__      		=    "ibert"





       def __init__(     self							:    int      ,   __lowerCamelCase							:    List[str]=30522      ,   __lowerCamelCase							:    Optional[int]=768      ,   __lowerCamelCase							:    List[Any]=12      ,   __lowerCamelCase							:    str=12      ,   __lowerCamelCase							:    List[str]=3072      ,   __lowerCamelCase							:    Dict="gelu"      ,   __lowerCamelCase							:    Dict=0.1      ,   __lowerCamelCase							:    Optional[int]=0.1      ,   __lowerCamelCase							:    Any=512      ,   __lowerCamelCase							:    List[str]=2      ,   __lowerCamelCase							:    Union[str, Any]=0.0_2      ,   __lowerCamelCase							:    Any=1E-1_2      ,   __lowerCamelCase							:    int=1      ,   __lowerCamelCase							:    Optional[Any]=0      ,   __lowerCamelCase							:    int=2      ,   __lowerCamelCase							:    int="absolute"      ,   __lowerCamelCase							:    Tuple=False      ,   __lowerCamelCase							:    Dict="none"      ,   **__lowerCamelCase							:    Tuple      ,   ):


             '''simple docstring'''



             super().__init__(pad_token_id=__lowerCamelCase      ,   bos_token_id=__lowerCamelCase      ,   eos_token_id=__lowerCamelCase      ,   **__lowerCamelCase )

             lowerCamelCase__	:       Any					=						vocab_size
             lowerCamelCase__	:       Optional[Any]					=						hidden_size
             lowerCamelCase__	:       Optional[int]					=						num_hidden_layers
             lowerCamelCase__	:       int					=						num_attention_heads
             lowerCamelCase__	:       List[str]					=						hidden_act
             lowerCamelCase__	:       List[str]					=						intermediate_size
             lowerCamelCase__	:       Optional[int]					=						hidden_dropout_prob
             lowerCamelCase__	:       Any					=						attention_probs_dropout_prob
             lowerCamelCase__	:       Tuple					=						max_position_embeddings
             lowerCamelCase__	:       Any					=						type_vocab_size
             lowerCamelCase__	:       Optional[int]					=						initializer_range
             lowerCamelCase__	:       Tuple					=						layer_norm_eps
             lowerCamelCase__	:       int					=						position_embedding_type
             lowerCamelCase__	:       List[str]					=						quant_mode
             lowerCamelCase__	:       int					=						force_dequant







class     _lowercase				(							lowercase__):


       """simple docstring"""




       @property
       def 		lowerCAmelCase  (     self							:    List[Any] ):


             '''simple docstring'''



             if self.task == "multiple-choice":
                   lowerCamelCase__	:       Any					=						{0: "batch", 1: "choice", 2: "sequence"}
             else:
                   lowerCamelCase__	:       Any					=						{0: "batch", 1: "sequence"}
             return OrderedDict(
                 [
                     ("input_ids", dynamic_axis),
                     ("attention_mask", dynamic_axis),
                 ] )


