



'''simple docstring'''

# Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from argparse import ArgumentParser

from accelerate.commands.config import get_config_parser
from accelerate.commands.env import env_command_parser
from accelerate.commands.launch import launch_command_parser
from accelerate.commands.test import test_command_parser
from accelerate.commands.tpu import tpu_command_parser



def      __lowerCamelCase     (      )			->      Any:
		_a     :      List[Any]        =							ArgumentParser('Accelerate CLI tool'						,			usage='accelerate <command> [<args>]'						,			allow_abbrev=lowerCAmelCase_  )
		_a     :      Dict        =							parser.add_subparsers(help='accelerate command helpers'  )

		# Register commands
		get_config_parser(subparsers=lowerCAmelCase_  )
		env_command_parser(subparsers=lowerCAmelCase_  )
		launch_command_parser(subparsers=lowerCAmelCase_  )
		tpu_command_parser(subparsers=lowerCAmelCase_  )
		test_command_parser(subparsers=lowerCAmelCase_  )

		# Let's go
		_a     :      Optional[Any]        =							parser.parse_args()

		if not hasattr(lowerCAmelCase_						,			'func'  ):
				parser.print_help()
				exit(1  )

		# Run
		args.func(lowerCAmelCase_  )


if __name__ == "__main__":
							main()









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


a_   :Optional[int]        =      logging.get_logger(__name__)

a_   :Dict        =      {"openai-gpt": "https://huggingface.co/openai-gpt/resolve/main/config.json"}




class 					snake_case__						(       lowerCAmelCase_     ):






     """simple docstring"""


     _SCREAMING_SNAKE_CASE						=	"""openai-gpt"""
     _SCREAMING_SNAKE_CASE						=	{
         """max_position_embeddings""": """n_positions""",
         """hidden_size""": """n_embd""",
         """num_attention_heads""": """n_head""",
         """num_hidden_layers""": """n_layer""",
     }






     def __init__(       self  :  Optional[int], _snake_case  :  Dict=4_0_4_7_8, _snake_case  :  str=5_1_2, _snake_case  :  int=7_6_8, _snake_case  :  Tuple=1_2, _snake_case  :  Any=1_2, _snake_case  :  str="gelu", _snake_case  :  List[str]=0.1, _snake_case  :  Any=0.1, _snake_case  :  Dict=0.1, _snake_case  :  int=1e-5, _snake_case  :  Optional[Any]=0.0_2, _snake_case  :  List[Any]="cls_index", _snake_case  :  Any=True, _snake_case  :  Any=None, _snake_case  :  int=True, _snake_case  :  Optional[Any]=0.1, **_snake_case  :  List[Any], )   ->Optional[int]:
            snake_case__							:	int   	=	vocab_size
            snake_case__							:	Dict   	=	n_positions
            snake_case__							:	str   	=	n_embd
            snake_case__							:	str   	=	n_layer
            snake_case__							:	List[Any]   	=	n_head
            snake_case__							:	List[Any]   	=	afn
            snake_case__							:	Optional[Any]   	=	resid_pdrop
            snake_case__							:	List[str]   	=	embd_pdrop
            snake_case__							:	List[Any]   	=	attn_pdrop
            snake_case__							:	Optional[int]   	=	layer_norm_epsilon
            snake_case__							:	str   	=	initializer_range
            snake_case__							:	List[str]   	=	summary_type
            snake_case__							:	Optional[int]   	=	summary_use_proj
            snake_case__							:	List[str]   	=	summary_activation
            snake_case__							:	Optional[Any]   	=	summary_first_dropout
            snake_case__							:	int   	=	summary_proj_to_labels
            super().__init__(**_snake_case					)






