
from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


_A   =     logging.get_logger(__name__)

_A   =     {
    "facebook/convnextv2-tiny-1k-224": "https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json",
}





class 	_lowerCAmelCase					(	__a					,      __a       ):
				_lowercase					='''convnextv2'''




				def __init__(					self				,				_UpperCamelCase=3				,				_UpperCamelCase=4				,				_UpperCamelCase=4				,				_UpperCamelCase=None				,				_UpperCamelCase=None				,				_UpperCamelCase="gelu"				,				_UpperCamelCase=0.02				,				_UpperCamelCase=1e-1_2				,				_UpperCamelCase=0.0				,				_UpperCamelCase=224				,				_UpperCamelCase=None				,				_UpperCamelCase=None				,				**_UpperCamelCase				,				)				->      List[Any]:
							super().__init__(**_UpperCamelCase     )

							lowerCAmelCase_						=	num_channels
							lowerCAmelCase_						=	patch_size
							lowerCAmelCase_						=	num_stages
							lowerCAmelCase_						=	[96, 192, 384, 768] if hidden_sizes is None else hidden_sizes
							lowerCAmelCase_						=	[3, 3, 9, 3] if depths is None else depths
							lowerCAmelCase_						=	hidden_act
							lowerCAmelCase_						=	initializer_range
							lowerCAmelCase_						=	layer_norm_eps
							lowerCAmelCase_						=	drop_path_rate
							lowerCAmelCase_						=	image_size
							lowerCAmelCase_						=	["stem"] + [f"""stage{idx}""" for idx in range(1				,				len(self.depths     ) + 1     )]
							lowerCAmelCase_	,  lowerCAmelCase_						=	get_aligned_output_features_output_indices(
							    out_features=_UpperCamelCase				,				out_indices=_UpperCamelCase				,				stage_names=self.stage_names     )





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,
)


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

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

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

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


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


try:
			if not is_tf_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_A   =     [
			    "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

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



