

'''simple docstring'''




from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfigWithPast
from ...utils import logging


_a			:	Optional[Any]								=  logging.get_logger(__name__)

_a			:	Tuple								=  {
    'uclanlp/plbart-base': 'https://huggingface.co/uclanlp/plbart-base/resolve/main/config.json',
    # See all PLBART models at https://huggingface.co/models?filter=plbart
}



class     lowercase_		(						a	):

		'''simple docstring'''





		__lowerCAmelCase   :	Optional[Any]      					=				"plbart"
		__lowerCAmelCase   :	Any      					=				["past_key_values"]
		__lowerCAmelCase   :	Dict      					=				{"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}
		def __init__(       self				,	a_=5_0_0_0_5				,	a_=1_0_2_4				,	a_=6				,	a_=3_0_7_2				,	a_=1_2				,	a_=6				,	a_=3_0_7_2				,	a_=1_2				,	a_=0.0				,	a_=0.0				,	a_=True				,	a_=True				,	a_="gelu"				,	a_=7_6_8				,	a_=0.1				,	a_=0.1				,	a_=0.0				,	a_=0.02				,	a_=0.0				,	a_=True				,	a_=1				,	a_=0				,	a_=2				,	a_=2				,	**a_				,	)							->			Union[str, Any]:


				"""simple docstring"""
				UpperCAmelCase  							=		vocab_size
				UpperCAmelCase  							=		max_position_embeddings
				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  							=		classifier_dropout
				UpperCAmelCase  							=		use_cache
				UpperCAmelCase  							=		encoder_layers
				UpperCAmelCase  							=		scale_embedding  # scale factor will be sqrt(d_model) if True
				super().__init__(
				    pad_token_id=a_				,	bos_token_id=a_				,	eos_token_id=a_				,	is_encoder_decoder=a_				,	forced_eos_token_id=a_				,	**a_				,	)




class     lowercase_		(						a	):

		'''simple docstring'''





		@property
		def   snake_case_     (       self       )							->			Mapping[str, Mapping[int, str]]:


				"""simple docstring"""
				return OrderedDict(
				    [
				        ('input_ids', {0: 'batch', 1: 'sequence'}),
				        ('attention_mask', {0: 'batch', 1: 'sequence'}),
				    ]       )





		@property
		def   snake_case_     (       self       )							->			Mapping[str, Mapping[int, str]]:


				"""simple docstring"""
				if self.use_past:
						return OrderedDict(
						    [
						        ('last_hidden_state', {0: 'batch', 1: 'sequence'}),
						        ('past_keys', {0: 'batch', 2: 'sequence'}),
						        ('encoder_last_hidden_state', {0: 'batch', 1: 'sequence'}),
						    ]       )
				else:
						return OrderedDict(
						    [
						        ('last_hidden_state', {0: 'batch', 1: 'sequence'}),
						        ('encoder_last_hidden_state', {0: 'batch', 1: 'sequence'}),
						    ]       )





'''simple docstring'''




from collections import namedtuple

_a			:	int								=  namedtuple('from_to', 'from_ to')

_a			:	Dict								=  {
    'atm': from_to(1, 1),
    'pascal': from_to(0.0000098, 101_325),
    'bar': from_to(0.986923, 1.01325),
    'kilopascal': from_to(0.00986923, 101.325),
    'megapascal': from_to(9.86923, 0.101325),
    'psi': from_to(0.068046, 14.6959),
    'inHg': from_to(0.0334211, 29.9213),
    'torr': from_to(0.00131579, 760),
}


def  lowerCamelCase__						(  SCREAMING_SNAKE_CASE :				float    ,				SCREAMING_SNAKE_CASE :				str    ,				SCREAMING_SNAKE_CASE :				str  ):
  if from_type not in PRESSURE_CONVERSION:
    raise ValueError(
        f'''Invalid \'from_type\' value: {from_type!r}  Supported values are:\n'''
        + ', '.join(SCREAMING_SNAKE_CASE  )  )
  if to_type not in PRESSURE_CONVERSION:
    raise ValueError(
        f'''Invalid \'to_type\' value: {to_type!r}.  Supported values are:\n'''
        + ', '.join(SCREAMING_SNAKE_CASE  )  )
  return (
      value * PRESSURE_CONVERSION[from_type].from_ * PRESSURE_CONVERSION[to_type].to
  )


if __name__ == "__main__":
  import doctest

  doctest.testmod()


