



from collections import OrderedDict
from typing import Mapping

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


A_		:     Tuple        =     logging.get_logger(__name__)

A_		:     str        =     {
    '''bert-base-uncased''': '''https://huggingface.co/bert-base-uncased/resolve/main/config.json''',
    '''bert-large-uncased''': '''https://huggingface.co/bert-large-uncased/resolve/main/config.json''',
    '''bert-base-cased''': '''https://huggingface.co/bert-base-cased/resolve/main/config.json''',
    '''bert-large-cased''': '''https://huggingface.co/bert-large-cased/resolve/main/config.json''',
    '''bert-base-multilingual-uncased''': '''https://huggingface.co/bert-base-multilingual-uncased/resolve/main/config.json''',
    '''bert-base-multilingual-cased''': '''https://huggingface.co/bert-base-multilingual-cased/resolve/main/config.json''',
    '''bert-base-chinese''': '''https://huggingface.co/bert-base-chinese/resolve/main/config.json''',
    '''bert-base-german-cased''': '''https://huggingface.co/bert-base-german-cased/resolve/main/config.json''',
    '''bert-large-uncased-whole-word-masking''': (
        '''https://huggingface.co/bert-large-uncased-whole-word-masking/resolve/main/config.json'''
    ),
    '''bert-large-cased-whole-word-masking''': (
        '''https://huggingface.co/bert-large-cased-whole-word-masking/resolve/main/config.json'''
    ),
    '''bert-large-uncased-whole-word-masking-finetuned-squad''': (
        '''https://huggingface.co/bert-large-uncased-whole-word-masking-finetuned-squad/resolve/main/config.json'''
    ),
    '''bert-large-cased-whole-word-masking-finetuned-squad''': (
        '''https://huggingface.co/bert-large-cased-whole-word-masking-finetuned-squad/resolve/main/config.json'''
    ),
    '''bert-base-cased-finetuned-mrpc''': '''https://huggingface.co/bert-base-cased-finetuned-mrpc/resolve/main/config.json''',
    '''bert-base-german-dbmdz-cased''': '''https://huggingface.co/bert-base-german-dbmdz-cased/resolve/main/config.json''',
    '''bert-base-german-dbmdz-uncased''': '''https://huggingface.co/bert-base-german-dbmdz-uncased/resolve/main/config.json''',
    '''cl-tohoku/bert-base-japanese''': '''https://huggingface.co/cl-tohoku/bert-base-japanese/resolve/main/config.json''',
    '''cl-tohoku/bert-base-japanese-whole-word-masking''': (
        '''https://huggingface.co/cl-tohoku/bert-base-japanese-whole-word-masking/resolve/main/config.json'''
    ),
    '''cl-tohoku/bert-base-japanese-char''': (
        '''https://huggingface.co/cl-tohoku/bert-base-japanese-char/resolve/main/config.json'''
    ),
    '''cl-tohoku/bert-base-japanese-char-whole-word-masking''': (
        '''https://huggingface.co/cl-tohoku/bert-base-japanese-char-whole-word-masking/resolve/main/config.json'''
    ),
    '''TurkuNLP/bert-base-finnish-cased-v1''': (
        '''https://huggingface.co/TurkuNLP/bert-base-finnish-cased-v1/resolve/main/config.json'''
    ),
    '''TurkuNLP/bert-base-finnish-uncased-v1''': (
        '''https://huggingface.co/TurkuNLP/bert-base-finnish-uncased-v1/resolve/main/config.json'''
    ),
    '''wietsedv/bert-base-dutch-cased''': '''https://huggingface.co/wietsedv/bert-base-dutch-cased/resolve/main/config.json''',
    # See all BERT models at https://huggingface.co/models?filter=bert
}



class 		_lowercase		(       UpperCAmelCase__	):
   _UpperCAmelCase     	=			'''bert'''

   def __init__(      self			:       int							,   __lowerCAmelCase			:       Any=3_0522							,   __lowerCAmelCase			:       List[Any]=768							,   __lowerCAmelCase			:       int=12							,   __lowerCAmelCase			:       List[str]=12							,   __lowerCAmelCase			:       str=3072							,   __lowerCAmelCase			:       str="gelu"							,   __lowerCAmelCase			:       Optional[Any]=0.1							,   __lowerCAmelCase			:       str=0.1							,   __lowerCAmelCase			:       str=512							,   __lowerCAmelCase			:       List[Any]=2							,   __lowerCAmelCase			:       Tuple=0.0_2							,   __lowerCAmelCase			:       Any=1E-12							,   __lowerCAmelCase			:       Any=0							,   __lowerCAmelCase			:       Any="absolute"							,   __lowerCAmelCase			:       Dict=True							,   __lowerCAmelCase			:       str=None							,   **__lowerCAmelCase			:       str							,   )       ->				Dict:


    """simple docstring"""






    super().__init__(pad_token_id=__lowerCAmelCase							,   **__lowerCAmelCase							)

    a						=		vocab_size
    a						=		hidden_size
    a						=		num_hidden_layers
    a						=		num_attention_heads
    a						=		hidden_act
    a						=		intermediate_size
    a						=		hidden_dropout_prob
    a						=		attention_probs_dropout_prob
    a						=		max_position_embeddings
    a						=		type_vocab_size
    a						=		initializer_range
    a						=		layer_norm_eps
    a						=		position_embedding_type
    a						=		use_cache
    a						=		classifier_dropout



class 		_lowercase		(       UpperCAmelCase__	):

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


    """simple docstring"""






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






from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
     if not (is_transformers_available() and is_torch_available() and is_transformers_version('''>=''', '''4.25.0''')):
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     from ...utils.dummy_torch_and_transformers_objects import UnCLIPImageVariationPipeline, UnCLIPPipeline
else:
     from .pipeline_unclip import UnCLIPPipeline
     from .pipeline_unclip_image_variation import UnCLIPImageVariationPipeline
     from .text_proj import UnCLIPTextProjModel

