



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


lowercase_								=     logging.get_logger(__name__)

lowercase_								=     {
    """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__):
				UpperCamelCase__				:					int     		="""gptsan-japanese"""
				UpperCamelCase__				:					str     		=[
				    """past_key_values""",
				]
				UpperCamelCase__				:					Union[str, Any]     		={
				    """hidden_size""": """d_model""",
				    """num_attention_heads""": """num_heads""",
				    """num_hidden_layers""": """num_layers""",
				}




				def __init__(						self					:						str,					__lowercase					:						Any=3_6000,					__lowercase					:						List[str]=1280,					__lowercase					:						int=1024,					__lowercase					:						List[str]=8192,					__lowercase					:						Optional[Any]=4096,					__lowercase					:						Tuple=128,					__lowercase					:						Any=10,					__lowercase					:						Optional[Any]=0,					__lowercase					:						int=16,					__lowercase					:						int=16,					__lowercase					:						Optional[Any]=128,					__lowercase					:						int=0.0,					__lowercase					:						Optional[Any]=1e-5,					__lowercase					:						int=False,					__lowercase					:						Union[str, Any]=0.0,					__lowercase					:						Dict="float32",					__lowercase					:						Any=False,					__lowercase					:						Any=False,					__lowercase					:						Any=False,					__lowercase					:						Any=0.002,					__lowercase					:						int=False,					__lowercase					:						Optional[Any]=True,					__lowercase					:						str=3_5998,					__lowercase					:						List[str]=3_5995,					__lowercase					:						Union[str, Any]=3_5999,					**__lowercase					:						Tuple,					):
							lowercase__					  =				vocab_size
							lowercase__					  =				max_position_embeddings
							lowercase__					  =				d_model
							lowercase__					  =				d_ff
							lowercase__					  =				d_ext
							lowercase__					  =				d_spout
							lowercase__					  =				num_switch_layers
							lowercase__					  =				num_ext_layers
							lowercase__					  =				num_switch_layers + num_ext_layers
							lowercase__					  =				num_heads
							lowercase__					  =				num_experts
							lowercase__					  =				expert_capacity
							lowercase__					  =				dropout_rate
							lowercase__					  =				layer_norm_epsilon
							lowercase__					  =				router_bias
							lowercase__					  =				router_jitter_noise
							lowercase__					  =				router_dtype
							lowercase__					  =				router_ignore_padding_tokens
							lowercase__					  =				output_hidden_states
							lowercase__					  =				output_attentions
							lowercase__					  =				initializer_factor
							lowercase__					  =				output_router_logits
							lowercase__					  =				use_cache

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









from transformers import HfArgumentParser, TensorFlowBenchmark, TensorFlowBenchmarkArguments



def __lowerCAmelCase (     ):
			lowercase__					  =				HfArgumentParser(SCREAMING_SNAKE_CASE_  )
			lowercase__					  =				parser.parse_args_into_dataclasses()[0]
			lowercase__					  =				TensorFlowBenchmark(args=SCREAMING_SNAKE_CASE_  )
			try:
						lowercase__					  =				parser.parse_args_into_dataclasses()[0]
			except ValueError as e:
						lowercase__					  =				"Arg --no_{0} is no longer used, please use --no-{0} instead."
						lowercase__					  =				" ".join(str(SCREAMING_SNAKE_CASE_  ).split(" "  )[:-1]  )
						lowercase__					  =				""
						lowercase__					  =				eval(str(SCREAMING_SNAKE_CASE_  ).split(" "  )[-1]  )
						lowercase__					  =				[]
						for arg in depreciated_args:
									# arg[2:] removes '--'
									if arg[2:] in TensorFlowBenchmark.deprecated_args:
												# arg[5:] removes '--no_'
												full_error_msg += arg_error_msg.format(arg[5:]  )
									else:
												wrong_args.append(SCREAMING_SNAKE_CASE_  )
						if len(SCREAMING_SNAKE_CASE_  ) > 0:
									lowercase__					  =				full_error_msg + begin_error_msg + str(SCREAMING_SNAKE_CASE_  )
						raise ValueError(SCREAMING_SNAKE_CASE_  )
			benchmark.run()


if __name__ == "__main__":
							main()




