


from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCAmelCase_      : List[Any]  					=       logging.get_logger(__name__)

UpperCAmelCase_      : Tuple  					=       {
    'transfo-xl-wt103': 'https://huggingface.co/transfo-xl-wt103/resolve/main/config.json',
}
class  SCREAMING_SNAKE_CASE__  (				lowercase__			):
      snake_case__				:     List[Any]        =						'''transfo-xl'''
      snake_case__				:     List[Any]        =						['''mems''']
      snake_case__				:     Tuple        =						{
          '''n_token''': '''vocab_size''',
          '''hidden_size''': '''d_model''',
          '''num_attention_heads''': '''n_head''',
          '''num_hidden_layers''': '''n_layer''',
      }
      def __init__(       self				:       List[Any]     ,							SCREAMING_SNAKE_CASE__				:       int=2_6_7_7_3_5     ,							SCREAMING_SNAKE_CASE__				:       List[str]=[2_0_0_0_0, 4_0_0_0_0, 2_0_0_0_0_0]     ,							SCREAMING_SNAKE_CASE__				:       Optional[Any]=1_0_2_4     ,							SCREAMING_SNAKE_CASE__				:       Optional[Any]=1_0_2_4     ,							SCREAMING_SNAKE_CASE__				:       Optional[int]=1_6     ,							SCREAMING_SNAKE_CASE__				:       List[str]=6_4     ,							SCREAMING_SNAKE_CASE__				:       Any=4_0_9_6     ,							SCREAMING_SNAKE_CASE__				:       List[str]=4     ,							SCREAMING_SNAKE_CASE__				:       Optional[int]=False     ,							SCREAMING_SNAKE_CASE__				:       Tuple=1_8     ,							SCREAMING_SNAKE_CASE__				:       Optional[Any]=1_6_0_0     ,							SCREAMING_SNAKE_CASE__				:       Dict=1_0_0_0     ,							SCREAMING_SNAKE_CASE__				:       Any=True     ,							SCREAMING_SNAKE_CASE__				:       Any=True     ,							SCREAMING_SNAKE_CASE__				:       Union[str, Any]=0     ,							SCREAMING_SNAKE_CASE__				:       Optional[int]=-1     ,							SCREAMING_SNAKE_CASE__				:       Union[str, Any]=True     ,							SCREAMING_SNAKE_CASE__				:       Any=0.1     ,							SCREAMING_SNAKE_CASE__				:       Dict=0.0     ,							SCREAMING_SNAKE_CASE__				:       int=True     ,							SCREAMING_SNAKE_CASE__				:       Union[str, Any]="normal"     ,							SCREAMING_SNAKE_CASE__				:       Union[str, Any]=0.01     ,							SCREAMING_SNAKE_CASE__				:       Optional[Any]=0.01     ,							SCREAMING_SNAKE_CASE__				:       Any=0.02     ,							SCREAMING_SNAKE_CASE__				:       str=1E-5     ,							SCREAMING_SNAKE_CASE__				:       List[str]=0     ,							**SCREAMING_SNAKE_CASE__				:       Tuple     ,							)		->			Any:
             a_					:		int							=  vocab_size
             a_					:		List[str]							=  []
             self.cutoffs.extend(SCREAMING_SNAKE_CASE__     )
             if proj_share_all_but_first:
                    a_					:		Dict							=  [False] + [True] * len(self.cutoffs     )
             else:
                    a_					:		str							=  [False] + [False] * len(self.cutoffs     )
             a_					:		List[str]							=  d_model
             a_					:		str							=  d_embed
             a_					:		Optional[Any]							=  d_head
             a_					:		Union[str, Any]							=  d_inner
             a_					:		int							=  div_val
             a_					:		List[str]							=  pre_lnorm
             a_					:		Any							=  n_layer
             a_					:		Dict							=  n_head
             a_					:		List[str]							=  mem_len
             a_					:		Optional[int]							=  same_length
             a_					:		List[Any]							=  attn_type
             a_					:		Any							=  clamp_len
             a_					:		Tuple							=  sample_softmax
             a_					:		List[str]							=  adaptive
             a_					:		Any							=  dropout
             a_					:		Tuple							=  dropatt
             a_					:		Optional[Any]							=  untie_r
             a_					:		Optional[Any]							=  init
             a_					:		Dict							=  init_range
             a_					:		Any							=  proj_init_std
             a_					:		Union[str, Any]							=  init_std
             a_					:		Tuple							=  layer_norm_epsilon
             super().__init__(eos_token_id=SCREAMING_SNAKE_CASE__     ,							**SCREAMING_SNAKE_CASE__     )
      @property
      def        SCREAMING_SNAKE_CASE							(       self				:       str     )		->			Dict:
             # Message copied from Transformer-XL documentation
             logger.info(F"""The model {self.model_type} is one of the few models that has no sequence length limit."""     )
             return -1

      @max_position_embeddings.setter
      def        SCREAMING_SNAKE_CASE							(       self				:       Union[str, Any]     ,							SCREAMING_SNAKE_CASE__				:       Dict     )		->			List[Any]:
             # Message copied from Transformer-XL documentation
             raise NotImplementedError(
                 F"""The model {self.model_type} is one of the few models that has no sequence length limit."""     )






