


from collections import OrderedDict
from typing import Mapping

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


A__:   Optional[int]    =	logging.get_logger(__name__)

A__:   str    =	{
    '''nghuyong/ernie-1.0-base-zh''': '''https://huggingface.co/nghuyong/ernie-1.0-base-zh/resolve/main/config.json''',
    '''nghuyong/ernie-2.0-base-en''': '''https://huggingface.co/nghuyong/ernie-2.0-base-en/resolve/main/config.json''',
    '''nghuyong/ernie-2.0-large-en''': '''https://huggingface.co/nghuyong/ernie-2.0-large-en/resolve/main/config.json''',
    '''nghuyong/ernie-3.0-base-zh''': '''https://huggingface.co/nghuyong/ernie-3.0-base-zh/resolve/main/config.json''',
    '''nghuyong/ernie-3.0-medium-zh''': '''https://huggingface.co/nghuyong/ernie-3.0-medium-zh/resolve/main/config.json''',
    '''nghuyong/ernie-3.0-mini-zh''': '''https://huggingface.co/nghuyong/ernie-3.0-mini-zh/resolve/main/config.json''',
    '''nghuyong/ernie-3.0-micro-zh''': '''https://huggingface.co/nghuyong/ernie-3.0-micro-zh/resolve/main/config.json''',
    '''nghuyong/ernie-3.0-nano-zh''': '''https://huggingface.co/nghuyong/ernie-3.0-nano-zh/resolve/main/config.json''',
    '''nghuyong/ernie-gram-zh''': '''https://huggingface.co/nghuyong/ernie-gram-zh/resolve/main/config.json''',
    '''nghuyong/ernie-health-zh''': '''https://huggingface.co/nghuyong/ernie-health-zh/resolve/main/config.json''',
}







class A__	(						snake_case_				):
      __UpperCamelCase	:  Tuple     	=							"""ernie"""






      def __init__(			self      :Tuple					,						SCREAMING_SNAKE_CASE      :List[Any]=3_0_5_2_2					,						SCREAMING_SNAKE_CASE      :str=7_6_8					,						SCREAMING_SNAKE_CASE      :Any=1_2					,						SCREAMING_SNAKE_CASE      :Union[str, Any]=1_2					,						SCREAMING_SNAKE_CASE      :List[Any]=3_0_7_2					,						SCREAMING_SNAKE_CASE      :List[Any]="gelu"					,						SCREAMING_SNAKE_CASE      :Any=0.1					,						SCREAMING_SNAKE_CASE      :Union[str, Any]=0.1					,						SCREAMING_SNAKE_CASE      :List[Any]=5_1_2					,						SCREAMING_SNAKE_CASE      :str=2					,						SCREAMING_SNAKE_CASE      :List[Any]=3					,						SCREAMING_SNAKE_CASE      :Dict=False					,						SCREAMING_SNAKE_CASE      :Union[str, Any]=0.02					,						SCREAMING_SNAKE_CASE      :List[Any]=1e-12					,						SCREAMING_SNAKE_CASE      :Dict=0					,						SCREAMING_SNAKE_CASE      :str="absolute"					,						SCREAMING_SNAKE_CASE      :Union[str, Any]=True					,						SCREAMING_SNAKE_CASE      :Dict=None					,						**SCREAMING_SNAKE_CASE      :Any					,						)	-> str:




             '''simple docstring'''
             super().__init__(pad_token_id=SCREAMING_SNAKE_CASE					,						**SCREAMING_SNAKE_CASE     )

             _a   :			Tuple					 =vocab_size
             _a   :			Dict					 =hidden_size
             _a   :			List[str]					 =num_hidden_layers
             _a   :			List[str]					 =num_attention_heads
             _a   :			Optional[Any]					 =hidden_act
             _a   :			int					 =intermediate_size
             _a   :			List[str]					 =hidden_dropout_prob
             _a   :			Any					 =attention_probs_dropout_prob
             _a   :			Tuple					 =max_position_embeddings
             _a   :			Any					 =type_vocab_size
             _a   :			Optional[int]					 =task_type_vocab_size
             _a   :			str					 =use_task_id
             _a   :			Union[str, Any]					 =initializer_range
             _a   :			Dict					 =layer_norm_eps
             _a   :			Dict					 =position_embedding_type
             _a   :			List[str]					 =use_cache
             _a   :			int					 =classifier_dropout







