
'''simple docstring'''





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_speech_available,
    is_torch_available,
)


UpperCAmelCase            = {
    "configuration_speech_to_text_2": ["SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Speech2Text2Config"],
    "processing_speech_to_text_2": ["Speech2Text2Processor"],
    "tokenization_speech_to_text_2": ["Speech2Text2Tokenizer"],
}


try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						UpperCAmelCase            = [
						    "SPEECH_TO_TEXT_2_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "Speech2Text2ForCausalLM",
						    "Speech2Text2PreTrainedModel",
						]


if TYPE_CHECKING:
						from .configuration_speech_to_text_a import SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP, SpeechaTextaConfig
						from .processing_speech_to_text_a import SpeechaTextaProcessor
						from .tokenization_speech_to_text_a import SpeechaTextaTokenizer

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_speech_to_text_a import (
												    SPEECH_TO_TEXT_2_PRETRAINED_MODEL_ARCHIVE_LIST,
												    SpeechaTextaForCausalLM,
												    SpeechaTextaPreTrainedModel,
												)

else:
						import sys

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





'''simple docstring'''


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
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


lowerCamelCase__     						=  logging.get_logger(__name__)

lowerCamelCase__     						=  {
    'facebook/convnext-tiny-224': 'https://huggingface.co/facebook/convnext-tiny-224/resolve/main/config.json',
    # See all ConvNeXT models at https://huggingface.co/models?filter=convnext
}






class 						lowerCAmelCase__      (      UpperCAmelCase__     ,							UpperCAmelCase__						):
			lowerCAmelCase			:						Optional[Any]							 =  "convnext"




			def __init__(		self	:  Optional[int]						,	lowerCamelCase__	:  List[str]=3						,	lowerCamelCase__	:  List[str]=4						,	lowerCamelCase__	:  Optional[int]=4						,	lowerCamelCase__	:  Dict=None						,	lowerCamelCase__	:  Tuple=None						,	lowerCamelCase__	:  List[str]="gelu"						,	lowerCamelCase__	:  List[Any]=0.0_2						,	lowerCamelCase__	:  Dict=1E-12						,	lowerCamelCase__	:  Tuple=1E-6						,	lowerCamelCase__	:  Dict=0.0						,	lowerCamelCase__	:  Optional[int]=2_24						,	lowerCamelCase__	:  List[Any]=None						,	lowerCamelCase__	:  Any=None						,	**lowerCamelCase__	:  int						,	) ->str:



					'''simple docstring'''







					super().__init__(**lowerCamelCase__			)

					_UpperCAmelCase		:							Optional[int]             =   num_channels
					_UpperCAmelCase		:							Tuple             =   patch_size
					_UpperCAmelCase		:							Dict             =   num_stages
					_UpperCAmelCase		:							Optional[int]             =   [96, 1_92, 3_84, 7_68] if hidden_sizes is None else hidden_sizes
					_UpperCAmelCase		:							Dict             =   [3, 3, 9, 3] if depths is None else depths
					_UpperCAmelCase		:							Union[str, Any]             =   hidden_act
					_UpperCAmelCase		:							Tuple             =   initializer_range
					_UpperCAmelCase		:							Tuple             =   layer_norm_eps
					_UpperCAmelCase		:							Tuple             =   layer_scale_init_value
					_UpperCAmelCase		:							str             =   drop_path_rate
					_UpperCAmelCase		:							str             =   image_size
					_UpperCAmelCase		:							Tuple             =   ["stem"] + [F"""stage{idx}""" for idx in range(1						,	len(self.depths			) + 1			)]
					_UpperCAmelCase       ,     _UpperCAmelCase		:							str             =   get_aligned_output_features_output_indices(
					    out_features=lowerCamelCase__						,	out_indices=lowerCamelCase__						,	stage_names=self.stage_names			)






class 						lowerCAmelCase__      (      UpperCAmelCase__						):
			lowerCAmelCase			:						str							 =  version.parse("1.11"						)




			@property
			def 				lowerCAmelCase__     (		self	:  Dict			) ->Mapping[str, Mapping[int, str]]:



					'''simple docstring'''







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






			@property
			def 				lowerCAmelCase__     (		self	:  str			) ->float:



					'''simple docstring'''







					return 1E-5



