


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

UpperCAmelCase      		=			logging.get_logger(__name__)

UpperCAmelCase      		=			{
    '''openai/imagegpt-small''': '''''',
    '''openai/imagegpt-medium''': '''''',
    '''openai/imagegpt-large''': '''''',
}
class 					__magic_name__		(			__SCREAMING_SNAKE_CASE     ):
       __A			:      Any        =   "imagegpt"
       __A			:      List[str]        =   ["past_key_values"]
       __A			:      List[Any]        =   {
           "hidden_size": "n_embd",
           "max_position_embeddings": "n_positions",
           "num_attention_heads": "n_head",
           "num_hidden_layers": "n_layer",
       }






       def __init__(   self  :    str  ,     snake_case__  :    int=5_1_2 + 1  ,     snake_case__  :    List[str]=3_2 * 3_2  ,     snake_case__  :    int=5_1_2  ,     snake_case__  :    Optional[int]=2_4  ,     snake_case__  :    List[str]=8  ,     snake_case__  :    Dict=None  ,     snake_case__  :    Optional[Any]="quick_gelu"  ,     snake_case__  :    str=0.1  ,     snake_case__  :    Optional[Any]=0.1  ,     snake_case__  :    List[str]=0.1  ,     snake_case__  :    str=1e-5  ,     snake_case__  :    Union[str, Any]=0.02  ,     snake_case__  :    int=True  ,     snake_case__  :    Optional[int]=True  ,     snake_case__  :    Optional[Any]=False  ,     snake_case__  :    List[Any]=False  ,     snake_case__  :    str=False  ,     **snake_case__  :    Tuple  ,     ):

              '''simple docstring'''






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

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







class 					__magic_name__		(			__SCREAMING_SNAKE_CASE     ):






       @property
       def  __snake_case						(   self  :    List[str]				):

              '''simple docstring'''






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







       def  __snake_case						(   self  :    int  ,     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'''






              lowercase		:Any       							=				self._generate_dummy_images(_a  ,     _a  ,     _a  ,     _a				)
              lowercase		:List[Any]       							=				dict(preprocessor(images=_a  ,     return_tensors=_a				)				)

              return inputs










"""simple docstring"""



from collections import OrderedDict
from typing import Mapping

from packaging import version

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


UpperCAmelCase      		=			logging.get_logger(__name__)

UpperCAmelCase      		=			{
    '''facebook/deit-base-distilled-patch16-224''': (
        '''https://huggingface.co/facebook/deit-base-patch16-224/resolve/main/config.json'''
    ),
    # See all DeiT models at https://huggingface.co/models?filter=deit
}
class 					__magic_name__		(			__UpperCAmelCase     ):
       __A			:      Tuple        =   "deit"






       def __init__(   self  :    List[str]  ,     snake_case__  :    int=7_6_8  ,     snake_case__  :    List[Any]=1_2  ,     snake_case__  :    Dict=1_2  ,     snake_case__  :    List[Any]=3_0_7_2  ,     snake_case__  :    Optional[int]="gelu"  ,     snake_case__  :    Dict=0.0  ,     snake_case__  :    str=0.0  ,     snake_case__  :    List[str]=0.02  ,     snake_case__  :    Optional[int]=1e-1_2  ,     snake_case__  :    Any=2_2_4  ,     snake_case__  :    Optional[int]=1_6  ,     snake_case__  :    int=3  ,     snake_case__  :    str=True  ,     snake_case__  :    Optional[int]=1_6  ,     **snake_case__  :    List[Any]  ,     ):

              '''simple docstring'''






              super().__init__(**snake_case__				)

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







class 					__magic_name__		(			__UpperCAmelCase     ):
       __A			:      Optional[int]        =   version.parse("1.11"     )






       @property
       def  __snake_case						(   self  :    int				):

              '''simple docstring'''






              return OrderedDict(
                  [
                      ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
                  ]				)







       @property
       def  __snake_case						(   self  :    Optional[int]				):

              '''simple docstring'''






              return 1e-4

