

'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


_snake_case         =  logging.get_logger(__name__)

_snake_case         =  {}


class      a__  (							lowerCamelCase_  ):
   _SCREAMING_SNAKE_CASE   :					int     	=							'llama'
   _SCREAMING_SNAKE_CASE   :					Tuple     	=							['past_key_values']


   def __init__(			self      ,    _UpperCamelCase=32000      ,    _UpperCamelCase=4096      ,    _UpperCamelCase=11008      ,    _UpperCamelCase=32      ,    _UpperCamelCase=32      ,    _UpperCamelCase=None      ,    _UpperCamelCase="silu"      ,    _UpperCamelCase=2048      ,    _UpperCamelCase=0.0_2      ,    _UpperCamelCase=1E-6      ,    _UpperCamelCase=True      ,    _UpperCamelCase=0      ,    _UpperCamelCase=1      ,    _UpperCamelCase=2      ,    _UpperCamelCase=1      ,    _UpperCamelCase=False      ,    _UpperCamelCase=None      ,    **_UpperCamelCase      ,    ):





      """simple docstring"""





      _lowercase      :				Dict      					=       vocab_size
      _lowercase      :				str      					=       max_position_embeddings
      _lowercase      :				Union[str, Any]      					=       hidden_size
      _lowercase      :				Any      					=       intermediate_size
      _lowercase      :				Optional[Any]      					=       num_hidden_layers
      _lowercase      :				int      					=       num_attention_heads

      # for backward compatibility
      if num_key_value_heads is None:
         _lowercase      :				Dict      					=       num_attention_heads

      _lowercase      :				Optional[Any]      					=       num_key_value_heads
      _lowercase      :				Any      					=       hidden_act
      _lowercase      :				str      					=       initializer_range
      _lowercase      :				Optional[Any]      					=       rms_norm_eps
      _lowercase      :				Optional[int]      					=       pretraining_tp
      _lowercase      :				int      					=       use_cache
      _lowercase      :				List[Any]      					=       rope_scaling
      self._rope_scaling_validation()

      super().__init__(
          pad_token_id=_UpperCamelCase      ,    bos_token_id=_UpperCamelCase      ,    eos_token_id=_UpperCamelCase      ,    tie_word_embeddings=_UpperCamelCase      ,    **_UpperCamelCase      ,    )






   def 						_lowerCamelCase       (			self  ):





      """simple docstring"""





      if self.rope_scaling is None:
         return

      if not isinstance(self.rope_scaling      ,    _UpperCamelCase  ) or len(self.rope_scaling  ) != 2:
         raise ValueError(
             "`rope_scaling` must be a dictionary with with two fields, `name` and `factor`, "
             f'''got {self.rope_scaling}'''  )
      _lowercase      :				List[Any]      					=       self.rope_scaling.get("type"      ,    _UpperCamelCase  )
      _lowercase      :				Any      					=       self.rope_scaling.get("factor"      ,    _UpperCamelCase  )
      if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
         raise ValueError(
             f'''`rope_scaling`\'s name field must be one of [\'linear\', \'dynamic\'], got {rope_scaling_type}'''  )
      if rope_scaling_factor is None or not isinstance(_UpperCamelCase      ,    _UpperCamelCase  ) or rope_scaling_factor <= 1.0:
         raise ValueError(f'''`rope_scaling`\'s factor field must be an float > 1, got {rope_scaling_factor}'''  )









'''simple docstring'''
import logging

from transformers import PretrainedConfig


_snake_case         =  logging.getLogger(__name__)


_snake_case         =  {
    'bertabs-finetuned-cnndm': 'https://huggingface.co/remi/bertabs-finetuned-cnndm-extractive-abstractive-summarization/resolve/main/config.json',
}


class        a__  (							lowerCamelCase_  ):
   _SCREAMING_SNAKE_CASE   :					List[str]     	=							'bertabs'


   def __init__(			self      ,    _UpperCamelCase=30522      ,    _UpperCamelCase=512      ,    _UpperCamelCase=6      ,    _UpperCamelCase=512      ,    _UpperCamelCase=8      ,    _UpperCamelCase=512      ,    _UpperCamelCase=0.2      ,    _UpperCamelCase=6      ,    _UpperCamelCase=768      ,    _UpperCamelCase=8      ,    _UpperCamelCase=2048      ,    _UpperCamelCase=0.2      ,    **_UpperCamelCase      ,    ):





      """simple docstring"""





      super().__init__(**_UpperCamelCase  )

      _lowercase      :				List[str]      					=       vocab_size
      _lowercase      :				Tuple      					=       max_pos

      _lowercase      :				int      					=       enc_layers
      _lowercase      :				str      					=       enc_hidden_size
      _lowercase      :				Optional[Any]      					=       enc_heads
      _lowercase      :				Union[str, Any]      					=       enc_ff_size
      _lowercase      :				Tuple      					=       enc_dropout

      _lowercase      :				Dict      					=       dec_layers
      _lowercase      :				List[str]      					=       dec_hidden_size
      _lowercase      :				List[str]      					=       dec_heads
      _lowercase      :				str      					=       dec_ff_size
      _lowercase      :				str      					=       dec_dropout






