

'''simple docstring'''




import argparse
import os

import torch

from transformers.utils import WEIGHTS_NAME


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

_lowerCAmelCase            =		"lm_head.decoder.weight"
_lowerCAmelCase            =		"lm_head.weight"




def 		UpperCamelCase			(					a						,		a					) ->      Optional[int]:






     '''simple docstring'''
     __magic_name__		  =							torch.load(__lowerCamelCase					)
     __magic_name__		  =							d.pop(__lowerCamelCase					)
     os.makedirs(__lowerCamelCase						,		exist_ok=__lowerCamelCase					)
     torch.save(__lowerCamelCase						,		os.path.join(__lowerCamelCase						,		__lowerCamelCase					)					)


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










'''simple docstring'''






def lowerCamelCase__     (		__lowerCamelCase			:				str = "The quick brown fox jumps over the lazy dog"			,       ):







   '''simple docstring'''




   _UpperCAmelCase  :  Optional[Any]				       =set()

   # Replace all the whitespace in our sentence
   _UpperCAmelCase  :  Dict				       =input_str.replace(' '			,       ''				)
   for alpha in input_str:
      if "a" <= alpha.lower() <= "z":
         frequency.add(alpha.lower()				)
   return len(__lowerCamelCase				) == 2_6





def lowerCamelCase__     (		__lowerCamelCase			:				str = "The quick brown fox jumps over the lazy dog"			,       ):







   '''simple docstring'''




   _UpperCAmelCase  :  Tuple				       =[False] * 2_6
   for char in input_str:
      if char.islower():
         _UpperCAmelCase  :  Dict				       =True
      elif char.isupper():
         _UpperCAmelCase  :  List[str]				       =True
   return all(__lowerCamelCase				)





def lowerCamelCase__     (		__lowerCamelCase			:				str = "The quick brown fox jumps over the lazy dog"			,       ):







   '''simple docstring'''




   return len({char for char in input_str.lower() if char.isalpha()}				) == 2_6





def lowerCamelCase__     (		):







   '''simple docstring'''




   from timeit import timeit

   _UpperCAmelCase  :  List[Any]				       ='from __main__ import is_pangram, is_pangram_faster, is_pangram_fastest'
   print(timeit('is_pangram()'			,       setup=__lowerCamelCase				)				)
   print(timeit('is_pangram_faster()'			,       setup=__lowerCamelCase				)				)
   print(timeit('is_pangram_fastest()'			,       setup=__lowerCamelCase				)				)
   # 5.348480500048026, 2.6477354579837993, 1.8470395830227062
   # 5.036091582966037, 2.644472333951853,  1.8869528750656173


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 benchmark()

