


from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


a       	=  logging.get_logger(__name__)

a       	=  {
    'facebook/deit-base-distilled-patch16-224': (
        'https://huggingface.co/facebook/deit-base-patch16-224/resolve/main/config.json'
    ),
    # See all DeiT models at https://huggingface.co/models?filter=deit
}







class 							UpperCamelCase__ (						__magic_name__ ):
					__SCREAMING_SNAKE_CASE							:	Optional[int]            = "deit"

					def __init__(  self							: int				,       UpperCamelCase__							: int=768				,       UpperCamelCase__							: Any=12				,       UpperCamelCase__							: int=12				,       UpperCamelCase__							: Tuple=3_072				,       UpperCamelCase__							: Tuple="gelu"				,       UpperCamelCase__							: List[Any]=0.0				,       UpperCamelCase__							: str=0.0				,       UpperCamelCase__							: Any=0.02				,       UpperCamelCase__							: int=1e-12				,       UpperCamelCase__							: Any=224				,       UpperCamelCase__							: List[str]=16				,       UpperCamelCase__							: int=3				,       UpperCamelCase__							: List[Any]=True				,       UpperCamelCase__							: Tuple=16				,       **UpperCamelCase__							: Dict				,       ):






										'''simple docstring'''






										super().__init__(**_lowerCAmelCase							)

										lowercase_					=      hidden_size
										lowercase_					=      num_hidden_layers
										lowercase_					=      num_attention_heads
										lowercase_					=      intermediate_size
										lowercase_					=      hidden_act
										lowercase_					=      hidden_dropout_prob
										lowercase_					=      attention_probs_dropout_prob
										lowercase_					=      initializer_range
										lowercase_					=      layer_norm_eps
										lowercase_					=      image_size
										lowercase_					=      patch_size
										lowercase_					=      num_channels
										lowercase_					=      qkv_bias
										lowercase_					=      encoder_stride







class 							UpperCamelCase__ (						__magic_name__ ):
					__SCREAMING_SNAKE_CASE							:	List[str]            = version.parse('1.11' )

					@property
					def 	UpperCAmelCase__							(  self							: Dict							):






										'''simple docstring'''






										return OrderedDict(
										    [
										        ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
										    ]							)







					@property
					def 	UpperCAmelCase__							(  self							: Optional[Any]							):






										'''simple docstring'''






										return 1e-4









'''simple docstring'''


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


_SCREAMING_SNAKE_CASE									=				logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE									=				{
    "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  lowerCAmelCase_		(		__magic_name__		):
 __lowerCamelCase    :				Any								=       "falcon"
 __lowerCamelCase    :				List[str]								=       ["past_key_values"]




 def __init__(						self      ,  _lowerCAmelCase=65024      ,  _lowerCAmelCase=4544      ,  _lowerCAmelCase=32      ,  _lowerCAmelCase=71      ,  _lowerCAmelCase=1E-5      ,  _lowerCAmelCase=0.02      ,  _lowerCAmelCase=True      ,  _lowerCAmelCase=0.0      ,  _lowerCAmelCase=0.0      ,  _lowerCAmelCase=None      ,  _lowerCAmelCase=False      ,  _lowerCAmelCase=False      ,  _lowerCAmelCase=True      ,  _lowerCAmelCase=True      ,  _lowerCAmelCase=False      ,  _lowerCAmelCase=11      ,  _lowerCAmelCase=11      ,  **_lowerCAmelCase      ,  )     ->				Union[str, Any]:
     _lowerCAmelCase						      =   vocab_size
     # Backward compatibility with n_embed kwarg
     _lowerCAmelCase						      =   kwargs.pop("n_embed"      ,  _lowerCAmelCase		)
     _lowerCAmelCase						      =   hidden_size if n_embed is None else n_embed
     _lowerCAmelCase						      =   num_hidden_layers
     _lowerCAmelCase						      =   num_attention_heads
     _lowerCAmelCase						      =   layer_norm_epsilon
     _lowerCAmelCase						      =   initializer_range
     _lowerCAmelCase						      =   use_cache
     _lowerCAmelCase						      =   hidden_dropout
     _lowerCAmelCase						      =   attention_dropout

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

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




 @property
 def 				_snake_case (						self		)     ->				Optional[Any]:
     return self.hidden_size // self.num_attention_heads





 @property
 def 				_snake_case (						self		)     ->				Optional[Any]:
     return not self.alibi


