






from . import (
    albert,
    align,
    altclip,
    audio_spectrogram_transformer,
    auto,
    autoformer,
    bark,
    bart,
    barthez,
    bartpho,
    beit,
    bert,
    bert_generation,
    bert_japanese,
    bertweet,
    big_bird,
    bigbird_pegasus,
    biogpt,
    bit,
    blenderbot,
    blenderbot_small,
    blip,
    blip_a,
    bloom,
    bridgetower,
    byta,
    camembert,
    canine,
    chinese_clip,
    clap,
    clip,
    clipseg,
    codegen,
    conditional_detr,
    convbert,
    convnext,
    convnextva,
    cpm,
    cpmant,
    ctrl,
    cvt,
    dataavec,
    deberta,
    deberta_va,
    decision_transformer,
    deformable_detr,
    deit,
    deprecated,
    deta,
    detr,
    dialogpt,
    dinat,
    distilbert,
    dit,
    donut,
    dpr,
    dpt,
    efficientformer,
    efficientnet,
    electra,
    encodec,
    encoder_decoder,
    ernie,
    ernie_m,
    esm,
    falcon,
    flaubert,
    flava,
    fnet,
    focalnet,
    fsmt,
    funnel,
    git,
    glpn,
    gpta,
    gpt_bigcode,
    gpt_neo,
    gpt_neox,
    gpt_neox_japanese,
    gpt_swa,
    gptj,
    gptsan_japanese,
    graphormer,
    groupvit,
    herbert,
    hubert,
    ibert,
    imagegpt,
    informer,
    instructblip,
    jukebox,
    layoutlm,
    layoutlmva,
    layoutlmva,
    layoutxlm,
    led,
    levit,
    lilt,
    llama,
    longformer,
    longta,
    luke,
    lxmert,
    mam_aaa,
    marian,
    markuplm,
    maskaformer,
    maskformer,
    mbart,
    mbartaa,
    mega,
    megatron_bert,
    megatron_gpta,
    mgp_str,
    mluke,
    mobilebert,
    mobilenet_va,
    mobilenet_va,
    mobilevit,
    mobilevitva,
    mpnet,
    mra,
    mta,
    musicgen,
    mvp,
    nat,
    nezha,
    nllb,
    nllb_moe,
    nystromformer,
    oneformer,
    open_llama,
    openai,
    opt,
    owlvit,
    pegasus,
    pegasus_x,
    perceiver,
    phobert,
    pixastruct,
    plbart,
    poolformer,
    prophetnet,
    qdqbert,
    rag,
    realm,
    reformer,
    regnet,
    rembert,
    resnet,
    roberta,
    roberta_prelayernorm,
    roc_bert,
    roformer,
    rwkv,
    sam,
    segformer,
    sew,
    sew_d,
    speech_encoder_decoder,
    speech_to_text,
    speech_to_text_a,
    speechta,
    splinter,
    squeezebert,
    swiftformer,
    swin,
    swinasr,
    swinva,
    switch_transformers,
    ta,
    table_transformer,
    tapas,
    time_series_transformer,
    timesformer,
    timm_backbone,
    transfo_xl,
    trocr,
    tvlt,
    umta,
    unispeech,
    unispeech_sat,
    upernet,
    videomae,
    vilt,
    vision_encoder_decoder,
    vision_text_dual_encoder,
    visual_bert,
    vit,
    vit_hybrid,
    vit_mae,
    vit_msn,
    vivit,
    wavaveca,
    wavaveca_conformer,
    wavaveca_phoneme,
    wavaveca_with_lm,
    wavlm,
    whisper,
    x_clip,
    xglm,
    xlm,
    xlm_prophetnet,
    xlm_roberta,
    xlm_roberta_xl,
    xlnet,
    xmod,
    yolos,
    yoso,
)










import copy
import os
from typing import TYPE_CHECKING, List, Union


if TYPE_CHECKING:
     pass

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


lowerCamelCase__							=     logging.get_logger(__name__)

lowerCamelCase__							=     {
    """kakaobrain/align-base""": """https://huggingface.co/kakaobrain/align-base/resolve/main/config.json""",
}




class 			snake_case__   (							lowercase_):

       '''simple docstring'''
       lowerCamelCase							:				Union[str, Any] 				= "align_text_model"



       def __init__(							self			,						a__=3_05_22			,						a__=7_68			,						a__=12			,						a__=12			,						a__=30_72			,						a__="gelu"			,						a__=0.1			,						a__=0.1			,						a__=5_12			,						a__=2			,						a__=0.02			,						a__=1e-12			,						a__=0			,						a__="absolute"			,						a__=True			,						**a__			,						) ->      List[str]:






            '''simple docstring'''





            super().__init__(**a__    )

            __snake_case			:Optional[int]          =						vocab_size
            __snake_case			:List[str]          =						hidden_size
            __snake_case			:Optional[Any]          =						num_hidden_layers
            __snake_case			:int          =						num_attention_heads
            __snake_case			:Optional[Any]          =						hidden_act
            __snake_case			:Union[str, Any]          =						intermediate_size
            __snake_case			:int          =						hidden_dropout_prob
            __snake_case			:Optional[Any]          =						attention_probs_dropout_prob
            __snake_case			:List[str]          =						max_position_embeddings
            __snake_case			:List[str]          =						type_vocab_size
            __snake_case			:Union[str, Any]          =						initializer_range
            __snake_case			:str          =						layer_norm_eps
            __snake_case			:Any          =						position_embedding_type
            __snake_case			:List[str]          =						use_cache
            __snake_case			:Optional[int]          =						pad_token_id



       @classmethod
       def 					__lowercase						(							cls			,						a__			,						**a__    ) ->      "PretrainedConfig":






            '''simple docstring'''





            cls._set_token_in_kwargs(a__    )

            __snake_case       , __snake_case			:Tuple          =						cls.get_config_dict(a__			,						**a__    )

            # get the text config dict if we are loading from AlignConfig
            if config_dict.get("""model_type"""    ) == "align":
                 __snake_case			:Any          =						config_dict["""text_config"""]

            if "model_type" in config_dict and hasattr(cls			,						"""model_type"""    ) and config_dict["model_type"] != cls.model_type:
                 logger.warning(
                     F'''You are using a model of type {config_dict['model_type']} to instantiate a model of type '''
                     F'''{cls.model_type}. This is not supported for all configurations of models and can yield errors.'''    )

            return cls.from_dict(a__			,						**a__    )




