code: from ...configuration_utils import PretrainedConfig
  from ...utils import logging
  
  
  a     :			List[str]					    =						logging.get_logger(__name__)
  
  a     :			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 				_lowercase						(    lowercase_ ):
  
  
  
  
  
  
      '''simple docstring'''
      SCREAMING_SNAKE_CASE:							Optional[int]        =						"""cpmant"""
  
  
  
  
      def __init__(						self					,	lowerCamelCase__ = 30_720					,	lowerCamelCase__ = 4_096					,	lowerCamelCase__ = 32					,	lowerCamelCase__ = 128					,	lowerCamelCase__ = 10_240					,	lowerCamelCase__ = 48					,	lowerCamelCase__ = 0.0					,	lowerCamelCase__ = 512					,	lowerCamelCase__ = 2_048					,	lowerCamelCase__ = 1E-6					,	lowerCamelCase__ = 1.0					,	lowerCamelCase__ = 32					,	lowerCamelCase__ = 32					,	lowerCamelCase__ = 32					,	lowerCamelCase__ = True					,	**lowerCamelCase__					,	):
         super().__init__(**lowerCamelCase__   )
         lowerCAmelCase_:       Dict         =  prompt_types
         lowerCAmelCase_:       List[Any]         =  prompt_length
         lowerCAmelCase_:       int         =  segment_types
         lowerCAmelCase_:       List[str]         =  hidden_size
         lowerCAmelCase_:       Union[str, Any]         =  num_attention_heads
         lowerCAmelCase_:       int         =  dim_head
         lowerCAmelCase_:       List[Any]         =  dim_ff
         lowerCAmelCase_:       Optional[int]         =  num_hidden_layers
         lowerCAmelCase_:       Optional[int]         =  position_bias_num_buckets
         lowerCAmelCase_:       int         =  position_bias_max_distance
         lowerCAmelCase_:       str         =  dropout_p
         lowerCAmelCase_:       Optional[int]         =  eps
         lowerCAmelCase_:       Tuple         =  use_cache
         lowerCAmelCase_:       str         =  vocab_size
         lowerCAmelCase_:       Optional[int]         =  init_std
style_context: from ctypes import c_float, sizeof
  from enum import Enum
  from typing import TYPE_CHECKING, Optional, Union
  
  
  if TYPE_CHECKING:
   from .. import AutoFeatureExtractor, AutoProcessor, AutoTokenizer  # tests_ignore
  
  class 				_lowercase						(    UpperCAmelCase__ ):
  
  
  
  
  
  
      '''simple docstring'''
      SCREAMING_SNAKE_CASE:							Union[str, Any]        =						c_float
  
  
  
  
      @property
      def     _a						(						self   ):
         return sizeof(self.value   )
  
  
  
  
  
  def 		snake_case__  (		lowercase       ,							lowercase       ,							lowercase = 0				):
     # < 0 is possible if using a dynamic axis
     if dimension <= 0:
        lowerCAmelCase_:       int         =  fixed_dimension
  
     dimension -= num_token_to_add
     return dimension
  def 		snake_case__  (		lowercase       ,							lowercase				):
     return num_parameters * dtype.size
  
  
  
  
  
  
  
  def 		snake_case__  (		lowercase				):
     from .. import AutoFeatureExtractor, AutoProcessor, AutoTokenizer  # tests_ignore
  
     try:
        return AutoProcessor.from_pretrained(lowercase				)
     except (ValueError, OSError, KeyError):
        lowerCAmelCase_     ,  lowerCAmelCase_:       int         =  None, None
        try:
           lowerCAmelCase_:       Dict         =  AutoTokenizer.from_pretrained(lowercase				)
        except (OSError, KeyError):
           pass
        try:
           lowerCAmelCase_:       Optional[int]         =  AutoFeatureExtractor.from_pretrained(lowercase				)
        except (OSError, KeyError):
           pass
  
        if tokenizer is not None and feature_extractor is not None:
           raise ValueError(
               F'''Couldn\'t auto-detect preprocessor for {model_name}. Found both a tokenizer and a feature extractor.'''				)
        elif tokenizer is None and feature_extractor is None:
           return None
        elif tokenizer is not None:
           return tokenizer
        else:
           return feature_extractor