

'''simple docstring'''





import argparse
import os

import torch

from transformers.utils import WEIGHTS_NAME


_SCREAMING_SNAKE_CASE  :						List[str]         =    ['''small''', '''medium''', '''large''']

_SCREAMING_SNAKE_CASE  :						int         =    '''lm_head.decoder.weight'''
_SCREAMING_SNAKE_CASE  :						Any         =    '''lm_head.weight'''
def        UpperCAmelCase_     (		_A   ,	_A       ):





     '''simple docstring'''




     SCREAMING_SNAKE_CASE__					=					torch.load(snake_case__       )
     SCREAMING_SNAKE_CASE__					=					d.pop(snake_case__       )
     os.makedirs(snake_case__   ,	exist_ok=snake_case__       )
     torch.save(snake_case__   ,	os.path.join(snake_case__   ,	snake_case__       )       )


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





from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Features, Sequence, Value
from .base import TaskTemplate






@dataclass(frozen=A__ )
class  UpperCAmelCase__	( A__ ):






  """simple docstring"""


  a     =      field(default="question-answering-extractive"		,  metadata={"include_in_asdict_even_if_is_default": True} )
  a     =      Features({"question": Value("string" ), "context": Value("string" )} )
  a     =      Features(
      {
          "answers": Sequence(
              {
                  "text": Value("string" ),
                  "answer_start": Value("int32" ),
              } )
      } )
  a     =      "question"
  a     =      "context"
  a     =      "answers"






  @property
  def    lowercase_	(							self		:	Dict      )	->							Dict[str, str]:
       return {self.question_column: "question", self.context_column: "context", self.answers_column: "answers"}


