



"""simple docstring"""





from __future__ import annotations

from pprint import pformat
from typing import Generic, TypeVar

lowerCamelCase      =		TypeVar("""T""")
class    lowercase__     (					Generic[T]   ):







							'''simple docstring'''


							def __init__(							self    :						Union[str, Any]	,       _UpperCAmelCase    :						Optional[Any] = True					)				->		List[Any]:


													'''simple docstring'''




													UpperCAmelCase_    				=							{}  # dictionary of lists
													UpperCAmelCase_    				=							directed



							def   lowercase__       (							self    :						Any	,       _UpperCAmelCase    :						Any	,       _UpperCAmelCase    :						List[str]					)				->		Union[str, Any]:


													'''simple docstring'''




													if not self.directed:  # For undirected graphs
																			# if both source vertex and destination vertex are both present in the
																			# adjacency list, add destination vertex to source vertex list of adjacent
																			# vertices and add source vertex to destination vertex list of adjacent
																			# vertices.
																			if source_vertex in self.adj_list and destination_vertex in self.adj_list:
																									self.adj_list[source_vertex].append(_UpperCAmelCase					)
																									self.adj_list[destination_vertex].append(_UpperCAmelCase					)
																			# if only source vertex is present in adjacency list, add destination vertex
																			# to source vertex list of adjacent vertices, then create a new vertex with
																			# destination vertex as key and assign a list containing the source vertex
																			# as it's first adjacent vertex.
																			elif source_vertex in self.adj_list:
																									self.adj_list[source_vertex].append(_UpperCAmelCase					)
																									UpperCAmelCase_    				=							[source_vertex]
																			# if only destination vertex is present in adjacency list, add source vertex
																			# to destination vertex list of adjacent vertices, then create a new vertex
																			# with source vertex as key and assign a list containing the source vertex
																			# as it's first adjacent vertex.
																			elif destination_vertex in self.adj_list:
																									self.adj_list[destination_vertex].append(_UpperCAmelCase					)
																									UpperCAmelCase_    				=							[destination_vertex]
																			# if both source vertex and destination vertex are not present in adjacency
																			# list, create a new vertex with source vertex as key and assign a list
																			# containing the destination vertex as it's first adjacent vertex also
																			# create a new vertex with destination vertex as key and assign a list
																			# containing the source vertex as it's first adjacent vertex.
																			else:
																									UpperCAmelCase_    				=							[destination_vertex]
																									UpperCAmelCase_    				=							[source_vertex]
													else:  # For directed graphs
																			# if both source vertex and destination vertex are present in adjacency
																			# list, add destination vertex to source vertex list of adjacent vertices.
																			if source_vertex in self.adj_list and destination_vertex in self.adj_list:
																									self.adj_list[source_vertex].append(_UpperCAmelCase					)
																			# if only source vertex is present in adjacency list, add destination
																			# vertex to source vertex list of adjacent vertices and create a new vertex
																			# with destination vertex as key, which has no adjacent vertex
																			elif source_vertex in self.adj_list:
																									self.adj_list[source_vertex].append(_UpperCAmelCase					)
																									UpperCAmelCase_    				=							[]
																			# if only destination vertex is present in adjacency list, create a new
																			# vertex with source vertex as key and assign a list containing destination
																			# vertex as first adjacent vertex
																			elif destination_vertex in self.adj_list:
																									UpperCAmelCase_    				=							[destination_vertex]
																			# if both source vertex and destination vertex are not present in adjacency
																			# list, create a new vertex with source vertex as key and a list containing
																			# destination vertex as it's first adjacent vertex. Then create a new vertex
																			# with destination vertex as key, which has no adjacent vertex
																			else:
																									UpperCAmelCase_    				=							[destination_vertex]
																									UpperCAmelCase_    				=							[]

													return self







							def __repr__(							self    :						Tuple					)				->		List[str]:


													'''simple docstring'''




													return pformat(self.adj_list					)









"""simple docstring"""





from collections import OrderedDict
from typing import Mapping

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


lowerCamelCase      =		logging.get_logger(__name__)

lowerCamelCase      =		{
    """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    lowercase__     (					SCREAMING_SNAKE_CASE   ):







       '''simple docstring'''


       UpperCamelCase		=  '''convbert'''



       def __init__(							self    :						Any	,       _UpperCAmelCase    :						Optional[int]=30522	,       _UpperCAmelCase    :						Tuple=768	,       _UpperCAmelCase    :						Optional[int]=12	,       _UpperCAmelCase    :						Dict=12	,       _UpperCAmelCase    :						Any=3072	,       _UpperCAmelCase    :						Dict="gelu"	,       _UpperCAmelCase    :						Optional[int]=0.1	,       _UpperCAmelCase    :						str=0.1	,       _UpperCAmelCase    :						Tuple=512	,       _UpperCAmelCase    :						Optional[Any]=2	,       _UpperCAmelCase    :						Union[str, Any]=0.02	,       _UpperCAmelCase    :						Dict=1e-12	,       _UpperCAmelCase    :						Optional[int]=1	,       _UpperCAmelCase    :						int=0	,       _UpperCAmelCase    :						Optional[Any]=2	,       _UpperCAmelCase    :						List[Any]=768	,       _UpperCAmelCase    :						Optional[int]=2	,       _UpperCAmelCase    :						str=9	,       _UpperCAmelCase    :						List[Any]=1	,       _UpperCAmelCase    :						Optional[Any]=None	,       **_UpperCAmelCase    :						str	,       )				->		List[Any]:


             '''simple docstring'''




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

             UpperCAmelCase_    				=							vocab_size
             UpperCAmelCase_    				=							hidden_size
             UpperCAmelCase_    				=							num_hidden_layers
             UpperCAmelCase_    				=							num_attention_heads
             UpperCAmelCase_    				=							intermediate_size
             UpperCAmelCase_    				=							hidden_act
             UpperCAmelCase_    				=							hidden_dropout_prob
             UpperCAmelCase_    				=							attention_probs_dropout_prob
             UpperCAmelCase_    				=							max_position_embeddings
             UpperCAmelCase_    				=							type_vocab_size
             UpperCAmelCase_    				=							initializer_range
             UpperCAmelCase_    				=							layer_norm_eps
             UpperCAmelCase_    				=							embedding_size
             UpperCAmelCase_    				=							head_ratio
             UpperCAmelCase_    				=							conv_kernel_size
             UpperCAmelCase_    				=							num_groups
             UpperCAmelCase_    				=							classifier_dropout



class    lowercase__     (					SCREAMING_SNAKE_CASE   ):







       '''simple docstring'''


       @property
       def   lowercase__       (							self    :						Dict					)				->		Mapping[str, Mapping[int, str]]:


             '''simple docstring'''




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