class A__	(						snake_case_				):






      @property
      def __UpperCAmelCase	(			self      :List[Any]     )	-> Mapping[str, Mapping[int, str]]:




             '''simple docstring'''


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






'''simple docstring'''







import copy
from typing import Dict

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING
from ..bit import BitConfig


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

A__:   List[Any]    =	{
    '''google/vit-hybrid-base-bit-384''': '''https://huggingface.co/vit-hybrid-base-bit-384/resolve/main/config.json''',
    # See all ViT hybrid models at https://huggingface.co/models?filter=vit
}







class A__	(						UpperCAmelCase__				):
      __UpperCamelCase	:  Dict     	=							"vit-hybrid"






      def __init__(			self      :List[Any]					,						SCREAMING_SNAKE_CASE      :Dict=None					,						SCREAMING_SNAKE_CASE      :Any=7_6_8					,						SCREAMING_SNAKE_CASE      :Optional[Any]=1_2					,						SCREAMING_SNAKE_CASE      :int=1_2					,						SCREAMING_SNAKE_CASE      :Any=3_0_7_2					,						SCREAMING_SNAKE_CASE      :List[str]="gelu"					,						SCREAMING_SNAKE_CASE      :str=0.0					,						SCREAMING_SNAKE_CASE      :Dict=0.0					,						SCREAMING_SNAKE_CASE      :Dict=0.02					,						SCREAMING_SNAKE_CASE      :Tuple=1e-12					,						SCREAMING_SNAKE_CASE      :List[Any]=2_2_4					,						SCREAMING_SNAKE_CASE      :Union[str, Any]=1					,						SCREAMING_SNAKE_CASE      :List[Any]=3					,						SCREAMING_SNAKE_CASE      :Optional[Any]=[1, 1_0_2_4, 2_4, 2_4]					,						SCREAMING_SNAKE_CASE      :Optional[Any]=True					,						**SCREAMING_SNAKE_CASE      :Dict					,						)	-> List[Any]:




             '''simple docstring'''
             super().__init__(**SCREAMING_SNAKE_CASE     )

             if backbone_config is None:
                    logger.info("""`backbone_config` is `None`. Initializing the config with a `BiT` backbone."""     )
                    _a   :			Optional[int]					 ={
                        """global_padding""": """same""",
                        """layer_type""": """bottleneck""",
                        """depths""": [3, 4, 9],
                        """out_features""": ["""stage3"""],
                        """embedding_dynamic_padding""": True,
                    }

             if isinstance(SCREAMING_SNAKE_CASE					,						SCREAMING_SNAKE_CASE     ):
                    if "model_type" in backbone_config:
                           _a   :			Dict					 =CONFIG_MAPPING[backbone_config["""model_type"""]]
                    else:
                           logger.info(
                               """`model_type` is not found in `backbone_config`. Use `Bit` as the backbone configuration class."""     )
                           _a   :			List[str]					 =BitConfig
                    _a   :			List[Any]					 =backbone_config_class(**SCREAMING_SNAKE_CASE     )

             _a   :			str					 =backbone_featmap_shape
             _a   :			Dict					 =backbone_config
             _a   :			Tuple					 =hidden_size
             _a   :			Union[str, Any]					 =num_hidden_layers
             _a   :			Tuple					 =num_attention_heads
             _a   :			int					 =intermediate_size
             _a   :			Any					 =hidden_act
             _a   :			Union[str, Any]					 =hidden_dropout_prob
             _a   :			Any					 =attention_probs_dropout_prob
             _a   :			Tuple					 =initializer_range
             _a   :			int					 =layer_norm_eps
             _a   :			Union[str, Any]					 =image_size
             _a   :			str					 =patch_size
             _a   :			Optional[int]					 =num_channels
             _a   :			Union[str, Any]					 =qkv_bias






      def __UpperCAmelCase	(			self      :Optional[Any]     )	-> Dict[str, any]:




             '''simple docstring'''
             _a   :			Dict					 =copy.deepcopy(self.__dict__     )
             _a   :			Tuple					 =self.backbone_config.to_dict()
             _a   :			str					 =self.__class__.model_type
             return output


