



import argparse
import os

import torch

from transformers.utils import WEIGHTS_NAME


_UpperCAmelCase       :	int            =['small', 'medium', 'large']

_UpperCAmelCase       :	List[Any]            ='lm_head.decoder.weight'
_UpperCAmelCase       :	str            ='lm_head.weight'






def 			lowerCAmelCase__	(					lowerCamelCase_	:	str ,lowerCamelCase_	:	str):





				'''simple docstring'''

				lowerCAmelCase__  :       int				=  torch.load(lowerCamelCase_)
				lowerCAmelCase__  :       List[Any]				=  d.pop(lowerCamelCase_)
				os.makedirs(lowerCamelCase_ ,exist_ok=lowerCamelCase_)
				torch.save(lowerCamelCase_ ,os.path.join(lowerCamelCase_ ,lowerCamelCase_))


if __name__ == "__main__":
							_UpperCAmelCase       :	Optional[Any]            =argparse.ArgumentParser()
							parser.add_argument('--dialogpt_path', default='.', type=str)
							_UpperCAmelCase       :	str            =parser.parse_args()
							for MODEL in DIALOGPT_MODELS:
														_UpperCAmelCase       :	int            =os.path.join(args.dialogpt_path, f"""{MODEL}_ft.pkl""")
														_UpperCAmelCase       :	Optional[Any]            =f"""./DialoGPT-{MODEL}"""
														convert_dialogpt_checkpoint(
														    checkpoint_path,
														    pytorch_dump_folder_path,
														)






def 			lowerCAmelCase__	(					lowerCamelCase_	:	int):





				'''simple docstring'''

				if not isinstance(lowerCamelCase_ ,lowerCamelCase_):
								lowerCAmelCase__  :       Dict				=  f"""Input value of [number={number}] must be an integer"""
								raise TypeError(lowerCamelCase_)

				if number < 1:
								lowerCAmelCase__  :       Any				=  f"""Input value of [number={number}] must be > 0"""
								raise ValueError(lowerCamelCase_)

				lowerCAmelCase__  :       List[str]				=  1

				for i in range(1 ,lowerCamelCase_):
								current_number *= 4 * i - 2
								current_number //= i + 1

				return current_number


if __name__ == "__main__":
							import doctest

							doctest.testmod()

