
'''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-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     __snake_case		(   a__):
					_lowerCAmelCase			     =	'''xlm'''
					_lowerCAmelCase			     =	{
					    '''hidden_size''': '''emb_dim''',
					    '''num_attention_heads''': '''n_heads''',
					    '''num_hidden_layers''': '''n_layers''',
					    '''n_words''': '''vocab_size''',  # For backward compatibility
					}
					def __init__(     self,    A=3_0145,    A=2048,    A=12,    A=16,    A=0.1,    A=0.1,    A=True,    A=False,    A=False,    A=False,    A=1,    A=True,    A=512,    A=2048**-0.5,    A=1e-12,    A=0.02,    A=0,    A=1,    A=2,    A=3,    A=5,    A=True,    A="first",    A=True,    A=None,    A=True,    A=0.1,    A=5,    A=5,    A=0,    A=0,    A=2,    A=0,    **A,    ):

									"""simple docstring"""


									lowerCamelCase					:			Union[str, Any]									= vocab_size
									lowerCamelCase					:			Tuple									= emb_dim
									lowerCamelCase					:			str									= n_layers
									lowerCamelCase					:			Tuple									= n_heads
									lowerCamelCase					:			List[str]									= dropout
									lowerCamelCase					:			int									= attention_dropout
									lowerCamelCase					:			Optional[Any]									= gelu_activation
									lowerCamelCase					:			List[str]									= sinusoidal_embeddings
									lowerCamelCase					:			Optional[Any]									= causal
									lowerCamelCase					:			Optional[Any]									= asm
									lowerCamelCase					:			List[str]									= n_langs
									lowerCamelCase					:			Dict									= use_lang_emb
									lowerCamelCase					:			Dict									= layer_norm_eps
									lowerCamelCase					:			Union[str, Any]									= bos_index
									lowerCamelCase					:			List[str]									= eos_index
									lowerCamelCase					:			int									= pad_index
									lowerCamelCase					:			Optional[Any]									= unk_index
									lowerCamelCase					:			Optional[Any]									= mask_index
									lowerCamelCase					:			Tuple									= is_encoder
									lowerCamelCase					:			Dict									= max_position_embeddings
									lowerCamelCase					:			Optional[Any]									= embed_init_std
									lowerCamelCase					:			str									= init_std
									lowerCamelCase					:			Optional[Any]									= summary_type
									lowerCamelCase					:			Any									= summary_use_proj
									lowerCamelCase					:			Optional[Any]									= summary_activation
									lowerCamelCase					:			Any									= summary_proj_to_labels
									lowerCamelCase					:			Union[str, Any]									= summary_first_dropout
									lowerCamelCase					:			Tuple									= start_n_top
									lowerCamelCase					:			List[str]									= end_n_top
									lowerCamelCase					:			Dict									= mask_token_id
									lowerCamelCase					:			int									= lang_id

									if "n_words" in kwargs:
													lowerCamelCase					:			Union[str, Any]									= kwargs['n_words']

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





class     __snake_case		(   a__):
					@property
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									if self.task == "multiple-choice":
													lowerCamelCase					:			Optional[Any]									= {0: 'batch', 1: 'choice', 2: 'sequence'}
									else:
													lowerCamelCase					:			Union[str, Any]									= {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_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
    is_vision_available,
)


A			      =      {
    'configuration_clip': [
        'CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'CLIPConfig',
        'CLIPOnnxConfig',
        'CLIPTextConfig',
        'CLIPVisionConfig',
    ],
    'processing_clip': ['CLIPProcessor'],
    'tokenization_clip': ['CLIPTokenizer'],
}

try:
					if not is_tokenizers_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					A			      =      ['CLIPTokenizerFast']

try:
					if not is_vision_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					A			      =      ['CLIPFeatureExtractor']
					A			      =      ['CLIPImageProcessor']

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					A			      =      [
					    'CLIP_PRETRAINED_MODEL_ARCHIVE_LIST',
					    'CLIPModel',
					    'CLIPPreTrainedModel',
					    'CLIPTextModel',
					    'CLIPTextModelWithProjection',
					    'CLIPVisionModel',
					    'CLIPVisionModelWithProjection',
					]

try:
					if not is_tf_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					A			      =      [
					    'TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST',
					    'TFCLIPModel',
					    'TFCLIPPreTrainedModel',
					    'TFCLIPTextModel',
					    'TFCLIPVisionModel',
					]

try:
					if not is_flax_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					A			      =      [
					    'FlaxCLIPModel',
					    'FlaxCLIPPreTrainedModel',
					    'FlaxCLIPTextModel',
					    'FlaxCLIPTextPreTrainedModel',
					    'FlaxCLIPVisionModel',
					    'FlaxCLIPVisionPreTrainedModel',
					]


if TYPE_CHECKING:
					from .configuration_clip import (
					    CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    CLIPConfig,
					    CLIPOnnxConfig,
					    CLIPTextConfig,
					    CLIPVisionConfig,
					)
					from .processing_clip import CLIPProcessor
					from .tokenization_clip import CLIPTokenizer

					try:
										if not is_tokenizers_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .tokenization_clip_fast import CLIPTokenizerFast

					try:
										if not is_vision_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .feature_extraction_clip import CLIPFeatureExtractor
										from .image_processing_clip import CLIPImageProcessor

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_clip import (
										    CLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
										    CLIPModel,
										    CLIPPreTrainedModel,
										    CLIPTextModel,
										    CLIPTextModelWithProjection,
										    CLIPVisionModel,
										    CLIPVisionModelWithProjection,
										)

					try:
										if not is_tf_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_tf_clip import (
										    TF_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
										    TFCLIPModel,
										    TFCLIPPreTrainedModel,
										    TFCLIPTextModel,
										    TFCLIPVisionModel,
										)

					try:
										if not is_flax_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_flax_clip import (
										    FlaxCLIPModel,
										    FlaxCLIPPreTrainedModel,
										    FlaxCLIPTextModel,
										    FlaxCLIPTextPreTrainedModel,
										    FlaxCLIPVisionModel,
										    FlaxCLIPVisionPreTrainedModel,
										)


else:
					import sys

					A			      =      _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
