
import argparse
import os

import torch

from transformers.utils import WEIGHTS_NAME


_A     =  ["small", "medium", "large"]

_A     =  "lm_head.decoder.weight"
_A     =  "lm_head.weight"






def      lowerCamelCase__       (       __lowerCAmelCase						:						str					,							__lowerCAmelCase						:						str       ):




			"""simple docstring"""


			lowerCAmelCase_      			=			torch.load(__lowerCAmelCase       )
			lowerCAmelCase_      			=			d.pop(__lowerCAmelCase       )
			os.makedirs(__lowerCAmelCase					,							exist_ok=__lowerCAmelCase       )
			torch.save(__lowerCAmelCase					,							os.path.join(__lowerCAmelCase					,							__lowerCAmelCase       )       )


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





def      lowerCamelCase__       (       __lowerCAmelCase						:						list[list[int]]					,							__lowerCAmelCase						:						int					,							__lowerCAmelCase						:						int					,							__lowerCAmelCase						:						set       ):




			"""simple docstring"""


			lowerCAmelCase_			,						lowerCAmelCase_      			=			len(__lowerCAmelCase       ), len(grid[0]       )
			if (
			    min(__lowerCAmelCase					,							__lowerCAmelCase       ) < 0
			    or row == row_length
			    or col == col_length
			    or (row, col) in visit
			    or grid[row][col] == 1
			):
						return 0
			if row == row_length - 1 and col == col_length - 1:
						return 1

			visit.add((row, col)       )

			lowerCAmelCase_      			=			0
			count += depth_first_search(__lowerCAmelCase					,							row + 1					,							__lowerCAmelCase					,							__lowerCAmelCase       )
			count += depth_first_search(__lowerCAmelCase					,							row - 1					,							__lowerCAmelCase					,							__lowerCAmelCase       )
			count += depth_first_search(__lowerCAmelCase					,							__lowerCAmelCase					,							col + 1					,							__lowerCAmelCase       )
			count += depth_first_search(__lowerCAmelCase					,							__lowerCAmelCase					,							col - 1					,							__lowerCAmelCase       )

			visit.remove((row, col)       )
			return count


if __name__ == "__main__":
			import doctest

			doctest.testmod()



