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


_lowerCamelCase					:   str							=		logging.get_logger(__name__)

_lowerCamelCase					:   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 						lowercase    (     a     ):
							lowercase__						:       Any								=							"""speech_to_text"""
							lowercase__						:       Tuple								=							["""past_key_values"""]
							lowercase__						:       Union[str, Any]								=							{"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}




							def __init__(						self   :					str	,							_UpperCamelCase   :					Tuple=10_000	,							_UpperCamelCase   :					Any=12	,							_UpperCamelCase   :					Dict=2_048	,							_UpperCamelCase   :					Optional[Any]=4	,							_UpperCamelCase   :					Any=6	,							_UpperCamelCase   :					Optional[Any]=2_048	,							_UpperCamelCase   :					List[str]=4	,							_UpperCamelCase   :					Optional[Any]=0.0	,							_UpperCamelCase   :					List[Any]=0.0	,							_UpperCamelCase   :					Union[str, Any]=True	,							_UpperCamelCase   :					int=True	,							_UpperCamelCase   :					List[Any]="relu"	,							_UpperCamelCase   :					List[str]=256	,							_UpperCamelCase   :					List[Any]=0.1	,							_UpperCamelCase   :					Dict=0.0	,							_UpperCamelCase   :					str=0.0	,							_UpperCamelCase   :					List[str]=0.0_2	,							_UpperCamelCase   :					Any=2	,							_UpperCamelCase   :					List[str]=True	,							_UpperCamelCase   :					List[str]=1	,							_UpperCamelCase   :					List[str]=0	,							_UpperCamelCase   :					Optional[Any]=2	,							_UpperCamelCase   :					Optional[int]=6_000	,							_UpperCamelCase   :					Dict=1_024	,							_UpperCamelCase   :					Dict=2	,							_UpperCamelCase   :					List[Any]=(5, 5)	,							_UpperCamelCase   :					str=1_024	,							_UpperCamelCase   :					Dict=80	,							_UpperCamelCase   :					int=1	,							**_UpperCamelCase   :					Tuple	,							)					->				Optional[Any]:



												'''simple docstring'''

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





# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team.
#
# 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.

# this script dumps information about the environment

import os
import platform
import sys


_lowerCamelCase					:   List[Any]							=		'''3'''

print('''Python version:''', sys.version)

print('''OS platform:''', platform.platform())
print('''OS architecture:''', platform.machine())

try:
							import torch

							print('''Torch version:''', torch.__version__)
							print('''Cuda available:''', torch.cuda.is_available())
							print('''Cuda version:''', torch.version.cuda)
							print('''CuDNN version:''', torch.backends.cudnn.version())
							print('''Number of GPUs available:''', torch.cuda.device_count())
except ImportError:
							print('''Torch version:''', None)

try:
							import transformers

							print('''transformers version:''', transformers.__version__)
except ImportError:
							print('''transformers version:''', None)




