


'''simple docstring'''







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


lowerCAmelCase     :  str											=    logging.get_logger(__name__)

lowerCAmelCase     :  Optional[int]											=    {
    """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 						UpperCamelCase__       (			SCREAMING_SNAKE_CASE_						):



     """simple docstring"""






     __magic_name__           =     "pegasus"
     __magic_name__           =     ["past_key_values"]
     __magic_name__           =     {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}







     def __init__(			self   ,						snake_case__=5_0265   ,						snake_case__=1024   ,						snake_case__=12   ,						snake_case__=4096   ,						snake_case__=16   ,						snake_case__=12   ,						snake_case__=4096   ,						snake_case__=16   ,						snake_case__=0.0   ,						snake_case__=0.0   ,						snake_case__=True   ,						snake_case__=True   ,						snake_case__="gelu"   ,						snake_case__=1024   ,						snake_case__=0.1   ,						snake_case__=0.0   ,						snake_case__=0.0   ,						snake_case__=0.02   ,						snake_case__=0   ,						snake_case__=False   ,						snake_case__=0   ,						snake_case__=1   ,						snake_case__=1   ,						**snake_case__   ,						):

            '''simple docstring'''

            _lowerCAmelCase     :				Any       =							vocab_size
            _lowerCAmelCase     :				str       =							max_position_embeddings
            _lowerCAmelCase     :				Union[str, Any]       =							d_model
            _lowerCAmelCase     :				Optional[int]       =							encoder_ffn_dim
            _lowerCAmelCase     :				Optional[int]       =							encoder_layers
            _lowerCAmelCase     :				Optional[Any]       =							encoder_attention_heads
            _lowerCAmelCase     :				List[Any]       =							decoder_ffn_dim
            _lowerCAmelCase     :				int       =							decoder_layers
            _lowerCAmelCase     :				Dict       =							decoder_attention_heads
            _lowerCAmelCase     :				Optional[Any]       =							dropout
            _lowerCAmelCase     :				int       =							attention_dropout
            _lowerCAmelCase     :				Tuple       =							activation_dropout
            _lowerCAmelCase     :				int       =							activation_function
            _lowerCAmelCase     :				Any       =							init_std
            _lowerCAmelCase     :				Optional[Any]       =							encoder_layerdrop
            _lowerCAmelCase     :				Union[str, Any]       =							decoder_layerdrop
            _lowerCAmelCase     :				Tuple       =							use_cache
            _lowerCAmelCase     :				List[Any]       =							encoder_layers
            _lowerCAmelCase     :				Union[str, Any]       =							scale_embedding  # scale factor will be sqrt(d_model) if True
            super().__init__(
                pad_token_id=snake_case__   ,						eos_token_id=snake_case__   ,						is_encoder_decoder=snake_case__   ,						decoder_start_token_id=snake_case__   ,						forced_eos_token_id=snake_case__   ,						**snake_case__   ,						)







     @property
     def a						(			self ):

            '''simple docstring'''

            return self.encoder_attention_heads







     @property
     def a						(			self ):

            '''simple docstring'''

            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,
)


lowerCAmelCase     :  List[str]											=    {
    """configuration_electra""": ["""ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP""", """ElectraConfig""", """ElectraOnnxConfig"""],
    """tokenization_electra""": ["""ElectraTokenizer"""],
}

try:
       if not is_tokenizers_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCAmelCase     :  Optional[Any]											=    ["""ElectraTokenizerFast"""]

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCAmelCase     :  str											=    [
           """ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """ElectraForCausalLM""",
           """ElectraForMaskedLM""",
           """ElectraForMultipleChoice""",
           """ElectraForPreTraining""",
           """ElectraForQuestionAnswering""",
           """ElectraForSequenceClassification""",
           """ElectraForTokenClassification""",
           """ElectraModel""",
           """ElectraPreTrainedModel""",
           """load_tf_weights_in_electra""",
       ]

try:
       if not is_tf_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCAmelCase     :  Tuple											=    [
           """TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """TFElectraForMaskedLM""",
           """TFElectraForMultipleChoice""",
           """TFElectraForPreTraining""",
           """TFElectraForQuestionAnswering""",
           """TFElectraForSequenceClassification""",
           """TFElectraForTokenClassification""",
           """TFElectraModel""",
           """TFElectraPreTrainedModel""",
       ]

try:
       if not is_flax_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCAmelCase     :  Union[str, Any]											=    [
           """FlaxElectraForCausalLM""",
           """FlaxElectraForMaskedLM""",
           """FlaxElectraForMultipleChoice""",
           """FlaxElectraForPreTraining""",
           """FlaxElectraForQuestionAnswering""",
           """FlaxElectraForSequenceClassification""",
           """FlaxElectraForTokenClassification""",
           """FlaxElectraModel""",
           """FlaxElectraPreTrainedModel""",
       ]


if TYPE_CHECKING:
       from .configuration_electra import ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP, ElectraConfig, ElectraOnnxConfig
       from .tokenization_electra import ElectraTokenizer

       try:
              if not is_tokenizers_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_electra_fast import ElectraTokenizerFast

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_electra import (
                  ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST,
                  ElectraForCausalLM,
                  ElectraForMaskedLM,
                  ElectraForMultipleChoice,
                  ElectraForPreTraining,
                  ElectraForQuestionAnswering,
                  ElectraForSequenceClassification,
                  ElectraForTokenClassification,
                  ElectraModel,
                  ElectraPreTrainedModel,
                  load_tf_weights_in_electra,
              )

       try:
              if not is_tf_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_tf_electra import (
                  TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST,
                  TFElectraForMaskedLM,
                  TFElectraForMultipleChoice,
                  TFElectraForPreTraining,
                  TFElectraForQuestionAnswering,
                  TFElectraForSequenceClassification,
                  TFElectraForTokenClassification,
                  TFElectraModel,
                  TFElectraPreTrainedModel,
              )

       try:
              if not is_flax_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_flax_electra import (
                  FlaxElectraForCausalLM,
                  FlaxElectraForMaskedLM,
                  FlaxElectraForMultipleChoice,
                  FlaxElectraForPreTraining,
                  FlaxElectraForQuestionAnswering,
                  FlaxElectraForSequenceClassification,
                  FlaxElectraForTokenClassification,
                  FlaxElectraModel,
                  FlaxElectraPreTrainedModel,
              )

else:
       import sys

       lowerCAmelCase     :  int											=    _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)

