


"""simple docstring"""





from collections import OrderedDict
from typing import Mapping

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


UpperCamelCase_	:				Any										= logging.get_logger(__name__)

UpperCamelCase_	:				int										= {
    """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      _lowercase (     _UpperCamelCase						):
      _a   :     Any								=   '''xlm'''
      _a   :     List[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				:	str							,   a				:	Optional[int]=3_0_1_4_5							,   a				:	Union[str, Any]=2_0_4_8							,   a				:	List[Any]=1_2							,   a				:	Optional[Any]=1_6							,   a				:	Optional[int]=0.1							,   a				:	str=0.1							,   a				:	List[Any]=True							,   a				:	Optional[int]=False							,   a				:	Any=False							,   a				:	List[str]=False							,   a				:	List[Any]=1							,   a				:	List[Any]=True							,   a				:	Any=5_1_2							,   a				:	Tuple=2_0_4_8**-0.5							,   a				:	Dict=1e-12							,   a				:	Any=0.0_2							,   a				:	List[str]=0							,   a				:	Tuple=1							,   a				:	Optional[int]=2							,   a				:	Union[str, Any]=3							,   a				:	Optional[Any]=5							,   a				:	List[str]=True							,   a				:	str="first"							,   a				:	Optional[int]=True							,   a				:	Any=None							,   a				:	Tuple=True							,   a				:	Tuple=0.1							,   a				:	List[str]=5							,   a				:	List[str]=5							,   a				:	Dict=0							,   a				:	Tuple=0							,   a				:	int=2							,   a				:	Dict=0							,   **a				:	Dict							,   ):





            """simple docstring"""







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

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

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



class      _lowercase (     _UpperCamelCase						):


      @property
      def _UpperCamelCase						(    self				:	Any						):





            """simple docstring"""







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










"""simple docstring"""





from __future__ import annotations



def     __lowercase					(    a :				int       ,		a :				int )					->					list[str]:
      if partitions <= 0:
            raise ValueError('''partitions must be a positive number!''' )
      if partitions > number_of_bytes:
            raise ValueError('''partitions can not > number_of_bytes!''' )
      __snake_case      :    List[str]  			=number_of_bytes // partitions
      __snake_case      :    str  			=[]
      for i in range(a ):
            __snake_case      :    Optional[Any]  			=i * bytes_per_partition + 1
            __snake_case      :    Any  			=(
                number_of_bytes if i == partitions - 1 else (i + 1) * bytes_per_partition
            )
            allocation_list.append(f'''{start_bytes}-{end_bytes}''' )
      return allocation_list


if __name__ == "__main__":
    import doctest

    doctest.testmod()


