





'''simple docstring'''




import copy
from typing import Dict

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING
from ..bit import BitConfig


__UpperCAmelCase         =   logging.get_logger(__name__)

__UpperCAmelCase         =   {
    """google/vit-hybrid-base-bit-384""": """https://huggingface.co/vit-hybrid-base-bit-384/resolve/main/config.json""",
    # See all ViT hybrid models at https://huggingface.co/models?filter=vit
}




class       UpperCamelCase__			(			lowercase_	):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__						=					'''vit-hybrid'''


					def __init__(		self							:	Dict     ,		lowerCamelCase_							:	Optional[Any]=None     ,		lowerCamelCase_							:	List[Any]=7_68     ,		lowerCamelCase_							:	Tuple=12     ,		lowerCamelCase_							:	Union[str, Any]=12     ,		lowerCamelCase_							:	List[Any]=30_72     ,		lowerCamelCase_							:	Union[str, Any]="gelu"     ,		lowerCamelCase_							:	Union[str, Any]=0.0     ,		lowerCamelCase_							:	int=0.0     ,		lowerCamelCase_							:	Tuple=0.02     ,		lowerCamelCase_							:	Union[str, Any]=1e-12     ,		lowerCamelCase_							:	Union[str, Any]=2_24     ,		lowerCamelCase_							:	Union[str, Any]=1     ,		lowerCamelCase_							:	Tuple=3     ,		lowerCamelCase_							:	Optional[int]=[1, 10_24, 24, 24]     ,		lowerCamelCase_							:	Any=True     ,		**lowerCamelCase_							:	Optional[Any]     ,		):

							'''simple docstring'''



							super().__init__(**lowerCamelCase_		)

							if backbone_config is None:
									logger.info("""`backbone_config` is `None`. Initializing the config with a `BiT` backbone."""		)
									SCREAMING_SNAKE_CASE				:							List[Any]						=	{
									    """global_padding""": """same""",
									    """layer_type""": """bottleneck""",
									    """depths""": [3, 4, 9],
									    """out_features""": ["""stage3"""],
									    """embedding_dynamic_padding""": True,
									}

							if isinstance(lowerCamelCase_     ,		lowerCamelCase_		):
									if "model_type" in backbone_config:
											SCREAMING_SNAKE_CASE				:							List[str]						=	CONFIG_MAPPING[backbone_config["""model_type"""]]
									else:
											logger.info(
											    """`model_type` is not found in `backbone_config`. Use `Bit` as the backbone configuration class."""		)
											SCREAMING_SNAKE_CASE				:							Tuple						=	BitConfig
									SCREAMING_SNAKE_CASE				:							Union[str, Any]						=	backbone_config_class(**lowerCamelCase_		)

							SCREAMING_SNAKE_CASE				:							List[Any]						=	backbone_featmap_shape
							SCREAMING_SNAKE_CASE				:							int						=	backbone_config
							SCREAMING_SNAKE_CASE				:							str						=	hidden_size
							SCREAMING_SNAKE_CASE				:							List[str]						=	num_hidden_layers
							SCREAMING_SNAKE_CASE				:							Dict						=	num_attention_heads
							SCREAMING_SNAKE_CASE				:							Optional[Any]						=	intermediate_size
							SCREAMING_SNAKE_CASE				:							str						=	hidden_act
							SCREAMING_SNAKE_CASE				:							str						=	hidden_dropout_prob
							SCREAMING_SNAKE_CASE				:							Optional[Any]						=	attention_probs_dropout_prob
							SCREAMING_SNAKE_CASE				:							Dict						=	initializer_range
							SCREAMING_SNAKE_CASE				:							List[Any]						=	layer_norm_eps
							SCREAMING_SNAKE_CASE				:							Optional[Any]						=	image_size
							SCREAMING_SNAKE_CASE				:							str						=	patch_size
							SCREAMING_SNAKE_CASE				:							List[Any]						=	num_channels
							SCREAMING_SNAKE_CASE				:							Tuple						=	qkv_bias



					def lowerCamelCase_	(		self							:	int		):

							'''simple docstring'''



							SCREAMING_SNAKE_CASE				:							List[str]						=	copy.deepcopy(self.__dict__		)
							SCREAMING_SNAKE_CASE				:							Dict						=	self.backbone_config.to_dict()
							SCREAMING_SNAKE_CASE				:							List[Any]						=	self.__class__.model_type
							return output










