


import argparse
import os

import torch

from transformers.utils import WEIGHTS_NAME


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

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





def 	_lowerCAmelCase       (    _lowerCAmelCase      ,	_lowerCAmelCase )						->	List[str]:


						'''simple docstring'''






						__snake_case				=		torch.load(lowerCamelCase_ )
						__snake_case				=		d.pop(lowerCamelCase_ )
						os.makedirs(lowerCamelCase_      ,	exist_ok=lowerCamelCase_ )
						torch.save(lowerCamelCase_      ,	os.path.join(lowerCamelCase_      ,	lowerCamelCase_ ) )


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









from __future__ import annotations





def 	_lowerCAmelCase       (    _lowerCAmelCase )						->	list:


						'''simple docstring'''






						if len(_lowerCAmelCase ) == 0:
												return []
						__snake_case		,					__snake_case				=		min(_lowerCAmelCase ), max(_lowerCAmelCase )
						__snake_case				=		int(max_value - min_value ) + 1
						__snake_case				=		[[] for _ in range(_lowerCAmelCase )]

						for i in my_list:
												buckets[int(i - min_value )].append(_lowerCAmelCase )

						return [v for bucket in buckets for v in sorted(_lowerCAmelCase )]


if __name__ == "__main__":
	from doctest import testmod

	testmod()
	assert bucket_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
	assert bucket_sort([0, 1, -10, 15, 2, -2]) == [-10, -2, 0, 1, 2, 15]





