


'''simple docstring'''






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


a_					:    Any          =    logging.get_logger(__name__)

a_					:    Optional[int]          =    {
    "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  a     (     _SCREAMING_SNAKE_CASE       ):
 _lowerCAmelCase 					=	"""speech_to_text"""
 _lowerCAmelCase 					=	["""past_key_values"""]
 _lowerCAmelCase 					=	{"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}
 def __init__( self      ,				__magic_name__=1_00_00      ,				__magic_name__=12      ,				__magic_name__=20_48      ,				__magic_name__=4      ,				__magic_name__=6      ,				__magic_name__=20_48      ,				__magic_name__=4      ,				__magic_name__=0.0      ,				__magic_name__=0.0      ,				__magic_name__=True      ,				__magic_name__=True      ,				__magic_name__="relu"      ,				__magic_name__=2_56      ,				__magic_name__=0.1      ,				__magic_name__=0.0      ,				__magic_name__=0.0      ,				__magic_name__=0.0_2      ,				__magic_name__=2      ,				__magic_name__=True      ,				__magic_name__=1      ,				__magic_name__=0      ,				__magic_name__=2      ,				__magic_name__=60_00      ,				__magic_name__=10_24      ,				__magic_name__=2      ,				__magic_name__=(5, 5)      ,				__magic_name__=10_24      ,				__magic_name__=80      ,				__magic_name__=1      ,				**__magic_name__      ,				)					->							List[str]:
      _a			      =							vocab_size
      _a			      =							d_model
      _a			      =							encoder_ffn_dim
      _a			      =							encoder_layers
      _a			      =							encoder_attention_heads
      _a			      =							decoder_ffn_dim
      _a			      =							decoder_layers
      _a			      =							decoder_attention_heads
      _a			      =							dropout
      _a			      =							attention_dropout
      _a			      =							activation_dropout
      _a			      =							activation_function
      _a			      =							init_std
      _a			      =							encoder_layerdrop
      _a			      =							decoder_layerdrop
      _a			      =							use_cache
      _a			      =							encoder_layers
      _a			      =							scale_embedding  # scale factor will be sqrt(d_model) if True
      _a			      =							max_source_positions
      _a			      =							max_target_positions
      _a			      =							num_conv_layers
      _a			      =							list(__magic_name__						)
      _a			      =							conv_channels
      _a			      =							input_feat_per_channel
      _a			      =							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=__magic_name__      ,				bos_token_id=__magic_name__      ,				eos_token_id=__magic_name__      ,				is_encoder_decoder=__magic_name__      ,				decoder_start_token_id=__magic_name__      ,				**__magic_name__      ,				)





'''simple docstring'''






import pytest

from datasets.splits import SplitDict, SplitInfo
from datasets.utils.py_utils import asdict






@pytest.mark.parametrize(
    'split_dict'				,						[
        SplitDict(),
        SplitDict({'train': SplitInfo(name='train'				,						num_bytes=13_37				,						num_examples=42				,						dataset_name='my_dataset'		)}		),
        SplitDict({'train': SplitInfo(name='train'				,						num_bytes=13_37				,						num_examples=42		)}		),
        SplitDict({'train': SplitInfo()}		),
    ]				,						)
def 	_A				(lowerCAmelCase__  :SplitDict		)   ->  Any:




     '''simple docstring'''



     _a			      =							split_dict._to_yaml_list()
     assert len(lowerCAmelCase__		) == len(lowerCAmelCase__		)
     _a			      =							SplitDict._from_yaml_list(lowerCAmelCase__		)
     for split_name, split_info in split_dict.items():
          # dataset_name field is deprecated, and is therefore not part of the YAML dump
          _a			      =							None
          # the split name of split_dict takes over the name of the split info object
          _a			      =							split_name
     assert split_dict == reloaded






@pytest.mark.parametrize(
    'split_info'				,						[SplitInfo(), SplitInfo(dataset_name=lowerCAmelCase__		), SplitInfo(dataset_name='my_dataset'		)]		)
def 	_A				(lowerCAmelCase__  :Optional[Any]		)   ->  List[str]:




     '''simple docstring'''



     _a			      =							asdict(SplitDict({'train': split_info}		)		)
     assert "dataset_name" in split_dict_asdict["train"]
     assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name

