





from collections import OrderedDict
from typing import Mapping

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


_UpperCamelCase				=       logging.get_logger(__name__)

_UpperCamelCase				=       {
    "xlm-roberta-base": "https://huggingface.co/xlm-roberta-base/resolve/main/config.json",
    "xlm-roberta-large": "https://huggingface.co/xlm-roberta-large/resolve/main/config.json",
    "xlm-roberta-large-finetuned-conll02-dutch": (
        "https://huggingface.co/xlm-roberta-large-finetuned-conll02-dutch/resolve/main/config.json"
    ),
    "xlm-roberta-large-finetuned-conll02-spanish": (
        "https://huggingface.co/xlm-roberta-large-finetuned-conll02-spanish/resolve/main/config.json"
    ),
    "xlm-roberta-large-finetuned-conll03-english": (
        "https://huggingface.co/xlm-roberta-large-finetuned-conll03-english/resolve/main/config.json"
    ),
    "xlm-roberta-large-finetuned-conll03-german": (
        "https://huggingface.co/xlm-roberta-large-finetuned-conll03-german/resolve/main/config.json"
    ),
}




class  _lowerCamelCase       (			lowercase__			):



      """simple docstring"""






      UpperCAmelCase_  :					Tuple      			="xlm-roberta"







      def __init__(       self ,  UpperCAmelCase=30522 ,  UpperCAmelCase=768 ,  UpperCAmelCase=12 ,  UpperCAmelCase=12 ,  UpperCAmelCase=3072 ,  UpperCAmelCase="gelu" ,  UpperCAmelCase=0.1 ,  UpperCAmelCase=0.1 ,  UpperCAmelCase=512 ,  UpperCAmelCase=2 ,  UpperCAmelCase=0.02 ,  UpperCAmelCase=1E-12 ,  UpperCAmelCase=1 ,  UpperCAmelCase=0 ,  UpperCAmelCase=2 ,  UpperCAmelCase="absolute" ,  UpperCAmelCase=True ,  UpperCAmelCase=None ,  **UpperCAmelCase ,  )				->      List[str]:






        '''simple docstring'''






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

        __snake_case      : str						=				vocab_size
        __snake_case      : Any						=				hidden_size
        __snake_case      : Optional[Any]						=				num_hidden_layers
        __snake_case      : Union[str, Any]						=				num_attention_heads
        __snake_case      : Any						=				hidden_act
        __snake_case      : str						=				intermediate_size
        __snake_case      : Optional[int]						=				hidden_dropout_prob
        __snake_case      : Any						=				attention_probs_dropout_prob
        __snake_case      : Union[str, Any]						=				max_position_embeddings
        __snake_case      : List[str]						=				type_vocab_size
        __snake_case      : Tuple						=				initializer_range
        __snake_case      : Tuple						=				layer_norm_eps
        __snake_case      : Any						=				position_embedding_type
        __snake_case      : Any						=				use_cache
        __snake_case      : Any						=				classifier_dropout




class  _lowerCamelCase       (			lowercase__			):



      """simple docstring"""






      @property
      def   UpperCAmelCase						(       self      )				->      Dict:






        '''simple docstring'''






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





import copy
from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Audio, Features, Value
from .base import TaskTemplate







@dataclass(frozen=lowercase__)
class 			_lowercase (							lowercase__):


       """simple docstring"""




       A__											=			field(default="automatic-speech-recognition"							,  metadata={"include_in_asdict_even_if_is_default": True})
       A__											=			Features({"audio": Audio()})
       A__											=			Features({"transcription": Value("string")})
       A__											=			"audio"
       A__											=			"transcription"





       def 						lowerCAmelCase     (   self							:			Any					,      __lowerCamelCase							:			int       ):


             '''simple docstring'''



             if self.audio_column not in features:
                   raise ValueError(f"Column {self.audio_column} is not present in features."       )
             if not isinstance(features[self.audio_column]					,      __lowerCamelCase       ):
                   raise ValueError(f"Column {self.audio_column} is not an Audio type."       )
             lowerCamelCase__		:				Tuple    =  copy.deepcopy(self       )
             lowerCamelCase__		:				Tuple    =  self.input_schema.copy()
             lowerCamelCase__		:				Optional[int]    =  features[self.audio_column]
             lowerCamelCase__		:				int    =  input_schema
             return task_template





       @property
       def 						lowerCAmelCase     (   self							:			int       ):


             '''simple docstring'''



             return {self.audio_column: "audio", self.transcription_column: "transcription"}


