




'''simple docstring'''



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


lowerCamelCase_			=						logging.get_logger(__name__)

lowerCamelCase_			=						{
    'tiiuae/falcon-40b': 'https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json',
    'tiiuae/falcon-7b': 'https://huggingface.co/tiiuae/falcon-7b/resolve/main/config.json',
}







class 		lowercase_   (			A       ):


   """simple docstring"""

   lowerCamelCase_      =						'''falcon'''
   lowerCamelCase_      =						['''past_key_values''']



   def __init__(   self :     str  ,				__lowerCamelCase :     Union[str, Any]=6_5_0_2_4  ,				__lowerCamelCase :     Optional[Any]=4_5_4_4  ,				__lowerCamelCase :     List[Any]=3_2  ,				__lowerCamelCase :     str=7_1  ,				__lowerCamelCase :     List[str]=1e-5  ,				__lowerCamelCase :     List[str]=0.0_2  ,				__lowerCamelCase :     Any=True  ,				__lowerCamelCase :     Any=0.0  ,				__lowerCamelCase :     List[Any]=0.0  ,				__lowerCamelCase :     str=None  ,				__lowerCamelCase :     Union[str, Any]=False  ,				__lowerCamelCase :     int=False  ,				__lowerCamelCase :     List[str]=True  ,				__lowerCamelCase :     List[Any]=True  ,				__lowerCamelCase :     Union[str, Any]=False  ,				__lowerCamelCase :     Any=1_1  ,				__lowerCamelCase :     Any=1_1  ,				**__lowerCamelCase :     List[Any]  ,				):

      """simple docstring"""
      _SCREAMING_SNAKE_CASE	=				vocab_size
      # Backward compatibility with n_embed kwarg
      _SCREAMING_SNAKE_CASE	=				kwargs.pop("n_embed"  ,				__lowerCamelCase   )
      _SCREAMING_SNAKE_CASE	=				hidden_size if n_embed is None else n_embed
      _SCREAMING_SNAKE_CASE	=				num_hidden_layers
      _SCREAMING_SNAKE_CASE	=				num_attention_heads
      _SCREAMING_SNAKE_CASE	=				layer_norm_epsilon
      _SCREAMING_SNAKE_CASE	=				initializer_range
      _SCREAMING_SNAKE_CASE	=				use_cache
      _SCREAMING_SNAKE_CASE	=				hidden_dropout
      _SCREAMING_SNAKE_CASE	=				attention_dropout

      _SCREAMING_SNAKE_CASE	=				bos_token_id
      _SCREAMING_SNAKE_CASE	=				eos_token_id
      _SCREAMING_SNAKE_CASE	=				num_attention_heads if num_kv_heads is None else num_kv_heads
      _SCREAMING_SNAKE_CASE	=				alibi
      _SCREAMING_SNAKE_CASE	=				new_decoder_architecture
      _SCREAMING_SNAKE_CASE	=				multi_query  # Ignored when new_decoder_architecture is True
      _SCREAMING_SNAKE_CASE	=				parallel_attn
      _SCREAMING_SNAKE_CASE	=				bias

      super().__init__(bos_token_id=__lowerCamelCase  ,				eos_token_id=__lowerCamelCase  ,				**__lowerCamelCase   )



   @property
   def 							lowerCAmelCase_      (   self :     List[Any]   ):

      """simple docstring"""
      return self.hidden_size // self.num_attention_heads



   @property
   def 							lowerCAmelCase_      (   self :     Dict   ):

      """simple docstring"""
      return not self.alibi







'''simple docstring'''



from typing import TYPE_CHECKING

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


lowerCamelCase_			=						{
    'configuration_ctrl': ['CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP', 'CTRLConfig'],
    'tokenization_ctrl': ['CTRLTokenizer'],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCamelCase_			=						[
     'CTRL_PRETRAINED_MODEL_ARCHIVE_LIST',
     'CTRLForSequenceClassification',
     'CTRLLMHeadModel',
     'CTRLModel',
     'CTRLPreTrainedModel',
 ]

try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCamelCase_			=						[
     'TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST',
     'TFCTRLForSequenceClassification',
     'TFCTRLLMHeadModel',
     'TFCTRLModel',
     'TFCTRLPreTrainedModel',
 ]


if TYPE_CHECKING:
 from .configuration_ctrl import CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP, CTRLConfig
 from .tokenization_ctrl import CTRLTokenizer

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_ctrl import (
      CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
      CTRLForSequenceClassification,
      CTRLLMHeadModel,
      CTRLModel,
      CTRLPreTrainedModel,
  )

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_ctrl import (
      TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
      TFCTRLForSequenceClassification,
      TFCTRLLMHeadModel,
      TFCTRLModel,
      TFCTRLPreTrainedModel,
  )

else:
 import sys

 lowerCamelCase_			=						_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

