
'''simple docstring'''





import argparse
import os

import torch

from transformers.utils import WEIGHTS_NAME


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

UpperCAmelCase    					=   "lm_head.decoder.weight"
UpperCAmelCase    					=   "lm_head.weight"

def      A (       A_							:					str    ,							A_							:					str       ):
						snake_case       :     List[Any] =    torch.load(A_       )
						snake_case       :     int =    d.pop(A_       )
						os.makedirs(A_    ,							exist_ok=A_       )
						torch.save(A_    ,							os.path.join(A_    ,							A_       )       )


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



'''simple docstring'''





from __future__ import annotations

import math

def      A (       A_							:					int       ):

						if num <= 0:
												snake_case       :     List[Any] =    F"""{num}: Invalid input, please enter a positive integer."""
												raise ValueError(A_       )

						snake_case       :     Optional[Any] =    [True] * (num + 1)
						snake_case       :     List[str] =    []
						snake_case       :     List[Any] =    2
						snake_case       :     str =    int(math.sqrt(A_       )       )

						while start <= end:
												# If start is a prime
												if sieve[start] is True:
																		prime.append(A_       )

																		# Set multiples of start be False
																		for i in range(start * start    ,							num + 1    ,							A_       ):
																								if sieve[i] is True:
																														snake_case       :     int =    False

												start += 1

						for j in range(end + 1    ,							num + 1       ):
												if sieve[j] is True:
																		prime.append(A_       )

						return prime


if __name__ == "__main__":
						print(prime_sieve(int(input("Enter a positive integer: ").strip())))

