
import argparse
import os

import torch

from transformers.utils import WEIGHTS_NAME


lowercase__	:List[Any]										=					["small", "medium", "large"]

lowercase__	:List[Any]										=					"lm_head.decoder.weight"
lowercase__	:str										=					"lm_head.weight"



def  UpperCamelCase					(							lowerCAmelCase__				,    lowerCAmelCase__	):
					'''simple docstring'''
					lowercase					=		torch.load(lowerCAmelCase__	)
					lowercase					=		d.pop(lowerCAmelCase__	)
					os.makedirs(lowerCAmelCase__				,    exist_ok=lowerCAmelCase__	)
					torch.save(lowerCAmelCase__				,    os.path.join(lowerCAmelCase__				,    lowerCAmelCase__	)	)


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






def  UpperCamelCase					(							lowerCAmelCase__ = 1000	):
					'''simple docstring'''
					lowercase					=		-1
					lowercase					=		0
					for a in range(1				,    n // 3	):
										# Solving the two equations a**2+b**2=c**2 and a+b+c=N eliminating c
										lowercase					=		(n * n - 2 * a * n) // (2 * n - 2 * a)
										lowercase					=		n - a - b
										if c * c == (a * a + b * b):
															lowercase					=		a * b * c
															if candidate >= product:
																				lowercase					=		candidate
					return product


if __name__ == "__main__":
							print(F'{solution() = }')




