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


SCREAMING_SNAKE_CASE				:List[Any]									=							logging.get_logger(__name__)

SCREAMING_SNAKE_CASE				:Optional[int]									=							{
    '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 (    __SCREAMING_SNAKE_CASE    ):




	'''simple docstring'''





	snake_case_          =	"falcon"
	snake_case_          =	["past_key_values"]






	def __init__(			self   :					Optional[int]				,A   :					Tuple=6_50_24				,A   :					int=45_44				,A   :					int=32				,A   :					str=71				,A   :					Optional[int]=1E-5				,A   :					List[Any]=0.02				,A   :					str=True				,A   :					str=0.0				,A   :					Any=0.0				,A   :					Any=None				,A   :					List[str]=False				,A   :					Dict=False				,A   :					Union[str, Any]=True				,A   :					List[Any]=True				,A   :					Optional[int]=False				,A   :					Optional[Any]=11				,A   :					str=11				,**A   :					Union[str, Any]				,):
					__A       =					vocab_size
					# Backward compatibility with n_embed kwarg
					__A       =					kwargs.pop("n_embed"				,A					)
					__A       =					hidden_size if n_embed is None else n_embed
					__A       =					num_hidden_layers
					__A       =					num_attention_heads
					__A       =					layer_norm_epsilon
					__A       =					initializer_range
					__A       =					use_cache
					__A       =					hidden_dropout
					__A       =					attention_dropout

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

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






	@property
	def 							UpperCamelCase_    (			self   :					Optional[int]					):
					return self.hidden_size // self.num_attention_heads







	@property
	def 							UpperCamelCase_    (			self   :					List[str]					):
					return not self.alibi






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


lowerCamelCase__					:  Optional[int]      							=				logging.get_logger(__name__)

lowerCamelCase__					:  Tuple      							=				{
    'microsoft/swinv2-tiny-patch4-window8-256': (
        'https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json'
    ),
}





class 			lowerCamelCase_				( _SCREAMING_SNAKE_CASE   ):


 '''simple docstring'''







 lowercase_							       =       "swinv2"

 lowercase_							       =       {
     "num_attention_heads": "num_heads",
     "num_hidden_layers": "num_layers",
 }



 def __init__(				self    :						Dict							,							_lowerCAmelCase    :						Optional[Any]=224							,							_lowerCAmelCase    :						Optional[int]=4							,							_lowerCAmelCase    :						Tuple=3							,							_lowerCAmelCase    :						Tuple=96							,							_lowerCAmelCase    :						Dict=[2, 2, 6, 2]							,							_lowerCAmelCase    :						Optional[Any]=[3, 6, 12, 24]							,							_lowerCAmelCase    :						str=7							,							_lowerCAmelCase    :						List[Any]=4.0							,							_lowerCAmelCase    :						List[str]=True							,							_lowerCAmelCase    :						List[Any]=0.0							,							_lowerCAmelCase    :						List[Any]=0.0							,							_lowerCAmelCase    :						Any=0.1							,							_lowerCAmelCase    :						List[Any]="gelu"							,							_lowerCAmelCase    :						str=False							,							_lowerCAmelCase    :						str=0.02							,							_lowerCAmelCase    :						List[Any]=1E-5							,							_lowerCAmelCase    :						str=32							,							**_lowerCAmelCase    :						List[Any]							,							):
       super().__init__(**_lowerCAmelCase		)

       SCREAMING_SNAKE_CASE_      		=     image_size
       SCREAMING_SNAKE_CASE_      		=     patch_size
       SCREAMING_SNAKE_CASE_      		=     num_channels
       SCREAMING_SNAKE_CASE_      		=     embed_dim
       SCREAMING_SNAKE_CASE_      		=     depths
       SCREAMING_SNAKE_CASE_      		=     len(_lowerCAmelCase		)
       SCREAMING_SNAKE_CASE_      		=     num_heads
       SCREAMING_SNAKE_CASE_      		=     window_size
       SCREAMING_SNAKE_CASE_      		=     mlp_ratio
       SCREAMING_SNAKE_CASE_      		=     qkv_bias
       SCREAMING_SNAKE_CASE_      		=     hidden_dropout_prob
       SCREAMING_SNAKE_CASE_      		=     attention_probs_dropout_prob
       SCREAMING_SNAKE_CASE_      		=     drop_path_rate
       SCREAMING_SNAKE_CASE_      		=     hidden_act
       SCREAMING_SNAKE_CASE_      		=     use_absolute_embeddings
       SCREAMING_SNAKE_CASE_      		=     layer_norm_eps
       SCREAMING_SNAKE_CASE_      		=     initializer_range
       SCREAMING_SNAKE_CASE_      		=     encoder_stride
       # we set the hidden_size attribute in order to make Swinv2 work with VisionEncoderDecoderModel
       # this indicates the channel dimension after the last stage of the model
       SCREAMING_SNAKE_CASE_      		=     int(embed_dim * 2 ** (len(_lowerCAmelCase		) - 1)		)
       SCREAMING_SNAKE_CASE_      		=     (0, 0, 0, 0)