






'''simple docstring'''


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


lowerCamelCase_				: Dict    	=							logging.get_logger(__name__)

lowerCamelCase_				: 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    _SCREAMING_SNAKE_CASE							(		SCREAMING_SNAKE_CASE	):


			'''simple docstring'''





			__a							:							Tuple					     =					"speech_to_text"
			__a							:							Union[str, Any]					     =					["past_key_values"]
			__a							:							Union[str, Any]					     =					{"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}






			def __init__(   self							:						int ,      lowercase							:						int=1_0_0_0_0 ,      lowercase							:						List[Any]=1_2 ,      lowercase							:						Dict=2_0_4_8 ,      lowercase							:						Dict=4 ,      lowercase							:						Any=6 ,      lowercase							:						Optional[Any]=2_0_4_8 ,      lowercase							:						List[Any]=4 ,      lowercase							:						List[Any]=0.0 ,      lowercase							:						Dict=0.0 ,      lowercase							:						str=True ,      lowercase							:						Optional[int]=True ,      lowercase							:						List[str]="relu" ,      lowercase							:						Tuple=2_5_6 ,      lowercase							:						Any=0.1 ,      lowercase							:						Tuple=0.0 ,      lowercase							:						Union[str, Any]=0.0 ,      lowercase							:						Dict=0.0_2 ,      lowercase							:						Union[str, Any]=2 ,      lowercase							:						Any=True ,      lowercase							:						List[str]=1 ,      lowercase							:						Union[str, Any]=0 ,      lowercase							:						List[Any]=2 ,      lowercase							:						int=6_0_0_0 ,      lowercase							:						List[str]=1_0_2_4 ,      lowercase							:						Optional[int]=2 ,      lowercase							:						Optional[int]=(5, 5) ,      lowercase							:						Optional[int]=1_0_2_4 ,      lowercase							:						Any=8_0 ,      lowercase							:						Dict=1 ,      **lowercase							:						Union[str, Any] ,      )							->    str:

									'''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(lowercase			)
									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=lowercase ,      bos_token_id=lowercase ,      eos_token_id=lowercase ,      is_encoder_decoder=lowercase ,      decoder_start_token_id=lowercase ,      **lowercase ,      )








'''simple docstring'''


from typing import Optional

import pyspark

from .. import Features, NamedSplit
from ..download import DownloadMode
from ..packaged_modules.spark.spark import Spark
from .abc import AbstractDatasetReader
class    _SCREAMING_SNAKE_CASE							(		SCREAMING_SNAKE_CASE	):


			'''simple docstring'''





			def __init__(   self							:						Tuple ,      lowercase							:						pyspark.sql.DataFrame ,      lowercase							:						Optional[NamedSplit] = None ,      lowercase							:						Optional[Features] = None ,      lowercase							:						bool = True ,      lowercase							:						str = None ,      lowercase							:						bool = False ,      lowercase							:						str = None ,      lowercase							:						bool = True ,      lowercase							:						str = "arrow" ,      **lowercase							:						Any ,      )							->    Optional[int]:

									'''simple docstring'''







									super().__init__(
									    split=lowercase ,      features=lowercase ,      cache_dir=lowercase ,      keep_in_memory=lowercase ,      streaming=lowercase ,      **lowercase ,      )
									UpperCamelCase__         = load_from_cache_file
									UpperCamelCase__         = file_format
									UpperCamelCase__         = Spark(
									    df=lowercase ,      features=lowercase ,      cache_dir=lowercase ,      working_dir=lowercase ,      **lowercase ,      )







			def 				A      (   self							:						int			)							->    Any:

									'''simple docstring'''







									if self.streaming:
															return self.builder.as_streaming_dataset(split=self.split			)
									UpperCamelCase__         = None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
									self.builder.download_and_prepare(
									    download_mode=lowercase ,      file_format=self._file_format ,      )
									return self.builder.as_dataset(split=self.split			)
