



import argparse

import torch

from transformers import GPTaConfig, GPTaModel, load_tf_weights_in_gpta
from transformers.utils import CONFIG_NAME, WEIGHTS_NAME, logging


logging.set_verbosity_info()







def  lowerCAmelCase_	(lowerCAmelCase__:		str		,						lowerCAmelCase__:		Optional[Any]		,						lowerCAmelCase__:		Optional[int]  ):





			"""simple docstring"""


			if gpta_config_file == "":
						UpperCAmelCase_:		int							      =     GPTaConfig()
			else:
						UpperCAmelCase_:		List[str]							      =     GPTaConfig.from_json_file(lowerCAmelCase__  )
			UpperCAmelCase_:		Optional[Any]							      =     GPTaModel(lowerCAmelCase__  )

			# Load weights from numpy
			load_tf_weights_in_gpta(lowerCAmelCase__		,						lowerCAmelCase__		,						lowerCAmelCase__  )

			# Save pytorch-model
			UpperCAmelCase_:		Union[str, Any]							      =     pytorch_dump_folder_path + """/""" + WEIGHTS_NAME
			UpperCAmelCase_:		Any							      =     pytorch_dump_folder_path + """/""" + CONFIG_NAME
			print(F'Save PyTorch model to {pytorch_weights_dump_path}'  )
			torch.save(model.state_dict()		,						lowerCAmelCase__  )
			print(F'Save configuration file to {pytorch_config_dump_path}'  )
			with open(lowerCAmelCase__		,						"""w"""		,						encoding="""utf-8"""  ) as f:
						f.write(config.to_json_string()  )


if __name__ == "__main__":
	a      :  Union[str, Any]			     =			argparse.ArgumentParser()
	# Required parameters
	parser.add_argument(
	    '--gpt2_checkpoint_path', default=None, type=str, required=True, help='Path to the TensorFlow checkpoint path.'
	)
	parser.add_argument(
	    '--pytorch_dump_folder_path', default=None, type=str, required=True, help='Path to the output PyTorch model.'
	)
	parser.add_argument(
	    '--gpt2_config_file',
	    default='',
	    type=str,
	    help=(
	        'An optional config json file corresponding to the pre-trained OpenAI model. \n'
	        'This specifies the model architecture.'
	    ),
	)
	a      :  List[str]			     =			parser.parse_args()
	convert_gpta_checkpoint_to_pytorch(args.gpta_checkpoint_path, args.gpta_config_file, args.pytorch_dump_folder_path)











def  lowerCAmelCase_	(lowerCAmelCase__:		list  ):





			"""simple docstring"""


			if len(lowerCAmelCase__  ) <= 1:
						return [tuple(lowerCAmelCase__  )]

			UpperCAmelCase_:		List[Any]							      =     []

			def generate(lowerCAmelCase__:		int		,						lowerCAmelCase__:		list  ):
						if k == 1:
									res.append(tuple(arr[:]  )  )
									return

						generate(k - 1		,						lowerCAmelCase__  )

						for i in range(k - 1  ):
									if k % 2 == 0:  # k is even
												UpperCAmelCase_      ,							UpperCAmelCase_:		Union[str, Any]							      =     arr[k - 1], arr[i]
									else:  # k is odd
												UpperCAmelCase_      ,							UpperCAmelCase_:		Optional[int]							      =     arr[k - 1], arr[0]
									generate(k - 1		,						lowerCAmelCase__  )

			generate(len(lowerCAmelCase__  )		,						lowerCAmelCase__  )
			return res


if __name__ == "__main__":
	a      :  Optional[Any]			     =			input('Enter numbers separated by a comma:\n').strip()
	a      :  str			     =			[int(item) for item in user_input.split(',')]
	print(heaps(arr))






