
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


__A							=logging.get_logger(__name__)

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




class        _SCREAMING_SNAKE_CASE	( snake_case_		):
	lowerCAmelCase__   =					'instructblip_vision_model'



	def __init__(       self		,    lowercase=1408		,    lowercase=6144		,    lowercase=39		,    lowercase=16		,    lowercase=224		,    lowercase=14		,    lowercase="gelu"		,    lowercase=1e-6		,    lowercase=0.0		,    lowercase=1e-10		,    lowercase=True		,    **lowercase		,    )							->			List[str]:
					super().__init__(**lowercase					)

					lowerCamelCase_         =     hidden_size
					lowerCamelCase_         =     intermediate_size
					lowerCamelCase_         =     num_hidden_layers
					lowerCamelCase_         =     num_attention_heads
					lowerCamelCase_         =     patch_size
					lowerCamelCase_         =     image_size
					lowerCamelCase_         =     initializer_range
					lowerCamelCase_         =     attention_dropout
					lowerCamelCase_         =     layer_norm_eps
					lowerCamelCase_         =     hidden_act
					lowerCamelCase_         =     qkv_bias



	@classmethod
	def        SCREAMING_SNAKE_CASE_(       cls		,    lowercase		,    **lowercase					)							->			"PretrainedConfig":
					cls._set_token_in_kwargs(lowercase					)

					lowerCamelCase_      ,       lowerCamelCase_         =     cls.get_config_dict(lowercase		,    **lowercase					)

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




class        _SCREAMING_SNAKE_CASE	( snake_case_		):
	lowerCAmelCase__   =					'instructblip_qformer'



	def __init__(       self		,    lowercase=30522		,    lowercase=768		,    lowercase=12		,    lowercase=12		,    lowercase=3072		,    lowercase="gelu"		,    lowercase=0.1		,    lowercase=0.1		,    lowercase=512		,    lowercase=0.0_2		,    lowercase=1e-12		,    lowercase=0		,    lowercase="absolute"		,    lowercase=2		,    lowercase=1408		,    **lowercase		,    )							->			str:
					super().__init__(pad_token_id=lowercase		,    **lowercase					)

					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_         =     cross_attention_frequency
					lowerCamelCase_         =     encoder_hidden_size



	@classmethod
	def        SCREAMING_SNAKE_CASE_(       cls		,    lowercase		,    **lowercase					)							->			"PretrainedConfig":
					cls._set_token_in_kwargs(lowercase					)

					lowerCamelCase_      ,       lowerCamelCase_         =     cls.get_config_dict(lowercase		,    **lowercase					)

					# get the qformer config dict if we are loading from InstructBlipConfig
					if config_dict.get("model_type"					) == "instructblip":
									lowerCamelCase_         =     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(lowercase		,    **lowercase					)




class        _SCREAMING_SNAKE_CASE	( snake_case_		):
	lowerCAmelCase__   =					'instructblip'
	lowerCAmelCase__   =					True



	def __init__(       self		,    lowercase=None		,    lowercase=None		,    lowercase=None		,    lowercase=32		,    **lowercase					)							->			Optional[int]:
					super().__init__(**lowercase					)

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

					if qformer_config is None:
									lowerCamelCase_         =     {}
									logger.info("qformer_config is None. Initializing the InstructBlipQFormerConfig with default values."					)

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

					lowerCamelCase_         =     InstructBlipVisionConfig(**lowercase					)
					lowerCamelCase_         =     InstructBlipQFormerConfig(**lowercase					)
					lowerCamelCase_         =     text_config["model_type"] if "model_type" in text_config else "opt"
					lowerCamelCase_         =     CONFIG_MAPPING[text_model_type](**lowercase					)

					lowerCamelCase_         =     self.text_config.tie_word_embeddings
					lowerCamelCase_         =     self.text_config.is_encoder_decoder

					lowerCamelCase_         =     num_query_tokens
					lowerCamelCase_         =     self.vision_config.hidden_size
					lowerCamelCase_         =     self.text_config.model_type in MODEL_FOR_CAUSAL_LM_MAPPING_NAMES
					lowerCamelCase_         =     1.0
					lowerCamelCase_         =     0.0_2



	@classmethod
	def        SCREAMING_SNAKE_CASE_(       cls		,    lowercase		,    lowercase		,    lowercase		,    **lowercase		,    )							->			Dict:
					return cls(
					    vision_config=vision_config.to_dict()		,    qformer_config=qformer_config.to_dict()		,    text_config=text_config.to_dict()		,    **lowercase		,    )



	def        SCREAMING_SNAKE_CASE_(       self					)							->			Optional[int]:
					lowerCamelCase_         =     copy.deepcopy(self.__dict__					)
					lowerCamelCase_         =     self.vision_config.to_dict()
					lowerCamelCase_         =     self.qformer_config.to_dict()
					lowerCamelCase_         =     self.text_config.to_dict()
					lowerCamelCase_         =     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''')


