
"""simple docstring"""


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


_lowercase							      = logging.get_logger(__name__)

_lowercase							      = {
    '''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  lowerCAmelCase_ (					_lowercase			):



						'''simple docstring'''


						_lowerCamelCase:			Optional[Any]					=			'''speech_to_text'''
						_lowerCamelCase:			Union[str, Any]					=			['''past_key_values''']
						_lowerCamelCase:			Optional[Any]					=			{'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}


						def __init__(       self   :					Union[str, Any]     ,A_   :					Tuple=1_0000     ,A_   :					Union[str, Any]=12     ,A_   :					int=2048     ,A_   :					List[Any]=4     ,A_   :					int=6     ,A_   :					List[Any]=2048     ,A_   :					List[str]=4     ,A_   :					Optional[Any]=0.0     ,A_   :					str=0.0     ,A_   :					Dict=True     ,A_   :					List[Any]=True     ,A_   :					int="relu"     ,A_   :					List[str]=256     ,A_   :					Dict=0.1     ,A_   :					List[Any]=0.0     ,A_   :					List[Any]=0.0     ,A_   :					Union[str, Any]=0.02     ,A_   :					str=2     ,A_   :					Union[str, Any]=True     ,A_   :					List[str]=1     ,A_   :					Union[str, Any]=0     ,A_   :					int=2     ,A_   :					int=6000     ,A_   :					Dict=1024     ,A_   :					str=2     ,A_   :					Tuple=(5, 5)     ,A_   :					List[str]=1024     ,A_   :					str=80     ,A_   :					int=1     ,**A_   :					Union[str, Any]     ,)   ->      Optional[Any]:
							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(A_					)
							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=A_     ,bos_token_id=A_     ,eos_token_id=A_     ,is_encoder_decoder=A_     ,decoder_start_token_id=A_     ,**A_     ,)





from __future__ import annotations

import requests

def      A      (      _SCREAMING_SNAKE_CASE    )	-> dict:
       lowerCamelCase   :      Tuple			 =					f'''https://hacker-news.firebaseio.com/v0/item/{story_id}.json?print=pretty'''
       return requests.get(_SCREAMING_SNAKE_CASE    ).json()

def      A      (      _SCREAMING_SNAKE_CASE = 10    )	-> list[dict]:
       lowerCamelCase   :      str			 =					"https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
       lowerCamelCase   :      Any			 =					requests.get(_SCREAMING_SNAKE_CASE    ).json()[:max_stories]
       return [get_hackernews_story(_SCREAMING_SNAKE_CASE    ) for story_id in story_ids]

def      A      (      _SCREAMING_SNAKE_CASE = 10    )	-> str:
       lowerCamelCase   :      str			 =					hackernews_top_stories(_SCREAMING_SNAKE_CASE    )
       return "\n".join("* [{title}]({url})".format(**_SCREAMING_SNAKE_CASE    ) for story in stories    )


if __name__ == "__main__":
       print(hackernews_top_stories_as_markdown())