'''simple docstring'''




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


__UpperCAmelCase         =   logging.get_logger(__name__)

__UpperCAmelCase         =   {
    """uw-madison/yoso-4096""": """https://huggingface.co/uw-madison/yoso-4096/resolve/main/config.json""",
    # See all YOSO models at https://huggingface.co/models?filter=yoso
}




class       UpperCamelCase__			(			lowercase_	):




					"""simple docstring"""
					SCREAMING_SNAKE_CASE__						=					'''yoso'''


					def __init__(		self							:	str     ,		lowerCamelCase_							:	Tuple=5_02_65     ,		lowerCamelCase_							:	int=7_68     ,		lowerCamelCase_							:	Optional[Any]=12     ,		lowerCamelCase_							:	int=12     ,		lowerCamelCase_							:	Optional[Any]=30_72     ,		lowerCamelCase_							:	str="gelu"     ,		lowerCamelCase_							:	Union[str, Any]=0.1     ,		lowerCamelCase_							:	int=0.1     ,		lowerCamelCase_							:	Optional[int]=40_96     ,		lowerCamelCase_							:	str=1     ,		lowerCamelCase_							:	str=0.02     ,		lowerCamelCase_							:	Dict=1e-12     ,		lowerCamelCase_							:	Tuple="absolute"     ,		lowerCamelCase_							:	Any=True     ,		lowerCamelCase_							:	Dict=9     ,		lowerCamelCase_							:	Any=64     ,		lowerCamelCase_							:	Union[str, Any]=None     ,		lowerCamelCase_							:	List[str]=True     ,		lowerCamelCase_							:	Dict=True     ,		lowerCamelCase_							:	int=1     ,		lowerCamelCase_							:	Tuple=0     ,		lowerCamelCase_							:	Dict=2     ,		**lowerCamelCase_							:	Tuple     ,		):

							'''simple docstring'''



							super().__init__(pad_token_id=lowerCamelCase_     ,		bos_token_id=lowerCamelCase_     ,		eos_token_id=lowerCamelCase_     ,		**lowerCamelCase_		)

							SCREAMING_SNAKE_CASE				:							int						=	vocab_size
							SCREAMING_SNAKE_CASE				:							List[Any]						=	max_position_embeddings
							SCREAMING_SNAKE_CASE				:							Tuple						=	hidden_size
							SCREAMING_SNAKE_CASE				:							Dict						=	num_hidden_layers
							SCREAMING_SNAKE_CASE				:							Any						=	num_attention_heads
							SCREAMING_SNAKE_CASE				:							int						=	intermediate_size
							SCREAMING_SNAKE_CASE				:							Optional[Any]						=	hidden_act
							SCREAMING_SNAKE_CASE				:							Optional[Any]						=	hidden_dropout_prob
							SCREAMING_SNAKE_CASE				:							List[Any]						=	attention_probs_dropout_prob
							SCREAMING_SNAKE_CASE				:							str						=	initializer_range
							SCREAMING_SNAKE_CASE				:							List[str]						=	type_vocab_size
							SCREAMING_SNAKE_CASE				:							List[str]						=	layer_norm_eps
							SCREAMING_SNAKE_CASE				:							Any						=	position_embedding_type
							SCREAMING_SNAKE_CASE				:							Optional[int]						=	use_expectation
							SCREAMING_SNAKE_CASE				:							int						=	hash_code_len
							SCREAMING_SNAKE_CASE				:							Union[str, Any]						=	num_hash
							SCREAMING_SNAKE_CASE				:							Optional[Any]						=	conv_window
							SCREAMING_SNAKE_CASE				:							Optional[Any]						=	use_fast_hash
							SCREAMING_SNAKE_CASE				:							Optional[int]						=	lsh_backward



