'''simple docstring'''




import copy
import os
from typing import Union

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


snake_case	=      logging.get_logger(__name__)

snake_case	=      {
    'microsoft/git-base': 'https://huggingface.co/microsoft/git-base/resolve/main/config.json',
}





class 							SCREAMING_SNAKE_CASE (					UpperCAmelCase_			):
  """simple docstring"""







  __A  =		"git_vision_model"



  def __init__(	self :       List[Any]       ,       __lowerCAmelCase :       Any=768       ,       __lowerCAmelCase :       str=3072       ,       __lowerCAmelCase :       int=12       ,       __lowerCAmelCase :       Union[str, Any]=12       ,       __lowerCAmelCase :       Dict=3       ,       __lowerCAmelCase :       Optional[int]=224       ,       __lowerCAmelCase :       List[Any]=16       ,       __lowerCAmelCase :       Optional[Any]="quick_gelu"       ,       __lowerCAmelCase :       str=1e-5       ,       __lowerCAmelCase :       Optional[Any]=0.0       ,       __lowerCAmelCase :       Optional[Any]=0.0_2       ,       **__lowerCAmelCase :       Optional[Any]       ,       ):


        """simple docstring"""



        super().__init__(**__a       )

        _lowerCAmelCase		 = hidden_size
        _lowerCAmelCase		 = intermediate_size
        _lowerCAmelCase		 = num_hidden_layers
        _lowerCAmelCase		 = num_attention_heads
        _lowerCAmelCase		 = num_channels
        _lowerCAmelCase		 = patch_size
        _lowerCAmelCase		 = image_size
        _lowerCAmelCase		 = initializer_range
        _lowerCAmelCase		 = attention_dropout
        _lowerCAmelCase		 = layer_norm_eps
        _lowerCAmelCase		 = hidden_act



  @classmethod
  def 	a (	cls :       Any       ,       __lowerCAmelCase :       List[Any]       ,       **__lowerCAmelCase :       List[str]       ):


        """simple docstring"""



        cls._set_token_in_kwargs(__a       )

        _lowerCAmelCase ,	_lowerCAmelCase		 = cls.get_config_dict(__a       ,       **__a       )

        # get the vision config dict if we are loading from GITConfig
        if config_dict.get('model_type'       ) == "git":
              _lowerCAmelCase		 = 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 							SCREAMING_SNAKE_CASE (					UpperCAmelCase_			):
  """simple docstring"""







  __A  =		"git"



  def __init__(	self :       str       ,       __lowerCAmelCase :       List[Any]=None       ,       __lowerCAmelCase :       List[str]=3_0522       ,       __lowerCAmelCase :       int=768       ,       __lowerCAmelCase :       Any=6       ,       __lowerCAmelCase :       Union[str, Any]=12       ,       __lowerCAmelCase :       Any=3072       ,       __lowerCAmelCase :       Optional[Any]="gelu"       ,       __lowerCAmelCase :       Tuple=0.1       ,       __lowerCAmelCase :       Optional[int]=0.1       ,       __lowerCAmelCase :       Dict=1024       ,       __lowerCAmelCase :       Any=0.0_2       ,       __lowerCAmelCase :       Union[str, Any]=1e-12       ,       __lowerCAmelCase :       int=0       ,       __lowerCAmelCase :       Dict="absolute"       ,       __lowerCAmelCase :       str=True       ,       __lowerCAmelCase :       Any=False       ,       __lowerCAmelCase :       List[str]=101       ,       __lowerCAmelCase :       int=102       ,       __lowerCAmelCase :       List[Any]=None       ,       **__lowerCAmelCase :       Optional[int]       ,       ):


        """simple docstring"""



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

        if vision_config is None:
              _lowerCAmelCase		 = {}
              logger.info('vision_config is None. initializing the GitVisionConfig with default values.'       )

        _lowerCAmelCase		 = GitVisionConfig(**__a       )
        _lowerCAmelCase		 = vocab_size
        _lowerCAmelCase		 = hidden_size
        _lowerCAmelCase		 = num_hidden_layers
        _lowerCAmelCase		 = num_attention_heads
        _lowerCAmelCase		 = hidden_act
        _lowerCAmelCase		 = intermediate_size
        _lowerCAmelCase		 = hidden_dropout_prob
        _lowerCAmelCase		 = attention_probs_dropout_prob
        _lowerCAmelCase		 = max_position_embeddings
        _lowerCAmelCase		 = initializer_range
        _lowerCAmelCase		 = layer_norm_eps
        _lowerCAmelCase		 = position_embedding_type
        _lowerCAmelCase		 = use_cache
        _lowerCAmelCase		 = tie_word_embeddings
        _lowerCAmelCase		 = num_image_with_embedding

        _lowerCAmelCase		 = bos_token_id
        _lowerCAmelCase		 = eos_token_id



  def 	a (	self :       Optional[int]       ):


        """simple docstring"""



        _lowerCAmelCase		 = copy.deepcopy(self.__dict__       )
        _lowerCAmelCase		 = self.vision_config.to_dict()
        _lowerCAmelCase		 = self.__class__.model_type
        return output










from ..utils import DummyObject, requires_backends





class  lowerCamelCase__	(    metaclass=UpperCAmelCase_):
     """simple docstring"""



     _A      =      ['transformers', 'torch', 'note_seq']







     def __init__(self					,      *__a					,      **__a     ):






           '''simple docstring'''



           requires_backends(self					,      ["transformers", "torch", "note_seq"]     )







     @classmethod
     def     _a   (cls					,      *__a					,      **__a     ):






           '''simple docstring'''



           requires_backends(cls					,      ["transformers", "torch", "note_seq"]     )







     @classmethod
     def     _a   (cls					,      *__a					,      **__a     ):






           '''simple docstring'''



           requires_backends(cls					,      ["transformers", "torch", "note_seq"]     )