





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


UpperCAmelCase_           =	logging.get_logger(__name__)

UpperCAmelCase_           =	{
    "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 			__UpperCamelCase    (							A__    ):
     __A	:  Dict							  =   """falcon"""
     __A	:  Any							  =   ["""past_key_values"""]





     def __init__(     self				,							_UpperCamelCase=65024				,							_UpperCamelCase=4544				,							_UpperCamelCase=32				,							_UpperCamelCase=71				,							_UpperCamelCase=1e-5				,							_UpperCamelCase=0.02				,							_UpperCamelCase=True				,							_UpperCamelCase=0.0				,							_UpperCamelCase=0.0				,							_UpperCamelCase=None				,							_UpperCamelCase=False				,							_UpperCamelCase=False				,							_UpperCamelCase=True				,							_UpperCamelCase=True				,							_UpperCamelCase=False				,							_UpperCamelCase=11				,							_UpperCamelCase=11				,							**_UpperCamelCase				,							):
        _UpperCAmelCase           =   vocab_size
        # Backward compatibility with n_embed kwarg
        _UpperCAmelCase           =   kwargs.pop('''n_embed'''				,							_UpperCamelCase					)
        _UpperCAmelCase           =   hidden_size if n_embed is None else n_embed
        _UpperCAmelCase           =   num_hidden_layers
        _UpperCAmelCase           =   num_attention_heads
        _UpperCAmelCase           =   layer_norm_epsilon
        _UpperCAmelCase           =   initializer_range
        _UpperCAmelCase           =   use_cache
        _UpperCAmelCase           =   hidden_dropout
        _UpperCAmelCase           =   attention_dropout

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

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





     @property
     def 		UpperCamelCase(     self					):
        return self.hidden_size // self.num_attention_heads





     @property
     def 		UpperCamelCase(     self					):
        return not self.alibi






from typing import TYPE_CHECKING

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


UpperCAmelCase_           =	{
    "configuration_xlm": ["XLM_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLMConfig", "XLMOnnxConfig"],
    "tokenization_xlm": ["XLMTokenizer"],
}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   UpperCAmelCase_           =	[
       "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:
   UpperCAmelCase_           =	[
       "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

   UpperCAmelCase_           =	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)