






"""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

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

_lowerCAmelCase	:	Dict				=      {
    """openai/imagegpt-small""": """""",
    """openai/imagegpt-medium""": """""",
    """openai/imagegpt-large""": """""",
}




class 			lowerCAmelCase__			(    __magic_name__   ):
   SCREAMING_SNAKE_CASE_    ='''imagegpt'''
   SCREAMING_SNAKE_CASE_    =['''past_key_values''']
   SCREAMING_SNAKE_CASE_    ={
       '''hidden_size''': '''n_embd''',
       '''max_position_embeddings''': '''n_positions''',
       '''num_attention_heads''': '''n_head''',
       '''num_hidden_layers''': '''n_layer''',
   }
   def __init__(		self      :	Optional[int]							,			snake_case__      :	List[str]=5_1_2 + 1							,			snake_case__      :	List[str]=3_2 * 3_2							,			snake_case__      :	Tuple=5_1_2							,			snake_case__      :	Tuple=2_4							,			snake_case__      :	str=8							,			snake_case__      :	Union[str, Any]=None							,			snake_case__      :	List[Any]="quick_gelu"							,			snake_case__      :	Any=0.1							,			snake_case__      :	List[Any]=0.1							,			snake_case__      :	int=0.1							,			snake_case__      :	str=1e-5							,			snake_case__      :	Any=0.02							,			snake_case__      :	Tuple=True							,			snake_case__      :	Optional[Any]=True							,			snake_case__      :	Tuple=False							,			snake_case__      :	Dict=False							,			snake_case__      :	str=False							,			**snake_case__      :	Tuple							,			):


        '''simple docstring'''
        UpperCAmelCase__						:    Dict							=							vocab_size
        UpperCAmelCase__						:    Union[str, Any]							=							n_positions
        UpperCAmelCase__						:    Union[str, Any]							=							n_embd
        UpperCAmelCase__						:    int							=							n_layer
        UpperCAmelCase__						:    int							=							n_head
        UpperCAmelCase__						:    Dict							=							n_inner
        UpperCAmelCase__						:    Optional[Any]							=							activation_function
        UpperCAmelCase__						:    Union[str, Any]							=							resid_pdrop
        UpperCAmelCase__						:    int							=							embd_pdrop
        UpperCAmelCase__						:    Tuple							=							attn_pdrop
        UpperCAmelCase__						:    int							=							layer_norm_epsilon
        UpperCAmelCase__						:    str							=							initializer_range
        UpperCAmelCase__						:    Any							=							scale_attn_weights
        UpperCAmelCase__						:    Dict							=							use_cache
        UpperCAmelCase__						:    Tuple							=							scale_attn_by_inverse_layer_idx
        UpperCAmelCase__						:    int							=							reorder_and_upcast_attn
        UpperCAmelCase__						:    str							=							tie_word_embeddings

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




class 			lowerCAmelCase__			(    __magic_name__   ):
   @property
   def       __a							(		self      :	int							):


        '''simple docstring'''
        return OrderedDict(
            [
                ("input_ids", {0: "batch", 1: "sequence"}),
            ]							)




   def       __a							(		self      :	Dict							,			snake_case__      :	"FeatureExtractionMixin"							,			snake_case__      :	int = 1							,			snake_case__      :	int = -1							,			snake_case__      :	bool = False							,			snake_case__      :	Optional["TensorType"] = None							,			snake_case__      :	int = 3							,			snake_case__      :	int = 3_2							,			snake_case__      :	int = 3_2							,			):


        '''simple docstring'''
        UpperCAmelCase__						:    List[str]							=							self._generate_dummy_images(snake_case__							,			snake_case__							,			snake_case__							,			snake_case__							)
        UpperCAmelCase__						:    Dict							=							dict(preprocessor(images=snake_case__							,			return_tensors=snake_case__							)							)

        return inputs










"""simple docstring"""



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


_lowerCAmelCase	:	Any				=      logging.get_logger(__name__)

_lowerCAmelCase	:	Union[str, Any]				=      {
    # See all MEGATRON_BERT models at https://huggingface.co/models?filter=bert
}




class 			lowerCAmelCase__			(    __magic_name__   ):
   SCREAMING_SNAKE_CASE_    ='''megatron-bert'''
   def __init__(		self      :	Tuple							,			snake_case__      :	List[Any]=2_9_0_5_6							,			snake_case__      :	Any=1_0_2_4							,			snake_case__      :	Tuple=2_4							,			snake_case__      :	Optional[Any]=1_6							,			snake_case__      :	List[str]=4_0_9_6							,			snake_case__      :	Union[str, Any]="gelu"							,			snake_case__      :	int=0.1							,			snake_case__      :	Dict=0.1							,			snake_case__      :	str=5_1_2							,			snake_case__      :	Optional[Any]=2							,			snake_case__      :	Any=0.02							,			snake_case__      :	Optional[Any]=1e-12							,			snake_case__      :	str=0							,			snake_case__      :	Optional[Any]="absolute"							,			snake_case__      :	Optional[Any]=True							,			**snake_case__      :	Any							,			):


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

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