from collections import OrderedDict
from typing import Mapping

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


UpperCAmelCase_      : str  					=       logging.get_logger(__name__)

UpperCAmelCase_      : List[str]  					=       {
    'YituTech/conv-bert-base': 'https://huggingface.co/YituTech/conv-bert-base/resolve/main/config.json',
    'YituTech/conv-bert-medium-small': (
        'https://huggingface.co/YituTech/conv-bert-medium-small/resolve/main/config.json'
    ),
    'YituTech/conv-bert-small': 'https://huggingface.co/YituTech/conv-bert-small/resolve/main/config.json',
    # See all ConvBERT models at https://huggingface.co/models?filter=convbert
}
class  SCREAMING_SNAKE_CASE__  (				lowercase__			):
      snake_case__				:     Optional[int]        =						'''convbert'''
      def __init__(       self				:       List[Any]     ,							SCREAMING_SNAKE_CASE__				:       Optional[int]=3_0_5_2_2     ,							SCREAMING_SNAKE_CASE__				:       Dict=7_6_8     ,							SCREAMING_SNAKE_CASE__				:       Optional[int]=1_2     ,							SCREAMING_SNAKE_CASE__				:       Union[str, Any]=1_2     ,							SCREAMING_SNAKE_CASE__				:       str=3_0_7_2     ,							SCREAMING_SNAKE_CASE__				:       Dict="gelu"     ,							SCREAMING_SNAKE_CASE__				:       Dict=0.1     ,							SCREAMING_SNAKE_CASE__				:       Tuple=0.1     ,							SCREAMING_SNAKE_CASE__				:       List[str]=5_1_2     ,							SCREAMING_SNAKE_CASE__				:       Optional[Any]=2     ,							SCREAMING_SNAKE_CASE__				:       List[Any]=0.02     ,							SCREAMING_SNAKE_CASE__				:       Any=1E-12     ,							SCREAMING_SNAKE_CASE__				:       int=1     ,							SCREAMING_SNAKE_CASE__				:       int=0     ,							SCREAMING_SNAKE_CASE__				:       Optional[int]=2     ,							SCREAMING_SNAKE_CASE__				:       Optional[int]=7_6_8     ,							SCREAMING_SNAKE_CASE__				:       Union[str, Any]=2     ,							SCREAMING_SNAKE_CASE__				:       List[Any]=9     ,							SCREAMING_SNAKE_CASE__				:       List[Any]=1     ,							SCREAMING_SNAKE_CASE__				:       Dict=None     ,							**SCREAMING_SNAKE_CASE__				:       List[Any]     ,							)		->			Any:
             super().__init__(
                 pad_token_id=SCREAMING_SNAKE_CASE__     ,							bos_token_id=SCREAMING_SNAKE_CASE__     ,							eos_token_id=SCREAMING_SNAKE_CASE__     ,							**SCREAMING_SNAKE_CASE__     ,							)

             a_					:		Tuple							=  vocab_size
             a_					:		List[str]							=  hidden_size
             a_					:		List[str]							=  num_hidden_layers
             a_					:		Dict							=  num_attention_heads
             a_					:		Optional[int]							=  intermediate_size
             a_					:		int							=  hidden_act
             a_					:		Dict							=  hidden_dropout_prob
             a_					:		int							=  attention_probs_dropout_prob
             a_					:		str							=  max_position_embeddings
             a_					:		List[str]							=  type_vocab_size
             a_					:		List[str]							=  initializer_range
             a_					:		Tuple							=  layer_norm_eps
             a_					:		Optional[int]							=  embedding_size
             a_					:		List[Any]							=  head_ratio
             a_					:		List[Any]							=  conv_kernel_size
             a_					:		Tuple							=  num_groups
             a_					:		Tuple							=  classifier_dropout
class  SCREAMING_SNAKE_CASE__  (				lowercase__			):
      @property
      def        SCREAMING_SNAKE_CASE							(       self				:       List[str]     )		->			Mapping[str, Mapping[int, str]]:
             if self.task == "multiple-choice":
                    a_					:		Tuple							=  {0: 'batch', 1: 'choice', 2: 'sequence'}
             else:
                    a_					:		List[str]							=  {0: 'batch', 1: 'sequence'}
             return OrderedDict(
                 [
                     ('input_ids', dynamic_axis),
                     ('attention_mask', dynamic_axis),
                     ('token_type_ids', dynamic_axis),
                 ]     )


