






from ...configuration_utils import PretrainedConfig
from ...utils import logging


_UpperCamelCase			:	str								=logging.get_logger(__name__)

_UpperCamelCase			:	Union[str, Any]								={
    'facebook/s2t-small-librispeech-asr': (
        'https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/config.json'
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech_to_text
}






class 						UpperCAmelCase__ (							__snake_case							):
		__snake_case      :       Optional[Any]     =   "speech_to_text"
		__snake_case      :       Optional[Any]     =   ["past_key_values"]
		__snake_case      :       Union[str, Any]     =   {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}







		def __init__(					self       ,A__=10000       ,A__=12       ,A__=2048       ,A__=4       ,A__=6       ,A__=2048       ,A__=4       ,A__=0.0       ,A__=0.0       ,A__=True       ,A__=True       ,A__="relu"       ,A__=256       ,A__=0.1       ,A__=0.0       ,A__=0.0       ,A__=0.02       ,A__=2       ,A__=True       ,A__=1       ,A__=0       ,A__=2       ,A__=6000       ,A__=1024       ,A__=2       ,A__=(5, 5)       ,A__=1024       ,A__=80       ,A__=1       ,**A__       ,):
						_A	:				Tuple   =      vocab_size
						_A	:				List[str]   =      d_model
						_A	:				Tuple   =      encoder_ffn_dim
						_A	:				Union[str, Any]   =      encoder_layers
						_A	:				Any   =      encoder_attention_heads
						_A	:				Union[str, Any]   =      decoder_ffn_dim
						_A	:				List[str]   =      decoder_layers
						_A	:				List[Any]   =      decoder_attention_heads
						_A	:				List[str]   =      dropout
						_A	:				Dict   =      attention_dropout
						_A	:				Optional[Any]   =      activation_dropout
						_A	:				Union[str, Any]   =      activation_function
						_A	:				str   =      init_std
						_A	:				str   =      encoder_layerdrop
						_A	:				Any   =      decoder_layerdrop
						_A	:				List[Any]   =      use_cache
						_A	:				str   =      encoder_layers
						_A	:				List[str]   =      scale_embedding  # scale factor will be sqrt(d_model) if True
						_A	:				List[Any]   =      max_source_positions
						_A	:				Optional[int]   =      max_target_positions
						_A	:				Optional[Any]   =      num_conv_layers
						_A	:				Tuple   =      list(A__		)
						_A	:				Optional[int]   =      conv_channels
						_A	:				int   =      input_feat_per_channel
						_A	:				List[str]   =      input_channels

						if len(self.conv_kernel_sizes		) != self.num_conv_layers:
										raise ValueError(
										    '''Configuration for convolutional module is incorrect. '''
										    '''It is required that `len(config.conv_kernel_sizes)` == `config.num_conv_layers` '''
										    f"""but is `len(config.conv_kernel_sizes) = {len(self.conv_kernel_sizes		)}`, """
										    f"""`config.num_conv_layers = {self.num_conv_layers}`."""		)

						super().__init__(
						    pad_token_id=A__       ,bos_token_id=A__       ,eos_token_id=A__       ,is_encoder_decoder=A__       ,decoder_start_token_id=A__       ,**A__       ,)











from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_UpperCamelCase			:	Any								={
    'configuration_megatron_bert': ['MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MegatronBertConfig'],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_UpperCamelCase			:	Optional[Any]								=[
	    'MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'MegatronBertForCausalLM',
	    'MegatronBertForMaskedLM',
	    'MegatronBertForMultipleChoice',
	    'MegatronBertForNextSentencePrediction',
	    'MegatronBertForPreTraining',
	    'MegatronBertForQuestionAnswering',
	    'MegatronBertForSequenceClassification',
	    'MegatronBertForTokenClassification',
	    'MegatronBertModel',
	    'MegatronBertPreTrainedModel',
	]

if TYPE_CHECKING:
	from .configuration_megatron_bert import MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, MegatronBertConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_megatron_bert import (
		    MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    MegatronBertForCausalLM,
		    MegatronBertForMaskedLM,
		    MegatronBertForMultipleChoice,
		    MegatronBertForNextSentencePrediction,
		    MegatronBertForPreTraining,
		    MegatronBertForQuestionAnswering,
		    MegatronBertForSequenceClassification,
		    MegatronBertForTokenClassification,
		    MegatronBertModel,
		    MegatronBertPreTrainedModel,
		)

else:
	import sys

	_UpperCamelCase			:	Optional[int]								=_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



