




"""simple docstring"""


from collections import OrderedDict
from typing import Mapping

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


_A													=      logging.get_logger(__name__)

_A													=      {
    """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    (					a_						):
   _lowerCamelCase    :Any     				=     "xlm-roberta"






   def __init__(		self       :		int   ,     UpperCamelCase       :		Optional[int]=3_05_22   ,     UpperCamelCase       :		Dict=7_68   ,     UpperCamelCase       :		str=12   ,     UpperCamelCase       :		Dict=12   ,     UpperCamelCase       :		List[str]=30_72   ,     UpperCamelCase       :		str="gelu"   ,     UpperCamelCase       :		int=0.1   ,     UpperCamelCase       :		Dict=0.1   ,     UpperCamelCase       :		Optional[Any]=5_12   ,     UpperCamelCase       :		Dict=2   ,     UpperCamelCase       :		Optional[Any]=0.02   ,     UpperCamelCase       :		List[str]=1E-1_2   ,     UpperCamelCase       :		Any=1   ,     UpperCamelCase       :		Optional[Any]=0   ,     UpperCamelCase       :		Optional[int]=2   ,     UpperCamelCase       :		Any="absolute"   ,     UpperCamelCase       :		Tuple=True   ,     UpperCamelCase       :		Union[str, Any]=None   ,     **UpperCamelCase       :		Union[str, Any]   ,     )			->						Any:

         """simple docstring"""
         super().__init__(pad_token_id=UpperCamelCase   ,     bos_token_id=UpperCamelCase   ,     eos_token_id=UpperCamelCase   ,     **UpperCamelCase   )

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






class _lowerCamelCase    (					a_						):






   @property
   def 	_lowerCAmelCase   (		self       :		Optional[int]   )			->						Mapping[str, Mapping[int, str]]:

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











"""simple docstring"""


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

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


@dataclass(frozen=a_						)
class _lowerCamelCase    (					a_						):
   _lowerCamelCase    :str     				=     field(default="audio-classification"       ,	metadata={"include_in_asdict_even_if_is_default": True}						)
   _lowerCamelCase    :ClassVar[Features]     				=     Features({"audio": Audio()}						)
   _lowerCamelCase    :ClassVar[Features]     				=     Features({"labels": ClassLabel}						)
   _lowerCamelCase    :str     				=     "audio"
   _lowerCamelCase    :str     				=     "labels"






   def 	_lowerCAmelCase   (		self       :		str   ,     UpperCamelCase       :		Optional[int]   )			->						Union[str, Any]:

         """simple docstring"""
         if self.label_column not in features:
               raise ValueError(f"""Column {self.label_column} is not present in features."""   )
         if not isinstance(features[self.label_column]   ,     UpperCamelCase   ):
               raise ValueError(f"""Column {self.label_column} is not a ClassLabel."""   )
         lowerCAmelCase__      :			str   =	copy.deepcopy(self   )
         lowerCAmelCase__      :			Optional[int]   =	self.label_schema.copy()
         lowerCAmelCase__      :			List[Any]   =	features[self.label_column]
         lowerCAmelCase__      :			Optional[int]   =	label_schema
         return task_template






   @property
   def 	_lowerCAmelCase   (		self       :		List[Any]   )			->						Dict[str, str]:

         """simple docstring"""
         return {
             self.audio_column: "audio",
             self.label_column: "labels",
         }





