




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

A_      =    logging.get_logger(__name__)

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






class  lowercase(					__a			):







 '''simple docstring'''





 lowercase__			 = "imagegpt"
 lowercase__			 = ["past_key_values"]
 lowercase__			 = {
     "hidden_size": "n_embd",
     "max_position_embeddings": "n_positions",
     "num_attention_heads": "n_head",
     "num_hidden_layers": "n_layer",
 }


 def __init__(    self:		Union[str, Any],				a_:		Union[str, Any]=512 + 1,				a_:		int=32 * 32,				a_:		str=512,				a_:		List[Any]=24,				a_:		Any=8,				a_:		int=None,				a_:		Optional[int]="quick_gelu",				a_:		Optional[Any]=0.1,				a_:		Any=0.1,				a_:		Any=0.1,				a_:		Optional[Any]=1E-5,				a_:		List[str]=0.02,				a_:		int=True,				a_:		Union[str, Any]=True,				a_:		int=False,				a_:		Dict=False,				a_:		Tuple=False,				**a_:		Any,				):




   '''simple docstring'''



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

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







class  lowercase(					__a			):







 '''simple docstring'''





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




   '''simple docstring'''



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


 def 			UpperCamelCase_       (    self:		List[Any],				a_:		"FeatureExtractionMixin",				a_:		int = 1,				a_:		int = -1,				a_:		bool = False,				a_:		Optional["TensorType"] = None,				a_:		int = 3,				a_:		int = 32,				a_:		int = 32,				):




   '''simple docstring'''



   _snake_case							:		Tuple								=  self._generate_dummy_images(a_,				a_,				a_,				a_		)
   _snake_case							:		List[str]								=  dict(preprocessor(images=a_,				return_tensors=a_		)		)

   return inputs








"""simple docstring"""


from .data_collator import (
    DataCollatorForLanguageModeling,
    DataCollatorForPermutationLanguageModeling,
    DataCollatorForSeqaSeq,
    DataCollatorForSOP,
    DataCollatorForTokenClassification,
    DataCollatorForWholeWordMask,
    DataCollatorWithPadding,
    DefaultDataCollator,
    default_data_collator,
)
from .metrics import glue_compute_metrics, xnli_compute_metrics
from .processors import (
    DataProcessor,
    InputExample,
    InputFeatures,
    SingleSentenceClassificationProcessor,
    SquadExample,
    SquadFeatures,
    SquadVaProcessor,
    SquadVaProcessor,
    glue_convert_examples_to_features,
    glue_output_modes,
    glue_processors,
    glue_tasks_num_labels,
    squad_convert_examples_to_features,
    xnli_output_modes,
    xnli_processors,
    xnli_tasks_num_labels,
)


