
"""simple docstring"""




A__      :	str          =    """
# Installazione di Transformers
! pip install transformers datasets
# Per installare dalla fonte invece dell'ultima versione rilasciata, commenta il comando sopra e
# rimuovi la modalità commento al comando seguente.
# ! pip install git+https://github.com/huggingface/transformers.git
"""

A__      :	str          =    [{"""type""": """code""", """content""": INSTALL_CONTENT}]
A__      :	Any          =    {
    """{processor_class}""": """FakeProcessorClass""",
    """{model_class}""": """FakeModelClass""",
    """{object_class}""": """FakeObjectClass""",
}





"""simple docstring"""




import argparse
import os

import torch

from transformers.utils import WEIGHTS_NAME


A__      :	Optional[int]          =    ["""small""", """medium""", """large"""]

A__      :	Optional[int]          =    """lm_head.decoder.weight"""
A__      :	Dict          =    """lm_head.weight"""



def 							a__ (				lowerCAmelCase	:       str       ,    lowerCAmelCase	:       str		):






     '''simple docstring'''
     UpperCAmelCase__							: Dict 							=						torch.load(lowerCAmelCase		)
     UpperCAmelCase__							: Optional[int] 							=						d.pop(lowerCAmelCase		)
     os.makedirs(lowerCAmelCase       ,    exist_ok=lowerCAmelCase		)
     torch.save(lowerCAmelCase       ,    os.path.join(lowerCAmelCase       ,    lowerCAmelCase		)		)


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



