
'''simple docstring'''



import copy

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


UpperCamelCase__ :						int    							=					logging.get_logger(__name__)

class 				_a			(_lowerCamelCase):





       """simple docstring"""




       SCREAMING_SNAKE_CASE =					'hybrid-clip'
       SCREAMING_SNAKE_CASE =					True






       def __init__(							self    ,							A__=5_12    ,							**A__ )      ->     Any:
          super().__init__(**A__ )

          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`.""" )

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

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

          from transformers import AutoConfig

          _SCREAMING_SNAKE_CASE       	=			AutoConfig.for_model(A__    ,							**A__ )

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

             _SCREAMING_SNAKE_CASE       	=			CLIPVisionConfig(**A__ )
          else:
             _SCREAMING_SNAKE_CASE       	=			AutoConfig.for_model(A__    ,							**A__ )

          _SCREAMING_SNAKE_CASE       	=			projection_dim
          _SCREAMING_SNAKE_CASE       	=			1.0






       @classmethod
       def     UpperCamelCase			(							cls    ,							A__    ,							A__    ,							**A__ )      ->     List[Any]:
          return cls(text_config=text_config.to_dict()    ,							vision_config=vision_config.to_dict()    ,							**A__ )






       def     UpperCamelCase			(							self )      ->     Optional[int]:
          _SCREAMING_SNAKE_CASE       	=			copy.deepcopy(self.__dict__ )
          _SCREAMING_SNAKE_CASE       	=			self.text_config.to_dict()
          _SCREAMING_SNAKE_CASE       	=			self.vision_config.to_dict()
          _SCREAMING_SNAKE_CASE       	=			self.__class__.model_type
          return output








'''simple docstring'''



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


UpperCamelCase__ :						int    							=					logging.get_logger(__name__)

UpperCamelCase__ :						Any    							=					{
    "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 				_a			(_lowerCamelCase):





       """simple docstring"""




       SCREAMING_SNAKE_CASE =					'cpmant'






       def __init__(							self    ,							A__ = 3_07_20    ,							A__ = 40_96    ,							A__ = 32    ,							A__ = 1_28    ,							A__ = 1_02_40    ,							A__ = 48    ,							A__ = 0.0    ,							A__ = 5_12    ,							A__ = 20_48    ,							A__ = 1E-6    ,							A__ = 1.0    ,							A__ = 32    ,							A__ = 32    ,							A__ = 32    ,							A__ = True    ,							**A__    ,							)      ->     List[Any]:
          super().__init__(**A__ )
          _SCREAMING_SNAKE_CASE       	=			prompt_types
          _SCREAMING_SNAKE_CASE       	=			prompt_length
          _SCREAMING_SNAKE_CASE       	=			segment_types
          _SCREAMING_SNAKE_CASE       	=			hidden_size
          _SCREAMING_SNAKE_CASE       	=			num_attention_heads
          _SCREAMING_SNAKE_CASE       	=			dim_head
          _SCREAMING_SNAKE_CASE       	=			dim_ff
          _SCREAMING_SNAKE_CASE       	=			num_hidden_layers
          _SCREAMING_SNAKE_CASE       	=			position_bias_num_buckets
          _SCREAMING_SNAKE_CASE       	=			position_bias_max_distance
          _SCREAMING_SNAKE_CASE       	=			dropout_p
          _SCREAMING_SNAKE_CASE       	=			eps
          _SCREAMING_SNAKE_CASE       	=			use_cache
          _SCREAMING_SNAKE_CASE       	=			vocab_size
          _SCREAMING_SNAKE_CASE       	=			init_std






