


'''simple docstring'''



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


_lowercase    :    Union[str, Any]			     =  logging.get_logger(__name__)

_lowercase    :    Tuple			     =  {
    """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__(     lowerCAmelCase ):
				__magic_name__       :   List[Any]							= "speech_to_text"
				__magic_name__       :   int							= ["past_key_values"]
				__magic_name__       :   Optional[int]							= {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}




				def __init__(	self    :				int   ,					lowerCAmelCase    :				int=10000   ,					lowerCAmelCase    :				List[str]=12   ,					lowerCAmelCase    :				Optional[int]=2048   ,					lowerCAmelCase    :				List[Any]=4   ,					lowerCAmelCase    :				Optional[Any]=6   ,					lowerCAmelCase    :				List[str]=2048   ,					lowerCAmelCase    :				str=4   ,					lowerCAmelCase    :				Dict=0.0   ,					lowerCAmelCase    :				List[Any]=0.0   ,					lowerCAmelCase    :				Optional[int]=True   ,					lowerCAmelCase    :				str=True   ,					lowerCAmelCase    :				Optional[Any]="relu"   ,					lowerCAmelCase    :				Optional[Any]=256   ,					lowerCAmelCase    :				Union[str, Any]=0.1   ,					lowerCAmelCase    :				str=0.0   ,					lowerCAmelCase    :				Dict=0.0   ,					lowerCAmelCase    :				Tuple=0.02   ,					lowerCAmelCase    :				Dict=2   ,					lowerCAmelCase    :				int=True   ,					lowerCAmelCase    :				Optional[Any]=1   ,					lowerCAmelCase    :				int=0   ,					lowerCAmelCase    :				Dict=2   ,					lowerCAmelCase    :				Dict=6000   ,					lowerCAmelCase    :				Optional[int]=1024   ,					lowerCAmelCase    :				Any=2   ,					lowerCAmelCase    :				int=(5, 5)   ,					lowerCAmelCase    :				Dict=1024   ,					lowerCAmelCase    :				List[str]=80   ,					lowerCAmelCase    :				List[str]=1   ,					**lowerCAmelCase    :				Any   ,					)->  List[Any]:

										"""simple docstring"""




										UpperCAmelCase         =			vocab_size
										UpperCAmelCase         =			d_model
										UpperCAmelCase         =			encoder_ffn_dim
										UpperCAmelCase         =			encoder_layers
										UpperCAmelCase         =			encoder_attention_heads
										UpperCAmelCase         =			decoder_ffn_dim
										UpperCAmelCase         =			decoder_layers
										UpperCAmelCase         =			decoder_attention_heads
										UpperCAmelCase         =			dropout
										UpperCAmelCase         =			attention_dropout
										UpperCAmelCase         =			activation_dropout
										UpperCAmelCase         =			activation_function
										UpperCAmelCase         =			init_std
										UpperCAmelCase         =			encoder_layerdrop
										UpperCAmelCase         =			decoder_layerdrop
										UpperCAmelCase         =			use_cache
										UpperCAmelCase         =			encoder_layers
										UpperCAmelCase         =			scale_embedding  # scale factor will be sqrt(d_model) if True
										UpperCAmelCase         =			max_source_positions
										UpperCAmelCase         =			max_target_positions
										UpperCAmelCase         =			num_conv_layers
										UpperCAmelCase         =			list(lowerCAmelCase   )
										UpperCAmelCase         =			conv_channels
										UpperCAmelCase         =			input_feat_per_channel
										UpperCAmelCase         =			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=lowerCAmelCase   ,					bos_token_id=lowerCAmelCase   ,					eos_token_id=lowerCAmelCase   ,					is_encoder_decoder=lowerCAmelCase   ,					decoder_start_token_id=lowerCAmelCase   ,					**lowerCAmelCase   ,					)







'''simple docstring'''



# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowercase    :    int			     =  {
    """configuration_xmod""": [
        """XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """XmodConfig""",
        """XmodOnnxConfig""",
    ],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_lowercase    :    str			     =  [
	    """XMOD_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """XmodForCausalLM""",
	    """XmodForMaskedLM""",
	    """XmodForMultipleChoice""",
	    """XmodForQuestionAnswering""",
	    """XmodForSequenceClassification""",
	    """XmodForTokenClassification""",
	    """XmodModel""",
	    """XmodPreTrainedModel""",
	]

if TYPE_CHECKING:
	from .configuration_xmod import XMOD_PRETRAINED_CONFIG_ARCHIVE_MAP, XmodConfig, XmodOnnxConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_xmod import (
		    XMOD_PRETRAINED_MODEL_ARCHIVE_LIST,
		    XmodForCausalLM,
		    XmodForMaskedLM,
		    XmodForMultipleChoice,
		    XmodForQuestionAnswering,
		    XmodForSequenceClassification,
		    XmodForTokenClassification,
		    XmodModel,
		    XmodPreTrainedModel,
		)

else:
	import sys

	_lowercase    :    List[Any]			     =  _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)