class 			snake_case__   (							lowercase_):

       '''simple docstring'''
       lowerCamelCase							:				Optional[int] 				= "align_vision_model"



       def __init__(							self			,						a__ = 3			,						a__ = 6_00			,						a__ = 2.0			,						a__ = 3.1			,						a__ = 8			,						a__ = [3, 3, 5, 3, 5, 5, 3]			,						a__ = [32, 16, 24, 40, 80, 1_12, 1_92]			,						a__ = [16, 24, 40, 80, 1_12, 1_92, 3_20]			,						a__ = []			,						a__ = [1, 2, 2, 2, 1, 2, 1]			,						a__ = [1, 2, 2, 3, 3, 4, 1]			,						a__ = [1, 6, 6, 6, 6, 6, 6]			,						a__ = 0.25			,						a__ = "swish"			,						a__ = 25_60			,						a__ = "mean"			,						a__ = 0.02			,						a__ = 0.0_01			,						a__ = 0.99			,						a__ = 0.2			,						**a__			,						) ->      List[Any]:






            '''simple docstring'''





            super().__init__(**a__    )

            __snake_case			:Union[str, Any]          =						num_channels
            __snake_case			:List[str]          =						image_size
            __snake_case			:int          =						width_coefficient
            __snake_case			:int          =						depth_coefficient
            __snake_case			:List[Any]          =						depth_divisor
            __snake_case			:Any          =						kernel_sizes
            __snake_case			:Optional[int]          =						in_channels
            __snake_case			:Optional[int]          =						out_channels
            __snake_case			:int          =						depthwise_padding
            __snake_case			:List[str]          =						strides
            __snake_case			:Union[str, Any]          =						num_block_repeats
            __snake_case			:Dict          =						expand_ratios
            __snake_case			:Union[str, Any]          =						squeeze_expansion_ratio
            __snake_case			:Any          =						hidden_act
            __snake_case			:Optional[Any]          =						hidden_dim
            __snake_case			:Union[str, Any]          =						pooling_type
            __snake_case			:Union[str, Any]          =						initializer_range
            __snake_case			:Optional[Any]          =						batch_norm_eps
            __snake_case			:List[Any]          =						batch_norm_momentum
            __snake_case			:Optional[int]          =						drop_connect_rate
            __snake_case			:Union[str, Any]          =						sum(a__    ) * 4



       @classmethod
       def 					__lowercase						(							cls			,						a__			,						**a__    ) ->      "PretrainedConfig":






            '''simple docstring'''





            cls._set_token_in_kwargs(a__    )

            __snake_case       , __snake_case			:int          =						cls.get_config_dict(a__			,						**a__    )

            # get the vision config dict if we are loading from AlignConfig
            if config_dict.get("""model_type"""    ) == "align":
                 __snake_case			:str          =						config_dict["""vision_config"""]

            if "model_type" in config_dict and hasattr(cls			,						"""model_type"""    ) and config_dict["model_type"] != cls.model_type:
                 logger.warning(
                     F'''You are using a model of type {config_dict['model_type']} to instantiate a model of type '''
                     F'''{cls.model_type}. This is not supported for all configurations of models and can yield errors.'''    )

            return cls.from_dict(a__			,						**a__    )




class 			snake_case__   (							lowercase_):

       '''simple docstring'''
       lowerCamelCase							:				str 				= "align"
       lowerCamelCase							:				Union[str, Any] 				= True



       def __init__(							self			,						a__=None			,						a__=None			,						a__=6_40			,						a__=1.0			,						a__=0.02			,						**a__			,						) ->      Dict:






            '''simple docstring'''





            super().__init__(**a__    )

            if text_config is None:
                 __snake_case			:Union[str, Any]          =						{}
                 logger.info("""text_config is None. Initializing the AlignTextConfig with default values."""    )

            if vision_config is None:
                 __snake_case			:str          =						{}
                 logger.info("""vision_config is None. Initializing the AlignVisionConfig with default values."""    )

            __snake_case			:List[Any]          =						AlignTextConfig(**a__    )
            __snake_case			:Tuple          =						AlignVisionConfig(**a__    )

            __snake_case			:Tuple          =						projection_dim
            __snake_case			:int          =						temperature_init_value
            __snake_case			:Any          =						initializer_range



       @classmethod
       def 					__lowercase						(							cls			,						a__			,						a__			,						**a__    ) ->      str:






            '''simple docstring'''





            return cls(text_config=text_config.to_dict()			,						vision_config=vision_config.to_dict()			,						**a__    )



       def 					__lowercase						(							self    ) ->      Dict:






            '''simple docstring'''





            __snake_case			:Optional[Any]          =						copy.deepcopy(self.__dict__    )
            __snake_case			:Dict          =						self.text_config.to_dict()
            __snake_case			:Union[str, Any]          =						self.vision_config.to_dict()
            __snake_case			:List[Any]          =						self.__class__.model_type
            return output


