


"""simple docstring"""
import copy
import os
from typing import Union

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


__SCREAMING_SNAKE_CASE							:      Union[str, Any]						=      logging.get_logger(__name__)

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





class        __A       (snake_case__):





							'''simple docstring'''

							__lowercase:						Tuple							 =      """git_vision_model"""



							def __init__(			self							: Union[str, Any]						,    UpperCAmelCase_							: Tuple=768						,    UpperCAmelCase_							: List[str]=3_072						,    UpperCAmelCase_							: List[Any]=12						,    UpperCAmelCase_							: Dict=12						,    UpperCAmelCase_							: Optional[Any]=3						,    UpperCAmelCase_							: Optional[Any]=224						,    UpperCAmelCase_							: Tuple=16						,    UpperCAmelCase_							: Optional[Any]="quick_gelu"						,    UpperCAmelCase_							: List[Any]=1E-5						,    UpperCAmelCase_							: Dict=0.0						,    UpperCAmelCase_							: str=0.02						,    **UpperCAmelCase_							: Union[str, Any]						,    )   ->List[Any]:



														"""simple docstring"""



														super().__init__(**UpperCAmelCase_    )

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



							@classmethod
							def 						lowerCAmelCase    (			cls							: List[Any]						,    UpperCAmelCase_							: Union[str, os.PathLike]						,    **UpperCAmelCase_							: Any    )   ->"PretrainedConfig":



														"""simple docstring"""



														cls._set_token_in_kwargs(UpperCAmelCase_    )

														snake_case_    ,  snake_case_          =						cls.get_config_dict(UpperCAmelCase_						,    **UpperCAmelCase_    )

														# get the vision config dict if we are loading from GITConfig
														if config_dict.get("""model_type"""    ) == "git":
																					snake_case_          =						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(UpperCAmelCase_						,    **UpperCAmelCase_    )





class        __A       (snake_case__):





							'''simple docstring'''

							__lowercase:						Optional[int]							 =      """git"""



							def __init__(			self							: List[str]						,    UpperCAmelCase_							: str=None						,    UpperCAmelCase_							: int=30_522						,    UpperCAmelCase_							: Any=768						,    UpperCAmelCase_							: Optional[int]=6						,    UpperCAmelCase_							: Tuple=12						,    UpperCAmelCase_							: Optional[Any]=3_072						,    UpperCAmelCase_							: Dict="gelu"						,    UpperCAmelCase_							: Any=0.1						,    UpperCAmelCase_							: Union[str, Any]=0.1						,    UpperCAmelCase_							: int=1_024						,    UpperCAmelCase_							: Union[str, Any]=0.02						,    UpperCAmelCase_							: Optional[int]=1E-12						,    UpperCAmelCase_							: Tuple=0						,    UpperCAmelCase_							: Tuple="absolute"						,    UpperCAmelCase_							: int=True						,    UpperCAmelCase_							: Union[str, Any]=False						,    UpperCAmelCase_							: List[str]=101						,    UpperCAmelCase_							: str=102						,    UpperCAmelCase_							: Optional[int]=None						,    **UpperCAmelCase_							: List[Any]						,    )   ->Tuple:



														"""simple docstring"""



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

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

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

														snake_case_          =						bos_token_id
														snake_case_          =						eos_token_id



							def 						lowerCAmelCase    (			self							: Optional[Any]    )   ->Tuple:



														"""simple docstring"""



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







"""simple docstring"""
def   _a			( _SCREAMING_SNAKE_CASE			)      ->			int:
							assert column_title.isupper()
							snake_case_          =						0
							snake_case_          =						len(_SCREAMING_SNAKE_CASE			) - 1
							snake_case_          =						0

							while index >= 0:
														snake_case_          =						(ord(column_title[index]			) - 64) * pow(26			,	_SCREAMING_SNAKE_CASE			)
														answer += value
														power += 1
														index -= 1

							return answer


if __name__ == "__main__":
				from doctest import testmod

				testmod()



