"""simple docstring"""


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


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

lowerCAmelCase_:					Optional[int]     =					{
    "microsoft/swinv2-tiny-patch4-window8-256": (
        "https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json"
    ),
}






class    a__    (   _a	):
   snake_case_							=      "swinv2"

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


   def __init__(     self,				_UpperCAmelCase=224,				_UpperCAmelCase=4,				_UpperCAmelCase=3,				_UpperCAmelCase=96,				_UpperCAmelCase=[2, 2, 6, 2],				_UpperCAmelCase=[3, 6, 12, 24],				_UpperCAmelCase=7,				_UpperCAmelCase=4.0,				_UpperCAmelCase=True,				_UpperCAmelCase=0.0,				_UpperCAmelCase=0.0,				_UpperCAmelCase=0.1,				_UpperCAmelCase="gelu",				_UpperCAmelCase=False,				_UpperCAmelCase=0.02,				_UpperCAmelCase=1E-5,				_UpperCAmelCase=32,				**_UpperCAmelCase,				):
        '''simple docstring'''



        super().__init__(**_UpperCAmelCase  )

        lowercase__				 =							image_size
        lowercase__				 =							patch_size
        lowercase__				 =							num_channels
        lowercase__				 =							embed_dim
        lowercase__				 =							depths
        lowercase__				 =							len(_UpperCAmelCase  )
        lowercase__				 =							num_heads
        lowercase__				 =							window_size
        lowercase__				 =							mlp_ratio
        lowercase__				 =							qkv_bias
        lowercase__				 =							hidden_dropout_prob
        lowercase__				 =							attention_probs_dropout_prob
        lowercase__				 =							drop_path_rate
        lowercase__				 =							hidden_act
        lowercase__				 =							use_absolute_embeddings
        lowercase__				 =							layer_norm_eps
        lowercase__				 =							initializer_range
        lowercase__				 =							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
        lowercase__				 =							int(embed_dim * 2 ** (len(_UpperCAmelCase  ) - 1)  )
        lowercase__				 =							(0, 0, 0, 0)





"""simple docstring"""


import os
import sys

lowerCAmelCase_:					Any     =					os.path.join(os.path.dirname(__file__), "src")
sys.path.append(SRC_DIR)


from transformers import (
    AutoConfig,
    AutoModel,
    AutoModelForCausalLM,
    AutoModelForMaskedLM,
    AutoModelForQuestionAnswering,
    AutoModelForSequenceClassification,
    AutoTokenizer,
    add_start_docstrings,
)


lowerCAmelCase_:					Union[str, Any]     =					[
    "torch",
    "numpy",
    "tokenizers",
    "filelock",
    "requests",
    "tqdm",
    "regex",
    "sentencepiece",
    "sacremoses",
    "importlib_metadata",
    "huggingface_hub",
]







@add_start_docstrings(AutoConfig.__doc__      )
def 					__a   (		*A    ,				**A      ):






     '''simple docstring'''



     return AutoConfig.from_pretrained(*A    ,				**A      )







@add_start_docstrings(AutoTokenizer.__doc__      )
def 					__a   (		*A    ,				**A      ):






     '''simple docstring'''



     return AutoTokenizer.from_pretrained(*A    ,				**A      )







@add_start_docstrings(AutoModel.__doc__      )
def 					__a   (		*A    ,				**A      ):






     '''simple docstring'''



     return AutoModel.from_pretrained(*A    ,				**A      )







@add_start_docstrings(AutoModelForCausalLM.__doc__      )
def 					__a   (		*A    ,				**A      ):






     '''simple docstring'''



     return AutoModelForCausalLM.from_pretrained(*A    ,				**A      )







@add_start_docstrings(AutoModelForMaskedLM.__doc__      )
def 					__a   (		*A    ,				**A      ):






     '''simple docstring'''



     return AutoModelForMaskedLM.from_pretrained(*A    ,				**A      )







@add_start_docstrings(AutoModelForSequenceClassification.__doc__      )
def 					__a   (		*A    ,				**A      ):






     '''simple docstring'''



     return AutoModelForSequenceClassification.from_pretrained(*A    ,				**A      )







@add_start_docstrings(AutoModelForQuestionAnswering.__doc__      )
def 					__a   (		*A    ,				**A      ):






     '''simple docstring'''



     return AutoModelForQuestionAnswering.from_pretrained(*A    ,				**A      )




