



"""simple docstring"""




import copy
import os
from typing import Union

from ...configuration_utils import PretrainedConfig
from ...models.auto.modeling_auto import MODEL_FOR_CAUSAL_LM_MAPPING_NAMES
from ...utils import logging
from ..auto import CONFIG_MAPPING


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

_UpperCamelCase: Optional[Any]										=     {
    'salesforce/blip2-opt-2.7b': 'https://huggingface.co/salesforce/blip2-opt-2.7b/resolve/main/config.json',
}


class      a__						(  A__   ):
   _lowerCamelCase    							= 'blip_2_vision_model'


   def __init__(							self					:							str,   lowerCAmelCase					:							str=1408,   lowerCAmelCase					:							List[Any]=6144,   lowerCAmelCase					:							Optional[Any]=39,   lowerCAmelCase					:							Any=16,   lowerCAmelCase					:							Optional[int]=224,   lowerCAmelCase					:							Optional[int]=14,   lowerCAmelCase					:							List[Any]="gelu",   lowerCAmelCase					:							Any=0.0_0001,   lowerCAmelCase					:							List[str]=0.0,   lowerCAmelCase					:							Any=1e-10,   lowerCAmelCase					:							Tuple=True,   **lowerCAmelCase					:							str,   )			->				Any:
         super().__init__(**UpperCamelCase_	)

         lowercase     :					List[Any] 		=      hidden_size
         lowercase     :					int 		=      intermediate_size
         lowercase     :					Tuple 		=      num_hidden_layers
         lowercase     :					Dict 		=      num_attention_heads
         lowercase     :					List[str] 		=      patch_size
         lowercase     :					Optional[Any] 		=      image_size
         lowercase     :					Any 		=      initializer_range
         lowercase     :					int 		=      attention_dropout
         lowercase     :					str 		=      layer_norm_eps
         lowercase     :					Optional[int] 		=      hidden_act
         lowercase     :					List[str] 		=      qkv_bias






   @classmethod
   def 				lowercase (							cls					:							Optional[int],   lowerCAmelCase					:							Dict,   **lowerCAmelCase					:							Tuple	)			->				Any:
         cls._set_token_in_kwargs(UpperCamelCase_	)

         lowercase     :					List[Any] 		=      cls.get_config_dict(UpperCamelCase_,   **UpperCamelCase_	)

         # get the vision config dict if we are loading from Blip2Config
         if config_dict.get('model_type'	) == "blip-2":
               lowercase     :					Tuple 		=      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__						(  A__   ):
   _lowerCamelCase    							= 'blip_2_qformer'


   def __init__(							self					:							str,   lowerCAmelCase					:							Optional[Any]=30522,   lowerCAmelCase					:							List[Any]=768,   lowerCAmelCase					:							Dict=12,   lowerCAmelCase					:							Any=12,   lowerCAmelCase					:							List[Any]=3072,   lowerCAmelCase					:							int="gelu",   lowerCAmelCase					:							Any=0.1,   lowerCAmelCase					:							List[str]=0.1,   lowerCAmelCase					:							List[str]=512,   lowerCAmelCase					:							Optional[Any]=0.02,   lowerCAmelCase					:							List[str]=1e-12,   lowerCAmelCase					:							Optional[int]=0,   lowerCAmelCase					:							Union[str, Any]="absolute",   lowerCAmelCase					:							Optional[int]=2,   lowerCAmelCase					:							Union[str, Any]=1408,   **lowerCAmelCase					:							List[Any],   )			->				Dict:
         super().__init__(pad_token_id=UpperCamelCase_,   **UpperCamelCase_	)

         lowercase     :					str 		=      vocab_size
         lowercase     :					Tuple 		=      hidden_size
         lowercase     :					List[Any] 		=      num_hidden_layers
         lowercase     :					List[str] 		=      num_attention_heads
         lowercase     :					Dict 		=      hidden_act
         lowercase     :					Any 		=      intermediate_size
         lowercase     :					Optional[Any] 		=      hidden_dropout_prob
         lowercase     :					List[str] 		=      attention_probs_dropout_prob
         lowercase     :					str 		=      max_position_embeddings
         lowercase     :					Union[str, Any] 		=      initializer_range
         lowercase     :					Dict 		=      layer_norm_eps
         lowercase     :					Union[str, Any] 		=      position_embedding_type
         lowercase     :					str 		=      cross_attention_frequency
         lowercase     :					List[str] 		=      encoder_hidden_size






   @classmethod
   def 				lowercase (							cls					:							str,   lowerCAmelCase					:							Union[str, Any],   **lowerCAmelCase					:							int	)			->				Union[str, Any]:
         cls._set_token_in_kwargs(UpperCamelCase_	)

         lowercase     :					str 		=      cls.get_config_dict(UpperCamelCase_,   **UpperCamelCase_	)

         # get the qformer config dict if we are loading from Blip2Config
         if config_dict.get('model_type'	) == "blip-2":
               lowercase     :					Any 		=      config_dict['''qformer_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__						(  A__   ):
   _lowerCamelCase    							= 'blip-2'
   _lowerCamelCase    							= True


   def __init__(							self					:							Any,   lowerCAmelCase					:							Any=None,   lowerCAmelCase					:							Union[str, Any]=None,   lowerCAmelCase					:							Dict=None,   lowerCAmelCase					:							Dict=32,   **lowerCAmelCase					:							Tuple	)			->				Any:
         super().__init__(**UpperCamelCase_	)

         if vision_config is None:
               lowercase     :					Optional[int] 		=      {}
               logger.info('vision_config is None. initializing the Blip2VisionConfig with default values.'	)

         if qformer_config is None:
               lowercase     :					int 		=      {}
               logger.info('qformer_config is None. Initializing the Blip2QFormerConfig with default values.'	)

         if text_config is None:
               lowercase     :					List[str] 		=      {}
               logger.info('text_config is None. Initializing the text config with default values (`OPTConfig`).'	)

         lowercase     :					Any 		=      BlipaVisionConfig(**UpperCamelCase_	)
         lowercase     :					List[str] 		=      BlipaQFormerConfig(**UpperCamelCase_	)
         lowercase     :					Optional[int] 		=      text_config['''model_type'''] if '''model_type''' in text_config else '''opt'''
         lowercase     :					Any 		=      CONFIG_MAPPING[text_model_type](**UpperCamelCase_	)

         lowercase     :					List[str] 		=      self.text_config.tie_word_embeddings
         lowercase     :					int 		=      self.text_config.is_encoder_decoder

         lowercase     :					List[str] 		=      num_query_tokens
         lowercase     :					Optional[int] 		=      self.vision_config.hidden_size
         lowercase     :					Any 		=      self.text_config.model_type in MODEL_FOR_CAUSAL_LM_MAPPING_NAMES
         lowercase     :					Optional[Any] 		=      1.0
         lowercase     :					List[Any] 		=      0.02


   @classmethod
   def 				lowercase (							cls					:							List[Any],   lowerCAmelCase					:							Optional[Any],   lowerCAmelCase					:							Optional[Any],   lowerCAmelCase					:							List[Any],   **lowerCAmelCase					:							List[Any],   )			->				Dict:
         return cls(
             vision_config=vision_config.to_dict(),   qformer_config=qformer_config.to_dict(),   text_config=text_config.to_dict(),   **UpperCamelCase_,   )






   def 				lowercase (							self					:							str	)			->				Optional[int]:
         lowercase     :					str 		=      copy.deepcopy(self.__dict__	)
         lowercase     :					List[str] 		=      self.vision_config.to_dict()
         lowercase     :					Dict 		=      self.qformer_config.to_dict()
         lowercase     :					List[Any] 		=      self.text_config.to_dict()
         lowercase     :					Dict 		=      self.__class__.model_type
         return output




'''simple docstring'''
def 			a      (			)  ->	Union[str, Any]:



					'''simple docstring'''






					UpperCamelCase__   :Optional[int]												= []
					UpperCamelCase__   :int												= 1

					while len(__a   ) < 1e6:
										constant.append(str(__a   )   )
										i += 1

					UpperCamelCase__   :Union[str, Any]												= ''''''.join(__a   )

					return (
					    int(constant[0]   )
					    * int(constant[9]   )
					    * int(constant[99]   )
					    * int(constant[999]   )
					    * int(constant[9999]   )
					    * int(constant[99999]   )
					    * int(constant[999999]   )
					)


if __name__ == "__main__":
		print(solution())