





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


UpperCAmelCase_					:   Optional[int] 							=						logging.get_logger(__name__)

UpperCAmelCase_					:   Optional[Any] 							=						{
    """facebook/s2t-wav2vec2-large-en-de""": (
        """https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/config.json"""
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech2text2
}





class 							lowercase__    (							__A  ):
  __UpperCamelCase	     =  """speech_to_text_2"""
  __UpperCamelCase	     =  ["""past_key_values"""]
  __UpperCamelCase	     =  {"""num_attention_heads""": """decoder_attention_heads""", """hidden_size""": """d_model"""}







  def __init__(	self    ,						_lowercase=10_000    ,						_lowercase=6    ,						_lowercase=2_048    ,						_lowercase=4    ,						_lowercase=0.0    ,						_lowercase=True    ,						_lowercase="relu"    ,						_lowercase=256    ,						_lowercase=0.1    ,						_lowercase=0.0    ,						_lowercase=0.0    ,						_lowercase=0.02    ,						_lowercase=2    ,						_lowercase=True    ,						_lowercase=1    ,						_lowercase=0    ,						_lowercase=2    ,						_lowercase=1_024    ,						**_lowercase    ,						):
       lowerCAmelCase_					:       int    =		vocab_size
       lowerCAmelCase_					:       Optional[int]    =		d_model
       lowerCAmelCase_					:       str    =		decoder_ffn_dim
       lowerCAmelCase_					:       Any    =		decoder_layers
       lowerCAmelCase_					:       List[Any]    =		decoder_attention_heads
       lowerCAmelCase_					:       str    =		dropout
       lowerCAmelCase_					:       Dict    =		attention_dropout
       lowerCAmelCase_					:       List[str]    =		activation_dropout
       lowerCAmelCase_					:       Tuple    =		activation_function
       lowerCAmelCase_					:       Union[str, Any]    =		init_std
       lowerCAmelCase_					:       Any    =		decoder_layerdrop
       lowerCAmelCase_					:       Any    =		use_cache
       lowerCAmelCase_					:       Optional[Any]    =		decoder_layers
       lowerCAmelCase_					:       str    =		scale_embedding  # scale factor will be sqrt(d_model) if True
       lowerCAmelCase_					:       Optional[int]    =		max_target_positions

       super().__init__(
           pad_token_id=_lowercase    ,						bos_token_id=_lowercase    ,						eos_token_id=_lowercase    ,						decoder_start_token_id=_lowercase    ,						**_lowercase    ,						)







from collections import namedtuple

UpperCAmelCase_					:   Union[str, Any] 							=						namedtuple("""from_to""", """from_ to""")

UpperCAmelCase_					:   int 							=						{
    """cubicmeter""": from_to(1, 1),
    """litre""": from_to(0.0_01, 10_00),
    """kilolitre""": from_to(1, 1),
    """gallon""": from_to(0.0_04_54, 2_64.1_72),
    """cubicyard""": from_to(0.7_64_55, 1.3_07_95),
    """cubicfoot""": from_to(0.0_28, 35.31_47),
    """cup""": from_to(0.0_00_23_65_88, 42_26.75),
}






def 							_lowerCAmelCase (  _a   :					float					,   _a   :					str					,   _a   :					str			)	->			float:
     if from_type not in METRIC_CONVERSION:
          raise ValueError(
              F'Invalid \'from_type\' value: {from_type!r}  Supported values are:\n'
              + """, """.join(_a			)			)
     if to_type not in METRIC_CONVERSION:
          raise ValueError(
              F'Invalid \'to_type\' value: {to_type!r}.  Supported values are:\n'
              + """, """.join(_a			)			)
     return value * METRIC_CONVERSION[from_type].from_ * METRIC_CONVERSION[to_type].to


if __name__ == "__main__":
      import doctest

      doctest.testmod()
