






"""simple docstring"""







import copy

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


lowerCAmelCase_		:			Dict				   =					logging.get_logger(__name__)





class      UpperCamelCase_       (				a_     ):
  _A				:    List[str] =		'hybrid-clip'
  _A				:    Tuple =		True



  def __init__(					self       ,						snake_case__=5_12       ,						**snake_case__ )	->	Optional[int]:



         """simple docstring"""





         super().__init__(**snake_case__ )

         if "text_config" not in kwargs:
                raise ValueError("""`text_config` can not be `None`.""" )

         if "vision_config" not in kwargs:
                raise ValueError("""`vision_config` can not be `None`.""" )

         UpperCAmelCase					=	kwargs.pop("""text_config""" )
         UpperCAmelCase					=	kwargs.pop("""vision_config""" )

         UpperCAmelCase					=	text_config.pop("""model_type""" )
         UpperCAmelCase					=	vision_config.pop("""model_type""" )

         from transformers import AutoConfig

         UpperCAmelCase					=	AutoConfig.for_model(snake_case__       ,						**snake_case__ )

         if vision_model_type == "clip":
                UpperCAmelCase					=	AutoConfig.for_model(snake_case__       ,						**snake_case__ ).vision_config
         elif vision_model_type == "clip_vision_model":
                from transformers import CLIPVisionConfig

                UpperCAmelCase					=	CLIPVisionConfig(**snake_case__ )
         else:
                UpperCAmelCase					=	AutoConfig.for_model(snake_case__       ,						**snake_case__ )

         UpperCAmelCase					=	projection_dim
         UpperCAmelCase					=	1.0



  @classmethod
  def 						UpperCamelCase_ (					cls       ,						snake_case__       ,						snake_case__       ,						**snake_case__ )	->	Optional[Any]:



         """simple docstring"""





         return cls(text_config=text_config.to_dict()       ,						vision_config=vision_config.to_dict()       ,						**snake_case__ )



  def 						UpperCamelCase_ (					self )	->	List[Any]:



         """simple docstring"""





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








"""simple docstring"""







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


lowerCAmelCase_		:			str				   =					logging.get_logger(__name__)

lowerCAmelCase_		:			Optional[int]				   =					{
    '''google/reformer-crime-and-punishment''': (
        '''https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/config.json'''
    ),
    '''google/reformer-enwik8''': '''https://huggingface.co/google/reformer-enwik8/resolve/main/config.json''',
}





class      UpperCamelCase_       (				a_     ):
  _A				:    int =		'reformer'
  _A				:    Any =		['past_buckets_states']
  _A				:    Optional[Any] =		{}



  def __init__(					self       ,						snake_case__=64       ,						snake_case__=["local", "lsh", "local", "lsh", "local", "lsh"]       ,						snake_case__=1.0       ,						snake_case__=True       ,						snake_case__=[64, 64]       ,						snake_case__=[64, 1_92]       ,						snake_case__=0       ,						snake_case__=2       ,						snake_case__=5_12       ,						snake_case__=None       ,						snake_case__="relu"       ,						snake_case__=0.05       ,						snake_case__=2_56       ,						snake_case__=0.02       ,						snake_case__=False       ,						snake_case__=1e-12       ,						snake_case__=1       ,						snake_case__=0       ,						snake_case__=0.05       ,						snake_case__=64       ,						snake_case__=64       ,						snake_case__=0.0       ,						snake_case__=1       ,						snake_case__=0       ,						snake_case__=40_96       ,						snake_case__=12       ,						snake_case__=None       ,						snake_case__=1       ,						snake_case__=0       ,						snake_case__=3_20       ,						snake_case__=False       ,						snake_case__=True       ,						snake_case__=None       ,						**snake_case__       ,						)	->	List[Any]:



         """simple docstring"""





         UpperCAmelCase					=	hash_seed
         UpperCAmelCase					=	vocab_size
         UpperCAmelCase					=	attention_head_size
         UpperCAmelCase					=	hidden_size
         UpperCAmelCase					=	num_attention_heads
         UpperCAmelCase					=	num_hashes
         UpperCAmelCase					=	len(snake_case__ )
         UpperCAmelCase					=	tuple(snake_case__ ) if isinstance(snake_case__       ,						snake_case__ ) else num_buckets
         UpperCAmelCase					=	lsh_attn_chunk_length
         UpperCAmelCase					=	local_attn_chunk_length
         UpperCAmelCase					=	lsh_num_chunks_after
         UpperCAmelCase					=	lsh_num_chunks_before
         UpperCAmelCase					=	local_num_chunks_after
         UpperCAmelCase					=	local_num_chunks_before
         UpperCAmelCase					=	hidden_act
         UpperCAmelCase					=	feed_forward_size
         UpperCAmelCase					=	hidden_dropout_prob
         UpperCAmelCase					=	lsh_attention_probs_dropout_prob
         UpperCAmelCase					=	local_attention_probs_dropout_prob
         UpperCAmelCase					=	max_position_embeddings
         UpperCAmelCase					=	initializer_range
         UpperCAmelCase					=	layer_norm_eps
         UpperCAmelCase					=	axial_pos_embds
         UpperCAmelCase					=	tuple(snake_case__ )
         UpperCAmelCase					=	tuple(snake_case__ )
         UpperCAmelCase					=	axial_norm_std
         UpperCAmelCase					=	chunk_size_lm_head
         UpperCAmelCase					=	attn_layers
         UpperCAmelCase					=	use_cache
         UpperCAmelCase					=	classifier_dropout
         super().__init__(
             pad_token_id=snake_case__       ,						eos_token_id=snake_case__       ,						is_decoder=snake_case__       ,						tie_word_embeddings=snake_case__       ,						**snake_case__       ,						)
