


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


__lowerCAmelCase	: List[str]  				=logging.get_logger(__name__)

__lowerCAmelCase	: str  				={
    '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'''



				SCREAMING_SNAKE_CASE__				:			List[str]						=		'''falcon'''
				SCREAMING_SNAKE_CASE__				:			Optional[int]						=		['''past_key_values''']


				def __init__(       self			:Any			,			lowerCAmelCase__			:Union[str, Any]=65_024			,			lowerCAmelCase__			:Optional[Any]=4_544			,			lowerCAmelCase__			:int=32			,			lowerCAmelCase__			:Union[str, Any]=71			,			lowerCAmelCase__			:Optional[Any]=1E-5			,			lowerCAmelCase__			:Optional[int]=0.02			,			lowerCAmelCase__			:Dict=True			,			lowerCAmelCase__			:int=0.0			,			lowerCAmelCase__			:List[Any]=0.0			,			lowerCAmelCase__			:Optional[Any]=None			,			lowerCAmelCase__			:Optional[int]=False			,			lowerCAmelCase__			:Optional[Any]=False			,			lowerCAmelCase__			:Optional[int]=True			,			lowerCAmelCase__			:Union[str, Any]=True			,			lowerCAmelCase__			:Any=False			,			lowerCAmelCase__			:Tuple=11			,			lowerCAmelCase__			:List[Any]=11			,			**lowerCAmelCase__			:Union[str, Any]			,			)		->			Tuple:
										__SCREAMING_SNAKE_CASE						:     Union[str, Any]					=		vocab_size
										# Backward compatibility with n_embed kwarg
										__SCREAMING_SNAKE_CASE						:     List[str]					=		kwargs.pop('''n_embed'''			,			lowerCAmelCase__	)
										__SCREAMING_SNAKE_CASE						:     Dict					=		hidden_size if n_embed is None else n_embed
										__SCREAMING_SNAKE_CASE						:     Dict					=		num_hidden_layers
										__SCREAMING_SNAKE_CASE						:     Optional[int]					=		num_attention_heads
										__SCREAMING_SNAKE_CASE						:     str					=		layer_norm_epsilon
										__SCREAMING_SNAKE_CASE						:     Optional[int]					=		initializer_range
										__SCREAMING_SNAKE_CASE						:     Optional[Any]					=		use_cache
										__SCREAMING_SNAKE_CASE						:     Optional[int]					=		hidden_dropout
										__SCREAMING_SNAKE_CASE						:     List[Any]					=		attention_dropout

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

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


				@property
				def 		__magic_name__(       self			:Any	)		->			Dict:
										return self.hidden_size // self.num_attention_heads



				@property
				def 		__magic_name__(       self			:Tuple	)		->			List[str]:
										return not self.alibi




from typing import Optional

from .. import Features, NamedSplit
from ..packaged_modules.text.text import Text
from ..utils.typing import NestedDataStructureLike, PathLike
from .abc import AbstractDatasetReader
class        _lowercase      (			A__       ):






				'''simple docstring'''



				def __init__(       self			:int			,			lowerCAmelCase__			:NestedDataStructureLike[PathLike]			,			lowerCAmelCase__			:Optional[NamedSplit] = None			,			lowerCAmelCase__			:Optional[Features] = None			,			lowerCAmelCase__			:str = None			,			lowerCAmelCase__			:bool = False			,			lowerCAmelCase__			:bool = False			,			lowerCAmelCase__			:Optional[int] = None			,			**lowerCAmelCase__			:Optional[int]			,			)		->			Tuple:
										super().__init__(
										    lowerCAmelCase__			,			split=lowerCAmelCase__			,			features=lowerCAmelCase__			,			cache_dir=lowerCAmelCase__			,			keep_in_memory=lowerCAmelCase__			,			streaming=lowerCAmelCase__			,			num_proc=lowerCAmelCase__			,			**lowerCAmelCase__			,			)
										__SCREAMING_SNAKE_CASE						:     List[str]					=		path_or_paths if isinstance(lowerCAmelCase__			,			lowerCAmelCase__	) else {self.split: path_or_paths}
										__SCREAMING_SNAKE_CASE						:     int					=		Text(
										    cache_dir=lowerCAmelCase__			,			data_files=lowerCAmelCase__			,			features=lowerCAmelCase__			,			**lowerCAmelCase__			,			)



				def 		__magic_name__(       self			:Dict	)		->			Tuple:
										# Build iterable dataset
										if self.streaming:
																__SCREAMING_SNAKE_CASE						:     int					=		self.builder.as_streaming_dataset(split=self.split	)
										# Build regular (map-style) dataset
										else:
																__SCREAMING_SNAKE_CASE						:     List[str]					=		None
																__SCREAMING_SNAKE_CASE						:     str					=		None
																__SCREAMING_SNAKE_CASE						:     Dict					=		None
																__SCREAMING_SNAKE_CASE						:     Tuple					=		None

																self.builder.download_and_prepare(
																    download_config=lowerCAmelCase__			,			download_mode=lowerCAmelCase__			,			verification_mode=lowerCAmelCase__			,			base_path=lowerCAmelCase__			,			num_proc=self.num_proc			,			)
																__SCREAMING_SNAKE_CASE						:     Optional[int]					=		self.builder.as_dataset(
																    split=self.split			,			verification_mode=lowerCAmelCase__			,			in_memory=self.keep_in_memory	)
										return dataset
