



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


A_		:     int        =     logging.get_logger(__name__)

A_		:     Any        =     {
    '''facebook/xglm-564M''': '''https://huggingface.co/facebook/xglm-564M/resolve/main/config.json''',
    # See all XGLM models at https://huggingface.co/models?filter=xglm
}



class 		_lowercase		(       UpperCAmelCase__	):
   _UpperCAmelCase     	=			'''xglm'''
   _UpperCAmelCase     	=			['''past_key_values''']

   _UpperCAmelCase     	=			{
       '''num_attention_heads''': '''attention_heads''',
       '''hidden_size''': '''d_model''',
       '''num_hidden_layers''': '''num_layers''',
   }

   def __init__(      self			:       Dict							,   __lowerCAmelCase			:       Any=25_6008							,   __lowerCAmelCase			:       Optional[int]=2048							,   __lowerCAmelCase			:       Optional[Any]=1024							,   __lowerCAmelCase			:       Optional[int]=4096							,   __lowerCAmelCase			:       int=24							,   __lowerCAmelCase			:       Any=16							,   __lowerCAmelCase			:       List[Any]="gelu"							,   __lowerCAmelCase			:       Optional[int]=0.1							,   __lowerCAmelCase			:       List[Any]=0.1							,   __lowerCAmelCase			:       List[Any]=0.0							,   __lowerCAmelCase			:       Any=0.0							,   __lowerCAmelCase			:       List[str]=0.0_2							,   __lowerCAmelCase			:       Tuple=True							,   __lowerCAmelCase			:       Optional[int]=True							,   __lowerCAmelCase			:       int=2							,   __lowerCAmelCase			:       Any=1							,   __lowerCAmelCase			:       Optional[Any]=0							,   __lowerCAmelCase			:       Dict=2							,   **__lowerCAmelCase			:       List[Any]							,   )       ->				Any:


    """simple docstring"""






    a						=		vocab_size
    a						=		max_position_embeddings
    a						=		d_model
    a						=		ffn_dim
    a						=		num_layers
    a						=		attention_heads
    a						=		activation_function
    a						=		dropout
    a						=		attention_dropout
    a						=		activation_dropout
    a						=		layerdrop
    a						=		init_std
    a						=		scale_embedding  # scale factor will be sqrt(d_model) if True
    a						=		use_cache

    super().__init__(
        pad_token_id=__lowerCAmelCase							,   bos_token_id=__lowerCAmelCase							,   eos_token_id=__lowerCAmelCase							,   decoder_start_token_id=__lowerCAmelCase							,   **__lowerCAmelCase							,   )






from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


A_		:     int        =     logging.get_logger(__name__)

A_		:     str        =     {
    '''microsoft/focalnet-tiny''': '''https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json''',
}



class 		_lowercase		(       UpperCAmelCase__,   UpperCAmelCase__	):
   _UpperCAmelCase     	=			'''focalnet'''

   def __init__(      self			:       int							,   __lowerCAmelCase			:       Optional[Any]=224							,   __lowerCAmelCase			:       Any=4							,   __lowerCAmelCase			:       Any=3							,   __lowerCAmelCase			:       Tuple=96							,   __lowerCAmelCase			:       Dict=False							,   __lowerCAmelCase			:       Optional[int]=[192, 384, 768, 768]							,   __lowerCAmelCase			:       Union[str, Any]=[2, 2, 6, 2]							,   __lowerCAmelCase			:       Optional[int]=[2, 2, 2, 2]							,   __lowerCAmelCase			:       Union[str, Any]=[3, 3, 3, 3]							,   __lowerCAmelCase			:       str="gelu"							,   __lowerCAmelCase			:       Any=4.0							,   __lowerCAmelCase			:       Optional[int]=0.0							,   __lowerCAmelCase			:       Tuple=0.1							,   __lowerCAmelCase			:       str=False							,   __lowerCAmelCase			:       Optional[int]=1E-4							,   __lowerCAmelCase			:       Optional[Any]=False							,   __lowerCAmelCase			:       Union[str, Any]=False							,   __lowerCAmelCase			:       str=False							,   __lowerCAmelCase			:       Any=0.0_2							,   __lowerCAmelCase			:       str=1E-5							,   __lowerCAmelCase			:       Optional[Any]=32							,   __lowerCAmelCase			:       Dict=None							,   __lowerCAmelCase			:       str=None							,   **__lowerCAmelCase			:       Any							,   )       ->				List[str]:


    """simple docstring"""






    super().__init__(**__lowerCAmelCase							)

    a						=		image_size
    a						=		patch_size
    a						=		num_channels
    a						=		embed_dim
    a						=		use_conv_embed
    a						=		hidden_sizes
    a						=		depths
    a						=		focal_levels
    a						=		focal_windows
    a						=		hidden_act
    a						=		mlp_ratio
    a						=		hidden_dropout_prob
    a						=		drop_path_rate
    a						=		use_layerscale
    a						=		layerscale_value
    a						=		use_post_layernorm
    a						=		use_post_layernorm_in_modulation
    a						=		normalize_modulator
    a						=		initializer_range
    a						=		layer_norm_eps
    a						=		encoder_stride
    a						=		["stem"] + [f"""stage{idx}""" for idx in range(1							,   len(self.depths							) + 1							)]
    a		,  a						=		get_aligned_output_features_output_indices(
        out_features=__lowerCAmelCase							,   out_indices=__lowerCAmelCase							,   stage_names=self.stage_names							)

