


"""simple docstring"""




from collections import OrderedDict
from typing import TYPE_CHECKING, Any, Mapping, Optional

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


if TYPE_CHECKING:
					from ... import FeatureExtractionMixin, TensorType

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

__magic_name__						: Tuple    =				{
    'openai/imagegpt-small': '',
    'openai/imagegpt-medium': '',
    'openai/imagegpt-large': '',
}




class 			__snake_case   (lowerCamelCase  ):
							__a					 =       '''imagegpt'''
							__a					 =       ['''past_key_values''']
							__a					 =       {
							    '''hidden_size''': '''n_embd''',
							    '''max_position_embeddings''': '''n_positions''',
							    '''num_attention_heads''': '''n_head''',
							    '''num_hidden_layers''': '''n_layer''',
							}




							def __init__(     self:    Tuple     ,							A_:    Dict=5_12 + 1     ,							A_:    Optional[int]=32 * 32     ,							A_:    Optional[Any]=5_12     ,							A_:    str=24     ,							A_:    Union[str, Any]=8     ,							A_:    Any=None     ,							A_:    str="quick_gelu"     ,							A_:    Optional[Any]=0.1     ,							A_:    Tuple=0.1     ,							A_:    List[str]=0.1     ,							A_:    Dict=1E-5     ,							A_:    Optional[int]=0.02     ,							A_:    List[str]=True     ,							A_:    Tuple=True     ,							A_:    List[str]=False     ,							A_:    List[Any]=False     ,							A_:    Dict=False     ,							**A_:    int     ,							):
										__lowerCamelCase          =      vocab_size
										__lowerCamelCase          =      n_positions
										__lowerCamelCase          =      n_embd
										__lowerCamelCase          =      n_layer
										__lowerCamelCase          =      n_head
										__lowerCamelCase          =      n_inner
										__lowerCamelCase          =      activation_function
										__lowerCamelCase          =      resid_pdrop
										__lowerCamelCase          =      embd_pdrop
										__lowerCamelCase          =      attn_pdrop
										__lowerCamelCase          =      layer_norm_epsilon
										__lowerCamelCase          =      initializer_range
										__lowerCamelCase          =      scale_attn_weights
										__lowerCamelCase          =      use_cache
										__lowerCamelCase          =      scale_attn_by_inverse_layer_idx
										__lowerCamelCase          =      reorder_and_upcast_attn
										__lowerCamelCase          =      tie_word_embeddings

										super().__init__(tie_word_embeddings=A_     ,							**A_   )




class 			__snake_case   (lowerCamelCase  ):




							@property
							def   __a   (     self:    Tuple   ):
										return OrderedDict(
										    [
										        ("""input_ids""", {0: """batch""", 1: """sequence"""}),
										    ]   )




							def   __a   (     self:    Tuple     ,							A_:    "FeatureExtractionMixin"     ,							A_:    int = 1     ,							A_:    int = -1     ,							A_:    bool = False     ,							A_:    Optional["TensorType"] = None     ,							A_:    int = 3     ,							A_:    int = 32     ,							A_:    int = 32     ,							):
										__lowerCamelCase          =      self._generate_dummy_images(A_     ,							A_     ,							A_     ,							A_   )
										__lowerCamelCase          =      dict(preprocessor(images=A_     ,							return_tensors=A_   )   )

										return inputs








"""simple docstring"""




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


__magic_name__						: str    =				logging.get_logger(__name__)

__magic_name__						: List[Any]    =				{
    'uclanlp/visualbert-vqa': 'https://huggingface.co/uclanlp/visualbert-vqa/resolve/main/config.json',
    'uclanlp/visualbert-vqa-pre': 'https://huggingface.co/uclanlp/visualbert-vqa-pre/resolve/main/config.json',
    'uclanlp/visualbert-vqa-coco-pre': (
        'https://huggingface.co/uclanlp/visualbert-vqa-coco-pre/resolve/main/config.json'
    ),
    'uclanlp/visualbert-vcr': 'https://huggingface.co/uclanlp/visualbert-vcr/resolve/main/config.json',
    'uclanlp/visualbert-vcr-pre': 'https://huggingface.co/uclanlp/visualbert-vcr-pre/resolve/main/config.json',
    'uclanlp/visualbert-vcr-coco-pre': (
        'https://huggingface.co/uclanlp/visualbert-vcr-coco-pre/resolve/main/config.json'
    ),
    'uclanlp/visualbert-nlvr2': 'https://huggingface.co/uclanlp/visualbert-nlvr2/resolve/main/config.json',
    'uclanlp/visualbert-nlvr2-pre': 'https://huggingface.co/uclanlp/visualbert-nlvr2-pre/resolve/main/config.json',
    'uclanlp/visualbert-nlvr2-coco-pre': (
        'https://huggingface.co/uclanlp/visualbert-nlvr2-coco-pre/resolve/main/config.json'
    )
    # See all VisualBERT models at https://huggingface.co/models?filter=visual_bert
}




class 			__snake_case   (lowerCamelCase  ):
							__a					 =       '''visual_bert'''




							def __init__(     self:    Any     ,							A_:    List[str]=3_05_22     ,							A_:    Tuple=7_68     ,							A_:    Dict=5_12     ,							A_:    List[Any]=12     ,							A_:    str=12     ,							A_:    Dict=30_72     ,							A_:    str="gelu"     ,							A_:    Union[str, Any]=0.1     ,							A_:    Any=0.1     ,							A_:    List[Any]=5_12     ,							A_:    int=2     ,							A_:    int=0.02     ,							A_:    Any=1E-12     ,							A_:    List[str]=False     ,							A_:    str=True     ,							A_:    Union[str, Any]=1     ,							A_:    Optional[int]=0     ,							A_:    Dict=2     ,							**A_:    Optional[int]     ,							):
										super().__init__(pad_token_id=A_     ,							bos_token_id=A_     ,							eos_token_id=A_     ,							**A_   )

										__lowerCamelCase          =      vocab_size
										__lowerCamelCase          =      max_position_embeddings
										__lowerCamelCase          =      hidden_size
										__lowerCamelCase          =      visual_embedding_dim
										__lowerCamelCase          =      num_hidden_layers
										__lowerCamelCase          =      num_attention_heads
										__lowerCamelCase          =      intermediate_size
										__lowerCamelCase          =      hidden_act
										__lowerCamelCase          =      hidden_dropout_prob
										__lowerCamelCase          =      attention_probs_dropout_prob
										__lowerCamelCase          =      initializer_range
										__lowerCamelCase          =      type_vocab_size
										__lowerCamelCase          =      layer_norm_eps
										__lowerCamelCase          =      bypass_transformer
										__lowerCamelCase          =      special_visual_initialize




