


'''simple docstring'''


from collections import OrderedDict
from typing import Mapping

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


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

UpperCAmelCase_		:       Tuple							       =		{
    'flaubert/flaubert_small_cased': 'https://huggingface.co/flaubert/flaubert_small_cased/resolve/main/config.json',
    'flaubert/flaubert_base_uncased': 'https://huggingface.co/flaubert/flaubert_base_uncased/resolve/main/config.json',
    'flaubert/flaubert_base_cased': 'https://huggingface.co/flaubert/flaubert_base_cased/resolve/main/config.json',
    'flaubert/flaubert_large_cased': 'https://huggingface.co/flaubert/flaubert_large_cased/resolve/main/config.json',
}





class    lowercase__  (						_snake_case ):





							'''simple docstring'''


							A_							:				Tuple				     =  """flaubert"""
							A_							:				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   , __snake_case=False   , __snake_case=0.0   , __snake_case=3_0145   , __snake_case=2048   , __snake_case=12   , __snake_case=16   , __snake_case=0.1   , __snake_case=0.1   , __snake_case=True   , __snake_case=False   , __snake_case=False   , __snake_case=False   , __snake_case=1   , __snake_case=True   , __snake_case=512   , __snake_case=2048**-0.5   , __snake_case=1e-12   , __snake_case=0.02   , __snake_case=0   , __snake_case=1   , __snake_case=2   , __snake_case=3   , __snake_case=5   , __snake_case=True   , __snake_case="first"   , __snake_case=True   , __snake_case=None   , __snake_case=True   , __snake_case=0.1   , __snake_case=5   , __snake_case=5   , __snake_case=0   , __snake_case=0   , __snake_case=2   , __snake_case=0   , **__snake_case   , ):
											_SCREAMING_SNAKE_CASE			:	int							=				pre_norm
											_SCREAMING_SNAKE_CASE			:	Optional[int]							=				layerdrop
											_SCREAMING_SNAKE_CASE			:	Any							=				vocab_size
											_SCREAMING_SNAKE_CASE			:	Dict							=				emb_dim
											_SCREAMING_SNAKE_CASE			:	Tuple							=				n_layers
											_SCREAMING_SNAKE_CASE			:	Any							=				n_heads
											_SCREAMING_SNAKE_CASE			:	str							=				dropout
											_SCREAMING_SNAKE_CASE			:	List[Any]							=				attention_dropout
											_SCREAMING_SNAKE_CASE			:	Dict							=				gelu_activation
											_SCREAMING_SNAKE_CASE			:	int							=				sinusoidal_embeddings
											_SCREAMING_SNAKE_CASE			:	Tuple							=				causal
											_SCREAMING_SNAKE_CASE			:	Dict							=				asm
											_SCREAMING_SNAKE_CASE			:	Optional[int]							=				n_langs
											_SCREAMING_SNAKE_CASE			:	Dict							=				use_lang_emb
											_SCREAMING_SNAKE_CASE			:	Union[str, Any]							=				layer_norm_eps
											_SCREAMING_SNAKE_CASE			:	Optional[Any]							=				bos_index
											_SCREAMING_SNAKE_CASE			:	int							=				eos_index
											_SCREAMING_SNAKE_CASE			:	Union[str, Any]							=				pad_index
											_SCREAMING_SNAKE_CASE			:	int							=				unk_index
											_SCREAMING_SNAKE_CASE			:	List[str]							=				mask_index
											_SCREAMING_SNAKE_CASE			:	Union[str, Any]							=				is_encoder
											_SCREAMING_SNAKE_CASE			:	Optional[Any]							=				max_position_embeddings
											_SCREAMING_SNAKE_CASE			:	Any							=				embed_init_std
											_SCREAMING_SNAKE_CASE			:	str							=				init_std
											_SCREAMING_SNAKE_CASE			:	str							=				summary_type
											_SCREAMING_SNAKE_CASE			:	int							=				summary_use_proj
											_SCREAMING_SNAKE_CASE			:	str							=				summary_activation
											_SCREAMING_SNAKE_CASE			:	int							=				summary_proj_to_labels
											_SCREAMING_SNAKE_CASE			:	Optional[Any]							=				summary_first_dropout
											_SCREAMING_SNAKE_CASE			:	int							=				start_n_top
											_SCREAMING_SNAKE_CASE			:	List[Any]							=				end_n_top
											_SCREAMING_SNAKE_CASE			:	int							=				mask_token_id
											_SCREAMING_SNAKE_CASE			:	Optional[int]							=				lang_id

											if "n_words" in kwargs:
															_SCREAMING_SNAKE_CASE			:	Dict							=				kwargs["""n_words"""]

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





class    lowercase__  (						_snake_case ):





							'''simple docstring'''


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








'''simple docstring'''


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


