






"""simple docstring"""







from collections import OrderedDict
from typing import Mapping

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


_lowerCAmelCase            =	logging.get_logger(__name__)

_lowerCAmelCase            =	{
    'xlm-mlm-en-2048': 'https://huggingface.co/xlm-mlm-en-2048/resolve/main/config.json',
    'xlm-mlm-ende-1024': 'https://huggingface.co/xlm-mlm-ende-1024/resolve/main/config.json',
    'xlm-mlm-enfr-1024': 'https://huggingface.co/xlm-mlm-enfr-1024/resolve/main/config.json',
    'xlm-mlm-enro-1024': 'https://huggingface.co/xlm-mlm-enro-1024/resolve/main/config.json',
    'xlm-mlm-tlm-xnli15-1024': 'https://huggingface.co/xlm-mlm-tlm-xnli15-1024/resolve/main/config.json',
    'xlm-mlm-xnli15-1024': 'https://huggingface.co/xlm-mlm-xnli15-1024/resolve/main/config.json',
    'xlm-clm-enfr-1024': 'https://huggingface.co/xlm-clm-enfr-1024/resolve/main/config.json',
    'xlm-clm-ende-1024': 'https://huggingface.co/xlm-clm-ende-1024/resolve/main/config.json',
    'xlm-mlm-17-1280': 'https://huggingface.co/xlm-mlm-17-1280/resolve/main/config.json',
    'xlm-mlm-100-1280': 'https://huggingface.co/xlm-mlm-100-1280/resolve/main/config.json',
}


class      UpperCamelCase		(SCREAMING_SNAKE_CASE__     ):
						_SCREAMING_SNAKE_CASE  : List[Any]												=		'''xlm'''
						_SCREAMING_SNAKE_CASE  : str												=		{
						    '''hidden_size''': '''emb_dim''',
						    '''num_attention_heads''': '''n_heads''',
						    '''num_hidden_layers''': '''n_layers''',
						    '''n_words''': '''vocab_size''',  # For backward compatibility
						}






						def __init__(		self  :Union[str, Any]			, __magic_name__  :Dict=30_145			, __magic_name__  :List[str]=2_048			, __magic_name__  :str=12			, __magic_name__  :Union[str, Any]=16			, __magic_name__  :List[Any]=0.1			, __magic_name__  :List[str]=0.1			, __magic_name__  :Optional[Any]=True			, __magic_name__  :Optional[Any]=False			, __magic_name__  :int=False			, __magic_name__  :str=False			, __magic_name__  :str=1			, __magic_name__  :Union[str, Any]=True			, __magic_name__  :List[str]=512			, __magic_name__  :Dict=2_048**-0.5			, __magic_name__  :Union[str, Any]=1E-12			, __magic_name__  :Optional[Any]=0.02			, __magic_name__  :Dict=0			, __magic_name__  :Tuple=1			, __magic_name__  :Any=2			, __magic_name__  :List[Any]=3			, __magic_name__  :Union[str, Any]=5			, __magic_name__  :Any=True			, __magic_name__  :List[str]="first"			, __magic_name__  :Tuple=True			, __magic_name__  :Any=None			, __magic_name__  :Optional[Any]=True			, __magic_name__  :int=0.1			, __magic_name__  :Optional[Any]=5			, __magic_name__  :Optional[Any]=5			, __magic_name__  :Dict=0			, __magic_name__  :int=0			, __magic_name__  :Optional[int]=2			, __magic_name__  :int=0			, **__magic_name__  :Optional[Any]			, )      ->Union[str, Any]:
										lowercase    :      str       = vocab_size
										lowercase    :      List[Any]       = emb_dim
										lowercase    :      Union[str, Any]       = n_layers
										lowercase    :      str       = n_heads
										lowercase    :      str       = dropout
										lowercase    :      int       = attention_dropout
										lowercase    :      Union[str, Any]       = gelu_activation
										lowercase    :      Any       = sinusoidal_embeddings
										lowercase    :      Dict       = causal
										lowercase    :      List[Any]       = asm
										lowercase    :      str       = n_langs
										lowercase    :      Union[str, Any]       = use_lang_emb
										lowercase    :      int       = layer_norm_eps
										lowercase    :      Union[str, Any]       = bos_index
										lowercase    :      List[Any]       = eos_index
										lowercase    :      Tuple       = pad_index
										lowercase    :      List[str]       = unk_index
										lowercase    :      Union[str, Any]       = mask_index
										lowercase    :      List[Any]       = is_encoder
										lowercase    :      Union[str, Any]       = max_position_embeddings
										lowercase    :      Any       = embed_init_std
										lowercase    :      Optional[int]       = init_std
										lowercase    :      Optional[int]       = summary_type
										lowercase    :      Dict       = summary_use_proj
										lowercase    :      Tuple       = summary_activation
										lowercase    :      Tuple       = summary_proj_to_labels
										lowercase    :      int       = summary_first_dropout
										lowercase    :      Any       = start_n_top
										lowercase    :      Any       = end_n_top
										lowercase    :      Tuple       = mask_token_id
										lowercase    :      Tuple       = lang_id

										if "n_words" in kwargs:
														lowercase    :      Optional[Any]       = kwargs["""n_words"""]

										super().__init__(pad_token_id=__lowerCAmelCase			, bos_token_id=__lowerCAmelCase			, **__lowerCAmelCase				)


class      UpperCamelCase		(SCREAMING_SNAKE_CASE__     ):






						@property
						def      __snake_case      (		self  :Optional[int]				)      ->int:
										if self.task == "multiple-choice":
														lowercase    :      str       = {0: """batch""", 1: """choice""", 2: """sequence"""}
										else:
														lowercase    :      Dict       = {0: """batch""", 1: """sequence"""}
										return OrderedDict(
										    [
										        ("""input_ids""", dynamic_axis),
										        ("""attention_mask""", dynamic_axis),
										        ("""token_type_ids""", dynamic_axis),
										    ]				)








'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCamelCase      					={
    "configuration_clap": [
        "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST",
        "ClapAudioConfig",
        "ClapConfig",
        "ClapTextConfig",
    ],
    "processing_clap": ["ClapProcessor"],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCamelCase      					=[
          "CLAP_PRETRAINED_MODEL_ARCHIVE_LIST",
          "ClapModel",
          "ClapPreTrainedModel",
          "ClapTextModel",
          "ClapTextModelWithProjection",
          "ClapAudioModel",
          "ClapAudioModelWithProjection",
      ]
      UpperCamelCase      					=["ClapFeatureExtractor"]

if TYPE_CHECKING:
      from .configuration_clap import (
          CLAP_PRETRAINED_MODEL_ARCHIVE_LIST,
          ClapAudioConfig,
          ClapConfig,
          ClapTextConfig,
      )
      from .processing_clap import ClapProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .feature_extraction_clap import ClapFeatureExtractor
            from .modeling_clap import (
                CLAP_PRETRAINED_MODEL_ARCHIVE_LIST,
                ClapAudioModel,
                ClapAudioModelWithProjection,
                ClapModel,
                ClapPreTrainedModel,
                ClapTextModel,
                ClapTextModelWithProjection,
            )


else:
      import sys

      UpperCamelCase      					=_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)






