


'''simple docstring'''






from collections import OrderedDict
from typing import List, Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


a_   :      Any				    =      logging.get_logger(__name__)

a_   :      Dict				    =      {
    "google/efficientnet-b7": "https://huggingface.co/google/efficientnet-b7/resolve/main/config.json",
}




class 	a       (       _SCREAMING_SNAKE_CASE    ):
 _lowerCAmelCase	   =		"""efficientnet"""
 def __init__(	self ,			__magic_name__ = 3 ,			__magic_name__ = 6_00 ,			__magic_name__ = 2.0 ,			__magic_name__ = 3.1 ,			__magic_name__ = 8 ,			__magic_name__ = [3, 3, 5, 3, 5, 5, 3] ,			__magic_name__ = [32, 16, 24, 40, 80, 1_12, 1_92] ,			__magic_name__ = [16, 24, 40, 80, 1_12, 1_92, 3_20] ,			__magic_name__ = [] ,			__magic_name__ = [1, 2, 2, 2, 1, 2, 1] ,			__magic_name__ = [1, 2, 2, 3, 3, 4, 1] ,			__magic_name__ = [1, 6, 6, 6, 6, 6, 6] ,			__magic_name__ = 0.2_5 ,			__magic_name__ = "swish" ,			__magic_name__ = 25_60 ,			__magic_name__ = "mean" ,			__magic_name__ = 0.0_2 ,			__magic_name__ = 0.0_0_1 ,			__magic_name__ = 0.9_9 ,			__magic_name__ = 0.5 ,			__magic_name__ = 0.2 ,			**__magic_name__ ,			)   ->							List[str]:
      super().__init__(**__magic_name__  )

      _a      =							num_channels
      _a      =							image_size
      _a      =							width_coefficient
      _a      =							depth_coefficient
      _a      =							depth_divisor
      _a      =							kernel_sizes
      _a      =							in_channels
      _a      =							out_channels
      _a      =							depthwise_padding
      _a      =							strides
      _a      =							num_block_repeats
      _a      =							expand_ratios
      _a      =							squeeze_expansion_ratio
      _a      =							hidden_act
      _a      =							hidden_dim
      _a      =							pooling_type
      _a      =							initializer_range
      _a      =							batch_norm_eps
      _a      =							batch_norm_momentum
      _a      =							dropout_rate
      _a      =							drop_connect_rate
      _a      =							sum(__magic_name__  ) * 4





class 	a       (       _SCREAMING_SNAKE_CASE    ):
 _lowerCAmelCase	   =		version.parse("""1.11"""    )
 @property
 def 							__UpperCAmelCase						(	self  )   ->							Mapping[str, Mapping[int, str]]:
      return OrderedDict(
          [
              ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
          ]  )




 @property
 def 							__UpperCAmelCase						(	self  )   ->							float:
      return 1e-5





'''simple docstring'''






import copy
import os
from typing import Union

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


a_   :      List[str]				    =      logging.get_logger(__name__)

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




class 	a       (       _SCREAMING_SNAKE_CASE    ):
 _lowerCAmelCase	   =		"""git_vision_model"""
 def __init__(	self ,			__magic_name__=7_68 ,			__magic_name__=30_72 ,			__magic_name__=12 ,			__magic_name__=12 ,			__magic_name__=3 ,			__magic_name__=2_24 ,			__magic_name__=16 ,			__magic_name__="quick_gelu" ,			__magic_name__=1e-5 ,			__magic_name__=0.0 ,			__magic_name__=0.0_2 ,			**__magic_name__ ,			)   ->							Union[str, Any]:
      super().__init__(**__magic_name__  )

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




 @classmethod
 def 							__UpperCAmelCase						(	cls ,			__magic_name__ ,			**__magic_name__  )   ->							"PretrainedConfig":
      cls._set_token_in_kwargs(__magic_name__  )

      _a ,				_a      =							cls.get_config_dict(__magic_name__ ,			**__magic_name__  )

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





class 	a       (       _SCREAMING_SNAKE_CASE    ):
 _lowerCAmelCase	   =		"""git"""
 def __init__(	self ,			__magic_name__=None ,			__magic_name__=3_05_22 ,			__magic_name__=7_68 ,			__magic_name__=6 ,			__magic_name__=12 ,			__magic_name__=30_72 ,			__magic_name__="gelu" ,			__magic_name__=0.1 ,			__magic_name__=0.1 ,			__magic_name__=10_24 ,			__magic_name__=0.0_2 ,			__magic_name__=1e-12 ,			__magic_name__=0 ,			__magic_name__="absolute" ,			__magic_name__=True ,			__magic_name__=False ,			__magic_name__=1_01 ,			__magic_name__=1_02 ,			__magic_name__=None ,			**__magic_name__ ,			)   ->							Optional[int]:
      super().__init__(bos_token_id=__magic_name__ ,			eos_token_id=__magic_name__ ,			pad_token_id=__magic_name__ ,			**__magic_name__  )

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

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

      _a      =							bos_token_id
      _a      =							eos_token_id




 def 							__UpperCAmelCase						(	self  )   ->							List[str]:
      _a      =							copy.deepcopy(self.__dict__  )
      _a      =							self.vision_config.to_dict()
      _a      =							self.__class__.model_type
      return output

