

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__				=		{
    '''facebook/xmod-base''': '''https://huggingface.co/facebook/xmod-base/resolve/main/config.json''',
    '''facebook/xmod-large-prenorm''': '''https://huggingface.co/facebook/xmod-large-prenorm/resolve/main/config.json''',
    '''facebook/xmod-base-13-125k''': '''https://huggingface.co/facebook/xmod-base-13-125k/resolve/main/config.json''',
    '''facebook/xmod-base-30-125k''': '''https://huggingface.co/facebook/xmod-base-30-125k/resolve/main/config.json''',
    '''facebook/xmod-base-30-195k''': '''https://huggingface.co/facebook/xmod-base-30-195k/resolve/main/config.json''',
    '''facebook/xmod-base-60-125k''': '''https://huggingface.co/facebook/xmod-base-60-125k/resolve/main/config.json''',
    '''facebook/xmod-base-60-265k''': '''https://huggingface.co/facebook/xmod-base-60-265k/resolve/main/config.json''',
    '''facebook/xmod-base-75-125k''': '''https://huggingface.co/facebook/xmod-base-75-125k/resolve/main/config.json''',
    '''facebook/xmod-base-75-269k''': '''https://huggingface.co/facebook/xmod-base-75-269k/resolve/main/config.json''',
}

class 				UpperCAmelCase_		(			__lowercase   ):
							"""simple docstring"""







							UpperCAmelCase__       :						Union[str, Any]	    =    "xmod"


							def __init__(			self       ,							_a=3_0_5_2_2       ,							_a=7_6_8       ,							_a=1_2       ,							_a=1_2       ,							_a=3_0_7_2       ,							_a="gelu"       ,							_a=0.1       ,							_a=0.1       ,							_a=5_1_2       ,							_a=2       ,							_a=0.02       ,							_a=1e-1_2       ,							_a=1       ,							_a=0       ,							_a=2       ,							_a="absolute"       ,							_a=True       ,							_a=None       ,							_a=False       ,							_a=2       ,							_a=False       ,							_a=True       ,							_a=True       ,							_a=("en_XX",)       ,							_a=None       ,							**_a       ,							)    ->    Optional[Any]:
												super().__init__(pad_token_id=_a       ,							bos_token_id=_a       ,							eos_token_id=_a       ,							**_a       )

												_a	:    Union[str, Any]         =		vocab_size
												_a	:    Tuple         =		hidden_size
												_a	:    List[str]         =		num_hidden_layers
												_a	:    Union[str, Any]         =		num_attention_heads
												_a	:    Any         =		hidden_act
												_a	:    Optional[Any]         =		intermediate_size
												_a	:    str         =		hidden_dropout_prob
												_a	:    Tuple         =		attention_probs_dropout_prob
												_a	:    Dict         =		max_position_embeddings
												_a	:    Any         =		type_vocab_size
												_a	:    Dict         =		initializer_range
												_a	:    List[str]         =		layer_norm_eps
												_a	:    int         =		position_embedding_type
												_a	:    str         =		use_cache
												_a	:    List[str]         =		classifier_dropout
												_a	:    Optional[int]         =		pre_norm
												_a	:    List[Any]         =		adapter_reduction_factor
												_a	:    Any         =		adapter_layer_norm
												_a	:    Any         =		adapter_reuse_layer_norm
												_a	:    List[Any]         =		ln_before_adapter
												_a	:    Dict         =		list(_a       )
												_a	:    Optional[Any]         =		default_language



class 				UpperCAmelCase_		(			__lowercase   ):
							"""simple docstring"""







							@property
							def 				__lowercase				(			self       )    ->    Mapping[str, Mapping[int, str]]:
												if self.task == "multiple-choice":
																	_a	:    Optional[Any]         =		{0: '''batch''', 1: '''choice''', 2: '''sequence'''}
												else:
																	_a	:    List[Any]         =		{0: '''batch''', 1: '''sequence'''}
												return OrderedDict(
												    [
												        ('''input_ids''', dynamic_axis),
												        ('''attention_mask''', dynamic_axis),
												    ]       )






import operator as op


a__				=		'''scaler.pt'''
a__				=		'''pytorch_model'''
a__				=		'''random_states'''
a__				=		'''optimizer'''
a__				=		'''scheduler'''
a__				=		'''pytorch_model.bin'''
a__				=		'''pytorch_model.bin.index.json'''
a__				=		'''model.safetensors'''
a__				=		'''model.safetensors.index.json'''
a__				=		'''1.10.2'''
a__				=		'''py38'''
a__				=		'''4.17.0'''
a__				=		['''ml.p3.16xlarge''', '''ml.p3dn.24xlarge''', '''ml.p4dn.24xlarge''']
a__				=		['''FULL_SHARD''', '''SHARD_GRAD_OP''', '''NO_SHARD''', '''HYBRID_SHARD''', '''HYBRID_SHARD_ZERO2''']
a__				=		['''TRANSFORMER_BASED_WRAP''', '''SIZE_BASED_WRAP''', '''NO_WRAP''']
a__				=		['''BACKWARD_PRE''', '''BACKWARD_POST''', '''NO_PREFETCH''']
a__				=		['''FULL_STATE_DICT''', '''LOCAL_STATE_DICT''', '''SHARDED_STATE_DICT''']
a__				=		'''2.0.1'''
a__				=		['''pdsh''', '''standard''', '''openmpi''', '''mvapich''']
a__				=		['''default''', '''reduce-overhead''', '''max-autotune''']

a__				=		{'''>''': op.gt, '''>=''': op.ge, '''==''': op.eq, '''!=''': op.ne, '''<=''': op.le, '''<''': op.lt}

# These are the args for `torch.distributed.launch` for pytorch < 1.9
a__				=		[
    '''nnodes''',
    '''nproc_per_node''',
    '''rdzv_backend''',
    '''rdzv_endpoint''',
    '''rdzv_id''',
    '''rdzv_conf''',
    '''standalone''',
    '''max_restarts''',
    '''monitor_interval''',
    '''start_method''',
    '''role''',
    '''module''',
    '''m''',
    '''no_python''',
    '''run_path''',
    '''log_dir''',
    '''r''',
    '''redirects''',
    '''t''',
    '''tee''',
    '''node_rank''',
    '''master_addr''',
    '''master_port''',
]

a__				=		['''DEEPSPEED''', '''MULTI_GPU''', '''FSDP''', '''MEGATRON_LM''']
a__				=		['''DEEPSPEED''', '''MULTI_XPU''', '''FSDP''']



