from collections import OrderedDict
from typing import Mapping

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


lowerCAmelCase__  	=      logging.get_logger(__name__)

lowerCAmelCase__  	=      {
    "nghuyong/ernie-1.0-base-zh": "https://huggingface.co/nghuyong/ernie-1.0-base-zh/resolve/main/config.json",
    "nghuyong/ernie-2.0-base-en": "https://huggingface.co/nghuyong/ernie-2.0-base-en/resolve/main/config.json",
    "nghuyong/ernie-2.0-large-en": "https://huggingface.co/nghuyong/ernie-2.0-large-en/resolve/main/config.json",
    "nghuyong/ernie-3.0-base-zh": "https://huggingface.co/nghuyong/ernie-3.0-base-zh/resolve/main/config.json",
    "nghuyong/ernie-3.0-medium-zh": "https://huggingface.co/nghuyong/ernie-3.0-medium-zh/resolve/main/config.json",
    "nghuyong/ernie-3.0-mini-zh": "https://huggingface.co/nghuyong/ernie-3.0-mini-zh/resolve/main/config.json",
    "nghuyong/ernie-3.0-micro-zh": "https://huggingface.co/nghuyong/ernie-3.0-micro-zh/resolve/main/config.json",
    "nghuyong/ernie-3.0-nano-zh": "https://huggingface.co/nghuyong/ernie-3.0-nano-zh/resolve/main/config.json",
    "nghuyong/ernie-gram-zh": "https://huggingface.co/nghuyong/ernie-gram-zh/resolve/main/config.json",
    "nghuyong/ernie-health-zh": "https://huggingface.co/nghuyong/ernie-health-zh/resolve/main/config.json",
}
class 	_a  (							lowerCamelCase_					):



	"""simple docstring"""



	__SCREAMING_SNAKE_CASE              =					'ernie'


	def __init__(   self       ,  lowerCAmelCase_=30522       ,  lowerCAmelCase_=768       ,  lowerCAmelCase_=12       ,  lowerCAmelCase_=12       ,  lowerCAmelCase_=3072       ,  lowerCAmelCase_="gelu"       ,  lowerCAmelCase_=0.1       ,  lowerCAmelCase_=0.1       ,  lowerCAmelCase_=512       ,  lowerCAmelCase_=2       ,  lowerCAmelCase_=3       ,  lowerCAmelCase_=False       ,  lowerCAmelCase_=0.0_2       ,  lowerCAmelCase_=1e-12       ,  lowerCAmelCase_=0       ,  lowerCAmelCase_="absolute"       ,  lowerCAmelCase_=True       ,  lowerCAmelCase_=None       ,  **lowerCAmelCase_       ,  ):
		super().__init__(pad_token_id=lowerCAmelCase_       ,  **lowerCAmelCase_       )

		_lowercase   =vocab_size
		_lowercase   =hidden_size
		_lowercase   =num_hidden_layers
		_lowercase   =num_attention_heads
		_lowercase   =hidden_act
		_lowercase   =intermediate_size
		_lowercase   =hidden_dropout_prob
		_lowercase   =attention_probs_dropout_prob
		_lowercase   =max_position_embeddings
		_lowercase   =type_vocab_size
		_lowercase   =task_type_vocab_size
		_lowercase   =use_task_id
		_lowercase   =initializer_range
		_lowercase   =layer_norm_eps
		_lowercase   =position_embedding_type
		_lowercase   =use_cache
		_lowercase   =classifier_dropout

class 	_a  (							lowerCamelCase_					):



	"""simple docstring"""



	@property
	def __lowerCAmelCase      (   self       ):
		if self.task == "multiple-choice":
			_lowercase   ={0: "batch", 1: "choice", 2: "sequence"}
		else:
			_lowercase   ={0: "batch", 1: "sequence"}
		return OrderedDict(
		    [
		        ("input_ids", dynamic_axis),
		        ("attention_mask", dynamic_axis),
		        ("token_type_ids", dynamic_axis),
		        ("task_type_ids", dynamic_axis),
		    ]       )





from typing import TYPE_CHECKING

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


lowerCAmelCase__  	=      {
    "configuration_imagegpt": ["IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ImageGPTConfig", "ImageGPTOnnxConfig"]
}

try:
						if not is_vision_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCAmelCase__  	=      ["ImageGPTFeatureExtractor"]
						lowerCAmelCase__  	=      ["ImageGPTImageProcessor"]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCAmelCase__  	=      [
						    "IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "ImageGPTForCausalImageModeling",
						    "ImageGPTForImageClassification",
						    "ImageGPTModel",
						    "ImageGPTPreTrainedModel",
						    "load_tf_weights_in_imagegpt",
						]


if TYPE_CHECKING:
						from .configuration_imagegpt import IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, ImageGPTConfig, ImageGPTOnnxConfig

						try:
												if not is_vision_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .feature_extraction_imagegpt import ImageGPTFeatureExtractor
												from .image_processing_imagegpt import ImageGPTImageProcessor

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_imagegpt import (
												    IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    ImageGPTForCausalImageModeling,
												    ImageGPTForImageClassification,
												    ImageGPTModel,
												    ImageGPTPreTrainedModel,
												    load_tf_weights_in_imagegpt,
												)

else:
						import sys

						lowerCAmelCase__  	=      _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




