

'''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


__SCREAMING_SNAKE_CASE     =						logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE     =						{
    'Salesforce/instruct-blip-flan-t5': 'https://huggingface.co/Salesforce/instruct-blip-flan-t5/resolve/main/config.json',
}






class 			lowerCAmelCase__     (					snake_case_						):




     """simple docstring"""





     __UpperCamelCase									= "instructblip_vision_model"







     def __init__(		self						:	str      ,						A__						:	Union[str, Any]=1_4_0_8      ,						A__						:	Tuple=6_1_4_4      ,						A__						:	Dict=3_9      ,						A__						:	str=1_6      ,						A__						:	List[Any]=2_2_4      ,						A__						:	int=1_4      ,						A__						:	Dict="gelu"      ,						A__						:	str=1E-6      ,						A__						:	Dict=0.0      ,						A__						:	Dict=1E-10      ,						A__						:	List[str]=True      ,						**A__						:	Optional[Any]      ,						)       ->			List[str]:
          '''simple docstring'''




          super().__init__(**A__	)

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







     @classmethod
     def 			__lowerCAmelCase	(		cls						:	Any      ,						A__						:	List[Any]      ,						**A__						:	int	)       ->			"PretrainedConfig":
          '''simple docstring'''




          cls._set_token_in_kwargs(A__	)

          a__     ,    a__   :      Dict     =						cls.get_config_dict(A__      ,						**A__	)

          # get the vision config dict if we are loading from InstructBlipConfig
          if config_dict.get('''model_type'''	) == "instructblip":
               a__   :      Dict     =						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 			lowerCAmelCase__     (					snake_case_						):




     """simple docstring"""





     __UpperCamelCase									= "instructblip_qformer"







     def __init__(		self						:	int      ,						A__						:	Optional[Any]=3_0_5_2_2      ,						A__						:	List[str]=7_6_8      ,						A__						:	Tuple=1_2      ,						A__						:	List[Any]=1_2      ,						A__						:	Any=3_0_7_2      ,						A__						:	Optional[Any]="gelu"      ,						A__						:	Union[str, Any]=0.1      ,						A__						:	Optional[int]=0.1      ,						A__						:	Any=5_1_2      ,						A__						:	str=0.02      ,						A__						:	str=1E-12      ,						A__						:	Any=0      ,						A__						:	Optional[Any]="absolute"      ,						A__						:	Optional[int]=2      ,						A__						:	str=1_4_0_8      ,						**A__						:	Tuple      ,						)       ->			str:
          '''simple docstring'''




          super().__init__(pad_token_id=A__      ,						**A__	)

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







     @classmethod
     def 			__lowerCAmelCase	(		cls						:	Optional[Any]      ,						A__						:	int      ,						**A__						:	int	)       ->			"PretrainedConfig":
          '''simple docstring'''




          cls._set_token_in_kwargs(A__	)

          a__     ,    a__   :      List[Any]     =						cls.get_config_dict(A__      ,						**A__	)

          # get the qformer config dict if we are loading from InstructBlipConfig
          if config_dict.get('''model_type'''	) == "instructblip":
               a__   :      Union[str, 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(A__      ,						**A__	)






class 			lowerCAmelCase__     (					snake_case_						):




     """simple docstring"""





     __UpperCamelCase									= "instructblip"
     __UpperCamelCase									= True







     def __init__(		self						:	str      ,						A__						:	int=None      ,						A__						:	int=None      ,						A__						:	List[Any]=None      ,						A__						:	int=3_2      ,						**A__						:	Tuple	)       ->			Optional[int]:
          '''simple docstring'''




          super().__init__(**A__	)

          if vision_config is None:
               a__   :      Dict     =						{}
               logger.info('''vision_config is None. initializing the InstructBlipVisionConfig with default values.'''	)

          if qformer_config is None:
               a__   :      List[Any]     =						{}
               logger.info('''qformer_config is None. Initializing the InstructBlipQFormerConfig with default values.'''	)

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

          a__   :      Tuple     =						InstructBlipVisionConfig(**A__	)
          a__   :      Tuple     =						InstructBlipQFormerConfig(**A__	)
          a__   :      Optional[Any]     =						text_config['''model_type'''] if '''model_type''' in text_config else '''opt'''
          a__   :      Optional[Any]     =						CONFIG_MAPPING[text_model_type](**A__	)

          a__   :      Dict     =						self.text_config.tie_word_embeddings
          a__   :      Any     =						self.text_config.is_encoder_decoder

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







     @classmethod
     def 			__lowerCAmelCase	(		cls						:	Tuple      ,						A__						:	List[Any]      ,						A__						:	Union[str, Any]      ,						A__						:	Optional[Any]      ,						**A__						:	Union[str, Any]      ,						)       ->			Dict:
          '''simple docstring'''




          return cls(
              vision_config=vision_config.to_dict()      ,						qformer_config=qformer_config.to_dict()      ,						text_config=text_config.to_dict()      ,						**A__      ,						)







     def 			__lowerCAmelCase	(		self						:	List[str]	)       ->			Optional[int]:
          '''simple docstring'''




          a__   :      Optional[int]     =						copy.deepcopy(self.__dict__	)
          a__   :      Any     =						self.vision_config.to_dict()
          a__   :      Tuple     =						self.qformer_config.to_dict()
          a__   :      Optional[Any]     =						self.text_config.to_dict()
          a__   :      Union[str, Any]     =						self.__class__.model_type
          return output


import math





def      lowerCamelCase_					(							lowerCamelCase__      ,					lowerCamelCase__       ):
				if 0 not in (x, y):
								# We use the relation x^y = y*log10(x), where 10 is the base.
								return y * math.logaa(lowerCamelCase__       )
				else:
								if x == 0:  # 0 raised to any number is 0
												return 0
								elif y == 0:
												return 1  # any number raised to 0 is 1
				raise AssertionError("This should never happen"       )


if __name__ == "__main__":  # Main function
			# Read two numbers from input and typecast them to int using map function.
			# Here x is the base and y is the power.
			__A							='''Enter the base and the power separated by a comma: '''
			__A,		__A							=map(int, input(prompt).split(''','''))
			__A,		__A							=map(int, input(prompt).split(''','''))

			# We find the log of each number, using the function res(), which takes two
			# arguments.
			__A							=res(xa, ya)
			__A							=res(xa, ya)

			# We check for the largest number
			if resa > resa:
						print('''Largest number is''', xa, '''^''', ya)
			elif resa > resa:
						print('''Largest number is''', xa, '''^''', ya)
			else:
						print('''Both are equal''')


