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

_lowercase		:				Tuple	       =		logging.get_logger(__name__)

_lowercase		:				Tuple	       =		{
    "openai/imagegpt-small": "",
    "openai/imagegpt-medium": "",
    "openai/imagegpt-large": "",
}





class 					__magic_name__		(					_UpperCAmelCase):
   UpperCamelCase__       = '''imagegpt'''
   UpperCamelCase__       = ['''past_key_values''']
   UpperCamelCase__       = {
       '''hidden_size''': '''n_embd''',
       '''max_position_embeddings''': '''n_positions''',
       '''num_attention_heads''': '''n_head''',
       '''num_hidden_layers''': '''n_layer''',
   }







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

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





class 					__magic_name__		(					_UpperCAmelCase):







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







   def 			SCREAMING_SNAKE_CASE_  (			self       :						List[Any]       ,    lowercase_       :						"FeatureExtractionMixin"       ,    lowercase_       :						int = 1       ,    lowercase_       :						int = -1       ,    lowercase_       :						bool = False       ,    lowercase_       :						Optional["TensorType"] = None       ,    lowercase_       :						int = 3       ,    lowercase_       :						int = 32       ,    lowercase_       :						int = 32       ,    ):
          lowercase_      :    Union[str, Any]       		= self._generate_dummy_images(lowercase_       ,    lowercase_       ,    lowercase_       ,    lowercase_					)
          lowercase_      :    Dict       		= dict(preprocessor(images=lowercase_       ,    return_tensors=lowercase_					)					)

          return inputs






'''simple docstring'''




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


_lowercase		:				Dict	       =		{
    "configuration_bloom": ["BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP", "BloomConfig", "BloomOnnxConfig"],
}
try:
						if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_lowercase		:				Dict	       =		["BloomTokenizerFast"]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_lowercase		:				Dict	       =		[
						    "BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "BloomForCausalLM",
						    "BloomModel",
						    "BloomPreTrainedModel",
						    "BloomForSequenceClassification",
						    "BloomForTokenClassification",
						    "BloomForQuestionAnswering",
						]

if TYPE_CHECKING:
						from .configuration_bloom import BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP, BloomConfig, BloomOnnxConfig

						try:
												if not is_tokenizers_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_bloom_fast import BloomTokenizerFast

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_bloom import (
												    BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST,
												    BloomForCausalLM,
												    BloomForQuestionAnswering,
												    BloomForSequenceClassification,
												    BloomForTokenClassification,
												    BloomModel,
												    BloomPreTrainedModel,
												)

else:
						import sys

						_lowercase		:				Optional[int]	       =		_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





