


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


_UpperCAmelCase			:  Dict     =logging.get_logger(__name__)

_UpperCAmelCase			:  Optional[Any]     ={
    """tanreinama/GPTSAN-2.8B-spout_is_uniform""": (
        """https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json"""
    ),
}







class 				snake_case__(							lowercase__							):







      '''simple docstring'''




      SCREAMING_SNAKE_CASE__      :  int					=							"""gptsan-japanese"""
      SCREAMING_SNAKE_CASE__      :  str					=							[
          """past_key_values""",
      ]
      SCREAMING_SNAKE_CASE__      :  Union[str, Any]					=							{
          """hidden_size""": """d_model""",
          """num_attention_heads""": """num_heads""",
          """num_hidden_layers""": """num_layers""",
      }




      def __init__(				self   ,						__lowercase=3_6_0_0_0   ,						__lowercase=1_2_8_0   ,						__lowercase=1_0_2_4   ,						__lowercase=8_1_9_2   ,						__lowercase=4_0_9_6   ,						__lowercase=1_2_8   ,						__lowercase=1_0   ,						__lowercase=0   ,						__lowercase=1_6   ,						__lowercase=1_6   ,						__lowercase=1_2_8   ,						__lowercase=0.0   ,						__lowercase=1e-5   ,						__lowercase=False   ,						__lowercase=0.0   ,						__lowercase="float32"   ,						__lowercase=False   ,						__lowercase=False   ,						__lowercase=False   ,						__lowercase=0.0_02   ,						__lowercase=False   ,						__lowercase=True   ,						__lowercase=3_5_9_9_8   ,						__lowercase=3_5_9_9_5   ,						__lowercase=3_5_9_9_9   ,						**__lowercase   ,						)					->    str:
          lowerCAmelCase_ :      Any    				=				vocab_size
          lowerCAmelCase_ :      Any    				=				max_position_embeddings
          lowerCAmelCase_ :      str    				=				d_model
          lowerCAmelCase_ :      int    				=				d_ff
          lowerCAmelCase_ :      Optional[int]    				=				d_ext
          lowerCAmelCase_ :      int    				=				d_spout
          lowerCAmelCase_ :      Dict    				=				num_switch_layers
          lowerCAmelCase_ :      Any    				=				num_ext_layers
          lowerCAmelCase_ :      Dict    				=				num_switch_layers + num_ext_layers
          lowerCAmelCase_ :      List[str]    				=				num_heads
          lowerCAmelCase_ :      Tuple    				=				num_experts
          lowerCAmelCase_ :      Dict    				=				expert_capacity
          lowerCAmelCase_ :      Optional[Any]    				=				dropout_rate
          lowerCAmelCase_ :      Dict    				=				layer_norm_epsilon
          lowerCAmelCase_ :      Optional[Any]    				=				router_bias
          lowerCAmelCase_ :      str    				=				router_jitter_noise
          lowerCAmelCase_ :      List[Any]    				=				router_dtype
          lowerCAmelCase_ :      Optional[Any]    				=				router_ignore_padding_tokens
          lowerCAmelCase_ :      Any    				=				output_hidden_states
          lowerCAmelCase_ :      int    				=				output_attentions
          lowerCAmelCase_ :      Tuple    				=				initializer_factor
          lowerCAmelCase_ :      Tuple    				=				output_router_logits
          lowerCAmelCase_ :      int    				=				use_cache

          super().__init__(
              separator_token_id=__lowercase   ,						pad_token_id=__lowercase   ,						eos_token_id=__lowercase   ,						**__lowercase   ,						)



import inspect
import re

from transformers.utils import direct_transformers_import


# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_config_docstrings.py
_UpperCAmelCase			:  Any     ="""src/transformers"""


# This is to make sure the transformers module imported is the one in the repo.
_UpperCAmelCase			:  Optional[Any]     =direct_transformers_import(PATH_TO_TRANSFORMERS)

_UpperCAmelCase			:  List[str]     =transformers.models.auto.configuration_auto.CONFIG_MAPPING

# Regex pattern used to find the checkpoint mentioned in the docstring of `config_class`.
# For example, `[bert-base-uncased](https://huggingface.co/bert-base-uncased)`
_UpperCAmelCase			:  Dict     =re.compile(R"""\[(.+?)\]\((https://huggingface\.co/.+?)\)""")


_UpperCAmelCase			:  Any     ={
    """DecisionTransformerConfig""",
    """EncoderDecoderConfig""",
    """MusicgenConfig""",
    """RagConfig""",
    """SpeechEncoderDecoderConfig""",
    """TimmBackboneConfig""",
    """VisionEncoderDecoderConfig""",
    """VisionTextDualEncoderConfig""",
    """LlamaConfig""",
}



def 			lowerCAmelCase (		lowerCAmelCase_ )-> str:
				lowerCAmelCase_ :      Any    				=				None

				# source code of `config_class`
				lowerCAmelCase_ :      Optional[int]    				=				inspect.getsource(lowerCAmelCase_ )
				lowerCAmelCase_ :      str    				=				_re_checkpoint.findall(lowerCAmelCase_ )

				# Each `checkpoint` is a tuple of a checkpoint name and a checkpoint link.
				# For example, `('bert-base-uncased', 'https://huggingface.co/bert-base-uncased')`
				for ckpt_name, ckpt_link in checkpoints:
								# allow the link to end with `/`
								if ckpt_link.endswith('''/''' ):
												lowerCAmelCase_ :      Optional[Any]    				=				ckpt_link[:-1]

								# verify the checkpoint name corresponds to the checkpoint link
								lowerCAmelCase_ :      Tuple    				=				f"""https://huggingface.co/{ckpt_name}"""
								if ckpt_link == ckpt_link_from_name:
												lowerCAmelCase_ :      List[str]    				=				ckpt_name
												break

				return checkpoint



def 			lowerCAmelCase (		)-> Optional[Any]:
				lowerCAmelCase_ :      Tuple    				=				[]

				for config_class in list(CONFIG_MAPPING.values() ):
								# Skip deprecated models
								if "models.deprecated" in config_class.__module__:
												continue
								lowerCAmelCase_ :      int    				=				get_checkpoint_from_config_class(lowerCAmelCase_ )

								lowerCAmelCase_ :      Tuple    				=				config_class.__name__
								if checkpoint is None and name not in CONFIG_CLASSES_TO_IGNORE_FOR_DOCSTRING_CHECKPOINT_CHECK:
												configs_without_checkpoint.append(lowerCAmelCase_ )

				if len(lowerCAmelCase_ ) > 0:
								lowerCAmelCase_ :      List[Any]    				=				'''\n'''.join(sorted(lowerCAmelCase_ ) )
								raise ValueError(f"""The following configurations don't contain any valid checkpoint:\n{message}""" )


if __name__ == "__main__":
						check_config_docstrings_have_checkpoints()