

from typing import TYPE_CHECKING

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


A									=  {
    'configuration_speech_to_text': ['SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'Speech2TextConfig'],
    'processing_speech_to_text': ['Speech2TextProcessor'],
}

try:
		if not is_sentencepiece_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A									=  ['Speech2TextTokenizer']

try:
		if not is_speech_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A									=  ['Speech2TextFeatureExtractor']

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A									=  [
		    'TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'TFSpeech2TextForConditionalGeneration',
		    'TFSpeech2TextModel',
		    'TFSpeech2TextPreTrainedModel',
		]

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A									=  [
		    'SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'Speech2TextForConditionalGeneration',
		    'Speech2TextModel',
		    'Speech2TextPreTrainedModel',
		]


if TYPE_CHECKING:
		from .configuration_speech_to_text import SPEECH_TO_TEXT_PRETRAINED_CONFIG_ARCHIVE_MAP, SpeechaTextConfig
		from .processing_speech_to_text import SpeechaTextProcessor

		try:
				if not is_sentencepiece_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_speech_to_text import SpeechaTextTokenizer

		try:
				if not is_speech_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .feature_extraction_speech_to_text import SpeechaTextFeatureExtractor

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_speech_to_text import (
				    TF_SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFSpeechaTextForConditionalGeneration,
				    TFSpeechaTextModel,
				    TFSpeechaTextPreTrainedModel,
				)

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_speech_to_text import (
				    SPEECH_TO_TEXT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    SpeechaTextForConditionalGeneration,
				    SpeechaTextModel,
				    SpeechaTextPreTrainedModel,
				)

else:
		import sys

		A									=  _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



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									=  {
    'google/bit-50': 'https://huggingface.co/google/bit-50/resolve/main/config.json',
}


class SCREAMING_SNAKE_CASE	(		__snake_case				,    __snake_case				):






			"""simple docstring"""




			__A    	=	"""bit"""
			__A    	=	["""preactivation""", """bottleneck"""]
			__A    	=	["""SAME""", """VALID"""]


			def __init__(     self			,					__UpperCamelCase=3			,					__UpperCamelCase=64			,					__UpperCamelCase=[2_56, 5_12, 10_24, 20_48]			,					__UpperCamelCase=[3, 4, 6, 3]			,					__UpperCamelCase="preactivation"			,					__UpperCamelCase="relu"			,					__UpperCamelCase=None			,					__UpperCamelCase=32			,					__UpperCamelCase=0.0			,					__UpperCamelCase=False			,					__UpperCamelCase=32			,					__UpperCamelCase=1			,					__UpperCamelCase=None			,					__UpperCamelCase=None			,					**__UpperCamelCase			,					):

				"""simple docstring"""


				super().__init__(**__UpperCamelCase				)
				if layer_type not in self.layer_types:
					raise ValueError(f"""layer_type={layer_type} is not one of {','.join(self.layer_types				)}"""				)
				if global_padding is not None:
					if global_padding.upper() in self.supported_padding:
						snake_case_   		=			global_padding.upper()
					else:
						raise ValueError(f"""Padding strategy {global_padding} not supported"""				)
				snake_case_   		=			num_channels
				snake_case_   		=			embedding_size
				snake_case_   		=			hidden_sizes
				snake_case_   		=			depths
				snake_case_   		=			layer_type
				snake_case_   		=			hidden_act
				snake_case_   		=			global_padding
				snake_case_   		=			num_groups
				snake_case_   		=			drop_path_rate
				snake_case_   		=			embedding_dynamic_padding
				snake_case_   		=			output_stride
				snake_case_   		=			width_factor

				snake_case_   		=			['stem'] + [f"""stage{idx}""" for idx in range(1			,					len(__UpperCamelCase				) + 1				)]
				snake_case_		,							snake_case_   		=			get_aligned_output_features_output_indices(
				    out_features=__UpperCamelCase			,					out_indices=__UpperCamelCase			,					stage_names=self.stage_names				)
