






"""simple docstring"""



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


_UpperCamelCase		:  str						=		logging.get_logger(__name__)

_UpperCamelCase		:  Any						=		{
    'google/pegasus-large': 'https://huggingface.co/google/pegasus-large/resolve/main/config.json',
    # See all PEGASUS models at https://huggingface.co/models?filter=pegasus
}

class        a     (   a_	):
    UpperCAmelCase_ :     str	     ="pegasus"
    UpperCAmelCase_ :     Optional[int]	     =["past_key_values"]
    UpperCAmelCase_ :     Any	     ={"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}







    def __init__(			self							,		_lowerCamelCase=5_0_2_6_5							,		_lowerCamelCase=1_0_2_4							,		_lowerCamelCase=1_2							,		_lowerCamelCase=4_0_9_6							,		_lowerCamelCase=1_6							,		_lowerCamelCase=1_2							,		_lowerCamelCase=4_0_9_6							,		_lowerCamelCase=1_6							,		_lowerCamelCase=0.0							,		_lowerCamelCase=0.0							,		_lowerCamelCase=True							,		_lowerCamelCase=True							,		_lowerCamelCase="gelu"							,		_lowerCamelCase=1_0_2_4							,		_lowerCamelCase=0.1							,		_lowerCamelCase=0.0							,		_lowerCamelCase=0.0							,		_lowerCamelCase=0.0_2							,		_lowerCamelCase=0							,		_lowerCamelCase=False							,		_lowerCamelCase=0							,		_lowerCamelCase=1							,		_lowerCamelCase=1							,		**_lowerCamelCase							,		):
      lowercase							    =       vocab_size
      lowercase							    =       max_position_embeddings
      lowercase							    =       d_model
      lowercase							    =       encoder_ffn_dim
      lowercase							    =       encoder_layers
      lowercase							    =       encoder_attention_heads
      lowercase							    =       decoder_ffn_dim
      lowercase							    =       decoder_layers
      lowercase							    =       decoder_attention_heads
      lowercase							    =       dropout
      lowercase							    =       attention_dropout
      lowercase							    =       activation_dropout
      lowercase							    =       activation_function
      lowercase							    =       init_std
      lowercase							    =       encoder_layerdrop
      lowercase							    =       decoder_layerdrop
      lowercase							    =       use_cache
      lowercase							    =       encoder_layers
      lowercase							    =       scale_embedding  # scale factor will be sqrt(d_model) if True
      super().__init__(
          pad_token_id=_lowerCamelCase							,		eos_token_id=_lowerCamelCase							,		is_encoder_decoder=_lowerCamelCase							,		decoder_start_token_id=_lowerCamelCase							,		forced_eos_token_id=_lowerCamelCase							,		**_lowerCamelCase							,		)







    @property
    def 			UpperCamelCase_      (			self       ):
      return self.encoder_attention_heads







    @property
    def 			UpperCamelCase_      (			self       ):
      return self.d_model










"""simple docstring"""



from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_UpperCamelCase		:  Dict						=		{
    'configuration_roberta': ['ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP', 'RobertaConfig', 'RobertaOnnxConfig'],
    'tokenization_roberta': ['RobertaTokenizer'],
}

try:
    if not is_tokenizers_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    _UpperCamelCase		:  str						=		['RobertaTokenizerFast']

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    _UpperCamelCase		:  Tuple						=		[
        'ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST',
        'RobertaForCausalLM',
        'RobertaForMaskedLM',
        'RobertaForMultipleChoice',
        'RobertaForQuestionAnswering',
        'RobertaForSequenceClassification',
        'RobertaForTokenClassification',
        'RobertaModel',
        'RobertaPreTrainedModel',
    ]

try:
    if not is_tf_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    _UpperCamelCase		:  List[Any]						=		[
        'TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST',
        'TFRobertaForCausalLM',
        'TFRobertaForMaskedLM',
        'TFRobertaForMultipleChoice',
        'TFRobertaForQuestionAnswering',
        'TFRobertaForSequenceClassification',
        'TFRobertaForTokenClassification',
        'TFRobertaMainLayer',
        'TFRobertaModel',
        'TFRobertaPreTrainedModel',
    ]

try:
    if not is_flax_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    _UpperCamelCase		:  Optional[int]						=		[
        'FlaxRobertaForCausalLM',
        'FlaxRobertaForMaskedLM',
        'FlaxRobertaForMultipleChoice',
        'FlaxRobertaForQuestionAnswering',
        'FlaxRobertaForSequenceClassification',
        'FlaxRobertaForTokenClassification',
        'FlaxRobertaModel',
        'FlaxRobertaPreTrainedModel',
    ]


if TYPE_CHECKING:
    from .configuration_roberta import ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, RobertaConfig, RobertaOnnxConfig
    from .tokenization_roberta import RobertaTokenizer

    try:
        if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .tokenization_roberta_fast import RobertaTokenizerFast

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_roberta import (
            ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
            RobertaForCausalLM,
            RobertaForMaskedLM,
            RobertaForMultipleChoice,
            RobertaForQuestionAnswering,
            RobertaForSequenceClassification,
            RobertaForTokenClassification,
            RobertaModel,
            RobertaPreTrainedModel,
        )

    try:
        if not is_tf_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_tf_roberta import (
            TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
            TFRobertaForCausalLM,
            TFRobertaForMaskedLM,
            TFRobertaForMultipleChoice,
            TFRobertaForQuestionAnswering,
            TFRobertaForSequenceClassification,
            TFRobertaForTokenClassification,
            TFRobertaMainLayer,
            TFRobertaModel,
            TFRobertaPreTrainedModel,
        )

    try:
        if not is_flax_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_flax_roberta import (
            FlaxRobertaForCausalLM,
            FlaxRobertaForMaskedLM,
            FlaxRobertaForMultipleChoice,
            FlaxRobertaForQuestionAnswering,
            FlaxRobertaForSequenceClassification,
            FlaxRobertaForTokenClassification,
            FlaxRobertaModel,
            FlaxRobertaPreTrainedModel,
        )

else:
    import sys

    _UpperCamelCase		:  Optional[Any]						=		_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


