






'''simple docstring'''
from __future__ import annotations

from math import pi, sqrt




def 		__SCREAMING_SNAKE_CASE       (	_UpperCamelCase    ,		_UpperCamelCase				):


   """simple docstring"""




   if inductance <= 0:
      raise ValueError("Inductance cannot be 0 or negative"				)

   elif capacitance <= 0:
      raise ValueError("Capacitance cannot be 0 or negative"				)

   else:
      return (
          "Resonant frequency",
          float(1 / (2 * pi * (sqrt(inductance * capacitance				)))				),
      )


if __name__ == "__main__":
 import doctest

 doctest.testmod()












'''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 		__SCREAMING_SNAKE_CASE       (	_UpperCamelCase    ,		_UpperCamelCase				):


   """simple docstring"""




   lowercase_						:     Optional[Any]							     =  torch.load(_UpperCamelCase				)
   lowercase_						:     List[Any]							     =  d.pop(_UpperCamelCase				)
   os.makedirs(_UpperCamelCase    ,		exist_ok=_UpperCamelCase				)
   torch.save(_UpperCamelCase    ,		os.path.join(_UpperCamelCase    ,		_UpperCamelCase				)				)


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,
  )




