'''simple docstring'''






import math






def  UpperCamelCase__					(					_lowercase    :				int     )							->	list[int]:
  __UpperCAmelCase:					Any		= []
  __UpperCAmelCase:					List[Any]		= 2
  __UpperCAmelCase:					Any		= int(math.sqrt(_lowercase     )     )  # Size of every segment
  __UpperCAmelCase:					Optional[Any]		= [True] * (end + 1)
  __UpperCAmelCase:					int		= []

  while start <= end:
    if temp[start] is True:
      in_prime.append(_lowercase     )
      for i in range(start * start   ,    end + 1   ,    _lowercase     ):
        __UpperCAmelCase:					List[Any]		= False
    start += 1
  prime += in_prime

  __UpperCAmelCase:					Tuple		= end + 1
  __UpperCAmelCase:					Optional[int]		= min(2 * end   ,    _lowercase     )

  while low <= n:
    __UpperCAmelCase:					Any		= [True] * (high - low + 1)
    for each in in_prime:
      __UpperCAmelCase:					Tuple		= math.floor(low / each     ) * each
      if t < low:
        t += each

      for j in range(_lowercase   ,    high + 1   ,    _lowercase     ):
        __UpperCAmelCase:					Optional[int]		= False

    for j in range(len(_lowercase     )     ):
      if temp[j] is True:
        prime.append(j + low     )

    __UpperCAmelCase:					Union[str, Any]		= high + 1
    __UpperCAmelCase:					Tuple		= min(high + end   ,    _lowercase     )

  return prime







print(sieve(10**6))
'''simple docstring'''






import argparse
import os

import torch

from transformers.utils import WEIGHTS_NAME


SCREAMING_SNAKE_CASE_	   =			['small', 'medium', 'large']

SCREAMING_SNAKE_CASE_	   =			'lm_head.decoder.weight'
SCREAMING_SNAKE_CASE_	   =			'lm_head.weight'






def  UpperCamelCase__					(					_lowercase    :				str   ,    _lowercase    :				str     )							->	List[str]:
  __UpperCAmelCase:					Tuple		= torch.load(_lowercase     )
  __UpperCAmelCase:					Tuple		= d.pop(_lowercase     )
  os.makedirs(_lowercase   ,    exist_ok=_lowercase     )
  torch.save(_lowercase   ,    os.path.join(_lowercase   ,    _lowercase     )     )


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