




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


_lowerCAmelCase  :      Union[str, Any]						=      logging.get_logger(__name__)

_lowerCAmelCase  :      Tuple						=      {
    '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					( _A						):
      UpperCAmelCase_						=						"""pegasus"""
      UpperCAmelCase_						=						["""past_key_values"""]
      UpperCAmelCase_						=						{"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}
      def __init__(	self      :Optional[int]       ,					lowerCamelCase      :Optional[int]=5_0265       ,					lowerCamelCase      :Optional[int]=1024       ,					lowerCamelCase      :Any=12       ,					lowerCamelCase      :Union[str, Any]=4096       ,					lowerCamelCase      :Any=16       ,					lowerCamelCase      :Union[str, Any]=12       ,					lowerCamelCase      :List[str]=4096       ,					lowerCamelCase      :Tuple=16       ,					lowerCamelCase      :Optional[int]=0.0       ,					lowerCamelCase      :List[Any]=0.0       ,					lowerCamelCase      :List[str]=True       ,					lowerCamelCase      :List[Any]=True       ,					lowerCamelCase      :List[Any]="gelu"       ,					lowerCamelCase      :List[Any]=1024       ,					lowerCamelCase      :Optional[Any]=0.1       ,					lowerCamelCase      :str=0.0       ,					lowerCamelCase      :Any=0.0       ,					lowerCamelCase      :Union[str, Any]=0.02       ,					lowerCamelCase      :Any=0       ,					lowerCamelCase      :int=False       ,					lowerCamelCase      :Any=0       ,					lowerCamelCase      :List[str]=1       ,					lowerCamelCase      :Tuple=1       ,					**lowerCamelCase      :Union[str, Any]       ,					)   ->	str:
       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__							       =  use_cache
       UpperCAmelCase__							       =  encoder_layers
       UpperCAmelCase__							       =  scale_embedding  # scale factor will be sqrt(d_model) if True
       super().__init__(
           pad_token_id=UpperCamelCase__       ,					eos_token_id=UpperCamelCase__       ,					is_encoder_decoder=UpperCamelCase__       ,					decoder_start_token_id=UpperCamelCase__       ,					forced_eos_token_id=UpperCamelCase__       ,					**UpperCamelCase__       ,					)
      @property
      def 		UpperCAmelCase_  (	self      :List[Any]					)   ->	int:
       return self.encoder_attention_heads







      @property
      def 		UpperCAmelCase_  (	self      :Dict					)   ->	int:
       return self.d_model







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


__lowerCAmelCase			:     List[str]           =   {
    'configuration_xlm': ['XLM_PRETRAINED_CONFIG_ARCHIVE_MAP', 'XLMConfig', 'XLMOnnxConfig'],
    'tokenization_xlm': ['XLMTokenizer'],
}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __lowerCAmelCase			:     str           =   [
        'XLM_PRETRAINED_MODEL_ARCHIVE_LIST',
        'XLMForMultipleChoice',
        'XLMForQuestionAnswering',
        'XLMForQuestionAnsweringSimple',
        'XLMForSequenceClassification',
        'XLMForTokenClassification',
        'XLMModel',
        'XLMPreTrainedModel',
        'XLMWithLMHeadModel',
    ]

try:
    if not is_tf_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __lowerCAmelCase			:     Dict           =   [
        'TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST',
        'TFXLMForMultipleChoice',
        'TFXLMForQuestionAnsweringSimple',
        'TFXLMForSequenceClassification',
        'TFXLMForTokenClassification',
        'TFXLMMainLayer',
        'TFXLMModel',
        'TFXLMPreTrainedModel',
        'TFXLMWithLMHeadModel',
    ]


if TYPE_CHECKING:
    from .configuration_xlm import XLM_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMConfig, XLMOnnxConfig
    from .tokenization_xlm import XLMTokenizer

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_xlm import (
            XLM_PRETRAINED_MODEL_ARCHIVE_LIST,
            XLMForMultipleChoice,
            XLMForQuestionAnswering,
            XLMForQuestionAnsweringSimple,
            XLMForSequenceClassification,
            XLMForTokenClassification,
            XLMModel,
            XLMPreTrainedModel,
            XLMWithLMHeadModel,
        )

    try:
        if not is_tf_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_tf_xlm import (
            TF_XLM_PRETRAINED_MODEL_ARCHIVE_LIST,
            TFXLMForMultipleChoice,
            TFXLMForQuestionAnsweringSimple,
            TFXLMForSequenceClassification,
            TFXLMForTokenClassification,
            TFXLMMainLayer,
            TFXLMModel,
            TFXLMPreTrainedModel,
            TFXLMWithLMHeadModel,
        )

else:
    import sys

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

