

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


lowerCAmelCase__		      =       logging.get_logger(__name__)

lowerCAmelCase__		      =       {
    """microsoft/beit-base-patch16-224-pt22k""": (
        """https://huggingface.co/microsoft/beit-base-patch16-224-pt22k/resolve/main/config.json"""
    ),
    # See all BEiT models at https://huggingface.co/models?filter=beit
}

class     a__  (    __SCREAMING_SNAKE_CASE	):
			"""simple docstring"""







			__lowerCamelCase       				=				'beit'


			def __init__(			self					,					lowercase=8192					,					lowercase=768					,					lowercase=12					,					lowercase=12					,					lowercase=3072					,					lowercase="gelu"					,					lowercase=0.0					,					lowercase=0.0					,					lowercase=0.02					,					lowercase=1e-12					,					lowercase=224					,					lowercase=16					,					lowercase=3					,					lowercase=False					,					lowercase=False					,					lowercase=False					,					lowercase=False					,					lowercase=0.1					,					lowercase=0.1					,					lowercase=True					,					lowercase=[3, 5, 7, 11]					,					lowercase=[1, 2, 3, 6]					,					lowercase=True					,					lowercase=0.4					,					lowercase=256					,					lowercase=1					,					lowercase=False					,					lowercase=255					,					**lowercase					,					)     ->  List[Any]:
							'''simple docstring'''






							super().__init__(**_a				)

							A__						=	vocab_size
							A__						=	hidden_size
							A__						=	num_hidden_layers
							A__						=	num_attention_heads
							A__						=	intermediate_size
							A__						=	hidden_act
							A__						=	hidden_dropout_prob
							A__						=	attention_probs_dropout_prob
							A__						=	initializer_range
							A__						=	layer_norm_eps

							A__						=	image_size
							A__						=	patch_size
							A__						=	num_channels
							A__						=	use_mask_token
							A__						=	use_absolute_position_embeddings
							A__						=	use_relative_position_bias
							A__						=	use_shared_relative_position_bias
							A__						=	layer_scale_init_value
							A__						=	drop_path_rate
							A__						=	use_mean_pooling
							# decode head attributes (semantic segmentation)
							A__						=	out_indices
							A__						=	pool_scales
							# auxiliary head attributes (semantic segmentation)
							A__						=	use_auxiliary_head
							A__						=	auxiliary_loss_weight
							A__						=	auxiliary_channels
							A__						=	auxiliary_num_convs
							A__						=	auxiliary_concat_input
							A__						=	semantic_loss_ignore_index

class     a__  (    __SCREAMING_SNAKE_CASE	):
			"""simple docstring"""







			__lowerCamelCase       				=				version.parse('1.11'	)


			@property
			def    UpperCamelCase						(			self				)     ->  int:
							'''simple docstring'''






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


			@property
			def    UpperCamelCase						(			self				)     ->  str:
							'''simple docstring'''






							return 1e-4





"""simple docstring"""




from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


lowercase_			     =  {"configuration_xglm": ["XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "XGLMConfig"]}

try:
				if not is_sentencepiece_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase_			     =  ["XGLMTokenizer"]

try:
				if not is_tokenizers_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase_			     =  ["XGLMTokenizerFast"]

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase_			     =  [
				    "XGLM_PRETRAINED_MODEL_ARCHIVE_LIST",
				    "XGLMForCausalLM",
				    "XGLMModel",
				    "XGLMPreTrainedModel",
				]


try:
				if not is_flax_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase_			     =  [
				    "FlaxXGLMForCausalLM",
				    "FlaxXGLMModel",
				    "FlaxXGLMPreTrainedModel",
				]


try:
				if not is_tf_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase_			     =  [
				    "TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST",
				    "TFXGLMForCausalLM",
				    "TFXGLMModel",
				    "TFXGLMPreTrainedModel",
				]


if TYPE_CHECKING:
				from .configuration_xglm import XGLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XGLMConfig

				try:
								if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .tokenization_xglm import XGLMTokenizer

				try:
								if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .tokenization_xglm_fast import XGLMTokenizerFast

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_xglm import XGLM_PRETRAINED_MODEL_ARCHIVE_LIST, XGLMForCausalLM, XGLMModel, XGLMPreTrainedModel

				try:
								if not is_flax_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_flax_xglm import FlaxXGLMForCausalLM, FlaxXGLMModel, FlaxXGLMPreTrainedModel

				try:
								if not is_tf_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_tf_xglm import (
								    TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST,
								    TFXGLMForCausalLM,
								    TFXGLMModel,
								    TFXGLMPreTrainedModel,
								)


else:
				import sys

				lowercase_			     =  _LazyModule(__name__, globals()["__file__"], _import_structure)






