



'''simple docstring'''





import importlib
import os
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, Optional, Union

import torch

from ..utils import BaseOutput


lowercase_	 =						"scheduler_config.json"






class __A    (						__lowerCAmelCase		):



	'''simple docstring'''







	__lowerCamelCase					: List[Any]    = 1
	__lowerCamelCase					: Any    = 2
	__lowerCamelCase					: int    = 3
	__lowerCamelCase					: Optional[int]    = 4
	__lowerCamelCase					: List[str]    = 5
	__lowerCamelCase					: Dict    = 6
	__lowerCamelCase					: Optional[Any]    = 7
	__lowerCamelCase					: int    = 8
	__lowerCamelCase					: List[Any]    = 9
	__lowerCamelCase					: str    = 10
	__lowerCamelCase					: str    = 11
	__lowerCamelCase					: Optional[Any]    = 12
	__lowerCamelCase					: List[Any]    = 13
	__lowerCamelCase					: List[str]    = 14






@dataclass
class __A    (						__lowerCAmelCase		):



	'''simple docstring'''







	__lowerCamelCase					: torch.FloatTensor






class __A    :



	'''simple docstring'''







	__lowerCamelCase					: Optional[int]    = SCHEDULER_CONFIG_NAME
	__lowerCamelCase					: List[str]    = []
	__lowerCamelCase					: Optional[int]    = True



	@classmethod
	def       a__						(cls				,     A = None				,     A = None				,     A=False				,     **A				,     )					->  List[str]:


						"""simple docstring"""



						_a						,					_a						,					_a											=						cls.load_config(
						    pretrained_model_name_or_path=lowerCAmelCase_				,     subfolder=lowerCAmelCase_				,     return_unused_kwargs=lowerCAmelCase_				,     return_commit_hash=lowerCAmelCase_				,     **lowerCAmelCase_				,     )
						return cls.from_config(lowerCAmelCase_				,     return_unused_kwargs=lowerCAmelCase_				,     **lowerCAmelCase_ )



	def       a__						(self				,     A				,     A = False				,     **A )					->  List[Any]:


						"""simple docstring"""



						self.save_config(save_directory=lowerCAmelCase_				,     push_to_hub=lowerCAmelCase_				,     **lowerCAmelCase_ )



	@property
	def       a__						(self )					->  List[str]:


						"""simple docstring"""



						return self._get_compatibles()



	@classmethod
	def       a__						(cls )					->  Tuple:


						"""simple docstring"""



						_a											=						list(set([cls.__name__] + cls._compatibles ) )
						_a											=						importlib.import_module(__name__.split('''.''' )[0] )
						_a											=						[
						    getattr(lowerCAmelCase_				,     lowerCAmelCase_ ) for c in compatible_classes_str if hasattr(lowerCAmelCase_				,     lowerCAmelCase_ )
						]
						return compatible_classes








'''simple docstring'''





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


lowercase_	 =						logging.get_logger(__name__)

lowercase_	 =						{
    "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		):



 '''simple docstring'''







 __lowerCamelCase					: Union[str, Any]    = 'pegasus'
 __lowerCamelCase					: Tuple    = ['past_key_values']
 __lowerCamelCase					: List[Any]    = {'num_attention_heads': 'encoder_attention_heads', 'hidden_size': 'd_model'}



 def __init__(self				,     A=50_265				,     A=1_024				,     A=12				,     A=4_096				,     A=16				,     A=12				,     A=4_096				,     A=16				,     A=0.0				,     A=0.0				,     A=True				,     A=True				,     A="gelu"				,     A=1_024				,     A=0.1				,     A=0.0				,     A=0.0				,     A=0.02				,     A=0				,     A=False				,     A=0				,     A=1				,     A=1				,     **A				,     )					->  str:


      """simple docstring"""



      _a											=						vocab_size
      _a											=						max_position_embeddings
      _a											=						d_model
      _a											=						encoder_ffn_dim
      _a											=						encoder_layers
      _a											=						encoder_attention_heads
      _a											=						decoder_ffn_dim
      _a											=						decoder_layers
      _a											=						decoder_attention_heads
      _a											=						dropout
      _a											=						attention_dropout
      _a											=						activation_dropout
      _a											=						activation_function
      _a											=						init_std
      _a											=						encoder_layerdrop
      _a											=						decoder_layerdrop
      _a											=						use_cache
      _a											=						encoder_layers
      _a											=						scale_embedding  # scale factor will be sqrt(d_model) if True
      super().__init__(
          pad_token_id=A				,     eos_token_id=A				,     is_encoder_decoder=A				,     decoder_start_token_id=A				,     forced_eos_token_id=A				,     **A				,     )



 @property
 def       a__						(self )					->  int:


      """simple docstring"""



      return self.encoder_attention_heads



 @property
 def       a__						(self )					->  int:


      """simple docstring"""



      return self.d_model