UpperCAmelCase_		:       Tuple							       =		logging.get_logger(__name__)

UpperCAmelCase_		:       List[Any]							       =		{
    # pcqm4mv1 now deprecated
    'graphormer-base': 'https://huggingface.co/clefourrier/graphormer-base-pcqm4mv2/resolve/main/config.json',
    # See all Graphormer models at https://huggingface.co/models?filter=graphormer
}





class    lowercase__  (						_snake_case ):





							'''simple docstring'''


							A_							:				Union[str, Any]				     =  """graphormer"""
							A_							:				Tuple				     =  ["""past_key_values"""]






							def __init__(   self   , __snake_case = 1   , __snake_case = 512 * 9   , __snake_case = 512 * 3   , __snake_case = 512   , __snake_case = 512   , __snake_case = 512   , __snake_case = 128   , __snake_case = 5   , __snake_case = 1024   , __snake_case = "multi_hop"   , __snake_case = 512   , __snake_case = False   , __snake_case = 12   , __snake_case = 768   , __snake_case = 768   , __snake_case = 32   , __snake_case = 0.1   , __snake_case = 0.1   , __snake_case = 0.0   , __snake_case = False   , __snake_case = False   , __snake_case = False   , __snake_case = "gelu"   , __snake_case = None   , __snake_case = False   , __snake_case = 0   , __snake_case = False   , __snake_case = 0.0   , __snake_case = 8   , __snake_case = None   , __snake_case = None   , __snake_case = True   , __snake_case = True   , __snake_case=0   , __snake_case=1   , __snake_case=2   , **__snake_case   , ):
											_SCREAMING_SNAKE_CASE			:	Dict							=				num_classes
											_SCREAMING_SNAKE_CASE			:	Dict							=				num_atoms
											_SCREAMING_SNAKE_CASE			:	Dict							=				num_in_degree
											_SCREAMING_SNAKE_CASE			:	Optional[int]							=				num_out_degree
											_SCREAMING_SNAKE_CASE			:	Any							=				num_edges
											_SCREAMING_SNAKE_CASE			:	Optional[Any]							=				num_spatial
											_SCREAMING_SNAKE_CASE			:	Optional[Any]							=				num_edge_dis
											_SCREAMING_SNAKE_CASE			:	int							=				edge_type
											_SCREAMING_SNAKE_CASE			:	Tuple							=				multi_hop_max_dist
											_SCREAMING_SNAKE_CASE			:	Optional[Any]							=				spatial_pos_max
											_SCREAMING_SNAKE_CASE			:	Union[str, Any]							=				max_nodes
											_SCREAMING_SNAKE_CASE			:	str							=				num_hidden_layers
											_SCREAMING_SNAKE_CASE			:	Optional[int]							=				embedding_dim
											_SCREAMING_SNAKE_CASE			:	Optional[int]							=				embedding_dim
											_SCREAMING_SNAKE_CASE			:	int							=				ffn_embedding_dim
											_SCREAMING_SNAKE_CASE			:	Dict							=				num_attention_heads
											_SCREAMING_SNAKE_CASE			:	Optional[int]							=				dropout
											_SCREAMING_SNAKE_CASE			:	List[str]							=				attention_dropout
											_SCREAMING_SNAKE_CASE			:	int							=				layerdrop
											_SCREAMING_SNAKE_CASE			:	List[Any]							=				encoder_normalize_before
											_SCREAMING_SNAKE_CASE			:	Union[str, Any]							=				pre_layernorm
											_SCREAMING_SNAKE_CASE			:	Union[str, Any]							=				apply_graphormer_init
											_SCREAMING_SNAKE_CASE			:	List[str]							=				activation_fn
											_SCREAMING_SNAKE_CASE			:	Union[str, Any]							=				embed_scale
											_SCREAMING_SNAKE_CASE			:	Optional[int]							=				freeze_embeddings
											_SCREAMING_SNAKE_CASE			:	Optional[Any]							=				num_trans_layers_to_freeze
											_SCREAMING_SNAKE_CASE			:	List[Any]							=				share_input_output_embed
											_SCREAMING_SNAKE_CASE			:	Tuple							=				traceable
											_SCREAMING_SNAKE_CASE			:	List[str]							=				q_noise
											_SCREAMING_SNAKE_CASE			:	str							=				qn_block_size

											# These parameters are here for future extensions
											# atm, the model only supports self attention
											_SCREAMING_SNAKE_CASE			:	Any							=				kdim
											_SCREAMING_SNAKE_CASE			:	int							=				vdim
											_SCREAMING_SNAKE_CASE			:	Any							=				self_attention
											_SCREAMING_SNAKE_CASE			:	Tuple							=				bias

											super().__init__(
											    pad_token_id=__snake_case   , bos_token_id=__snake_case   , eos_token_id=__snake_case   , **__snake_case   , )




