






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 		_A						( UpperCAmelCase_ ):
  lowercase_						:			Union[str, Any]						=					'''falcon'''
  lowercase_						:			str						=					['''past_key_values''']

  def __init__(    self						:	int   ,				lowerCamelCase__						:	int=6_50_24   ,				lowerCamelCase__						:	Dict=45_44   ,				lowerCamelCase__						:	str=32   ,				lowerCamelCase__						:	List[Any]=71   ,				lowerCamelCase__						:	Dict=1e-5   ,				lowerCamelCase__						:	Optional[int]=0.02   ,				lowerCamelCase__						:	int=True   ,				lowerCamelCase__						:	Dict=0.0   ,				lowerCamelCase__						:	str=0.0   ,				lowerCamelCase__						:	List[str]=None   ,				lowerCamelCase__						:	List[str]=False   ,				lowerCamelCase__						:	str=False   ,				lowerCamelCase__						:	Any=True   ,				lowerCamelCase__						:	Union[str, Any]=True   ,				lowerCamelCase__						:	int=False   ,				lowerCamelCase__						:	Any=11   ,				lowerCamelCase__						:	Union[str, Any]=11   ,				**lowerCamelCase__						:	List[Any]   ,				):
     """simple docstring"""

     __UpperCamelCase	:			Any					=					vocab_size
     # Backward compatibility with n_embed kwarg
     __UpperCamelCase	:			List[str]					=					kwargs.pop("""n_embed"""   ,				lowerCamelCase__			)
     __UpperCamelCase	:			Union[str, Any]					=					hidden_size if n_embed is None else n_embed
     __UpperCamelCase	:			Optional[Any]					=					num_hidden_layers
     __UpperCamelCase	:			Optional[int]					=					num_attention_heads
     __UpperCamelCase	:			Optional[int]					=					layer_norm_epsilon
     __UpperCamelCase	:			List[Any]					=					initializer_range
     __UpperCamelCase	:			str					=					use_cache
     __UpperCamelCase	:			int					=					hidden_dropout
     __UpperCamelCase	:			str					=					attention_dropout

     __UpperCamelCase	:			Optional[Any]					=					bos_token_id
     __UpperCamelCase	:			Union[str, Any]					=					eos_token_id
     __UpperCamelCase	:			str					=					num_attention_heads if num_kv_heads is None else num_kv_heads
     __UpperCamelCase	:			Union[str, Any]					=					alibi
     __UpperCamelCase	:			Optional[int]					=					new_decoder_architecture
     __UpperCamelCase	:			Dict					=					multi_query  # Ignored when new_decoder_architecture is True
     __UpperCamelCase	:			Tuple					=					parallel_attn
     __UpperCamelCase	:			Tuple					=					bias

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

  @property
  def    a					(    self						:	Dict			):
     """simple docstring"""

     return self.hidden_size // self.num_attention_heads

  @property
  def    a					(    self						:	int			):
     """simple docstring"""

     return not self.alibi











import re

from filelock import FileLock


try:
       import nltk

       UpperCamelCase    							=      True
except (ImportError, ModuleNotFoundError):
       UpperCamelCase    							=      False

if NLTK_AVAILABLE:
       with FileLock('.lock') as lock:
              nltk.download('punkt', quiet=True)


def 				__lowerCamelCase     (							__lowerCAmelCase							:					str							)     ->  str:
   re.sub("""<n>"""					,							""""""					,							__lowerCAmelCase							)  # remove pegasus newline char
   assert NLTK_AVAILABLE, "nltk must be installed to separate newlines between sentences. (pip install nltk)"
   return "\n".join(nltk.sent_tokenize(__lowerCAmelCase							)							)



