
from hashlib import mda, shaaaa

_A       =					(shaaaa, mda)







class 	lowerCamelCase						:





     def __init__(self :       str							,       _A :       int = 8  )		->		None:
         snake_case						=   0B0
         snake_case						=   size





     def 						UpperCAmelCase(self :       Union[str, Any]							,       _A :       str  )		->		None:
         snake_case						=   self.hash_(_A  )
         self.bitarray |= h





     def 						UpperCAmelCase(self :       Tuple							,       _A :       str  )		->		bool:
         snake_case						=   self.hash_(_A  )
         return (h & self.bitarray) == h





     def __contains__(self :       Tuple							,       _A :       str  )		->		bool:
         return self.exists(_A  )





     def 						UpperCAmelCase(self :       Tuple							,       _A :       int  )		->		str:
         snake_case						=   bin(_A  )[2:]
         return res.zfill(self.size  )





     @property
     def 						UpperCAmelCase(self :       List[Any]  )		->		str:
         return self.format_bin(self.bitarray  )





     def 						UpperCAmelCase(self :       Optional[Any]							,       _A :       str  )		->		int:
         snake_case						=   0B0
         for func in HASH_FUNCTIONS:
             snake_case						=   (
                 int.from_bytes(func(value.encode()  ).digest()							,       "little"  ) % self.size
             )
             res |= 2**position
         return res





     def 						UpperCAmelCase(self :       Any							,       _A :       str  )		->		str:
         return self.format_bin(self.hash_(_A  )  )





     @property
     def 						UpperCAmelCase(self :       Optional[int]  )		->		float:
         snake_case						=   bin(self.bitarray  ).count("1"  )
         return (n_ones / self.size) ** len(_A  )



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


_A       =					logging.get_logger(__name__)

_A       =					{
    "openbmb/cpm-ant-10b": "https://huggingface.co/openbmb/cpm-ant-10b/blob/main/config.json"
    # See all CPMAnt models at https://huggingface.co/models?filter=cpmant
}







class 	lowerCamelCase						(    A_    ):
     UpperCAmelCase__							:				List[Any] 	=						"cpmant"





     def __init__(self :       List[Any]							,       _A :       int = 3_0_7_2_0							,       _A :       int = 4_0_9_6							,       _A :       int = 3_2							,       _A :       int = 1_2_8							,       _A :       int = 1_0_2_4_0							,       _A :       int = 4_8							,       _A :       int = 0.0							,       _A :       int = 5_1_2							,       _A :       int = 2_0_4_8							,       _A :       int = 1E-6							,       _A :       float = 1.0							,       _A :       int = 3_2							,       _A :       int = 3_2							,       _A :       int = 3_2							,       _A :       bool = True							,       **_A :       Dict							,       )		->		Dict:
         super().__init__(**_A  )
         snake_case						=   prompt_types
         snake_case						=   prompt_length
         snake_case						=   segment_types
         snake_case						=   hidden_size
         snake_case						=   num_attention_heads
         snake_case						=   dim_head
         snake_case						=   dim_ff
         snake_case						=   num_hidden_layers
         snake_case						=   position_bias_num_buckets
         snake_case						=   position_bias_max_distance
         snake_case						=   dropout_p
         snake_case						=   eps
         snake_case						=   use_cache
         snake_case						=   vocab_size
         snake_case						=   init_std

