


import logging
import os
import random
import sys
from dataclasses import dataclass, field
from typing import Optional

import datasets
import evaluate
import numpy as np
from datasets import load_dataset

import transformers
from transformers import (
    AutoConfig,
    AutoModelForSequenceClassification,
    AutoTokenizer,
    DataCollatorWithPadding,
    EvalPrediction,
    HfArgumentParser,
    Trainer,
    TrainingArguments,
    default_data_collator,
    set_seed,
)
from transformers.trainer_utils import get_last_checkpoint
from transformers.utils import check_min_version, send_example_telemetry
from transformers.utils.versions import require_version


# Will error if the minimal version of Transformers is not installed. Remove at your own risks.
check_min_version("4.31.0")

require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/text-classification/requirements.txt")

__UpperCamelCase       :       int						       =				logging.getLogger(__name__)

@dataclass
class       __magic_name__	:
     A:		Optional[int]			=      field(
         default=1_2_8					,				metadata={
             "help": (
                 "The maximum total input sequence length after tokenization. Sequences longer "
                 "than this will be truncated, sequences shorter will be padded."
             )
         }					,				)
     A:		bool			=      field(
         default=__lowerCAmelCase					,				metadata={"help": "Overwrite the cached preprocessed datasets or not."})
     A:		bool			=      field(
         default=__lowerCAmelCase					,				metadata={
             "help": (
                 "Whether to pad all samples to `max_seq_length`. "
                 "If False, will pad the samples dynamically when batching to the maximum length in the batch."
             )
         }					,				)
     A:		Optional[int]			=      field(
         default=__lowerCAmelCase					,				metadata={
             "help": (
                 "For debugging purposes or quicker training, truncate the number of training examples to this "
                 "value if set."
             )
         }					,				)
     A:		Optional[int]			=      field(
         default=__lowerCAmelCase					,				metadata={
             "help": (
                 "For debugging purposes or quicker training, truncate the number of evaluation examples to this "
                 "value if set."
             )
         }					,				)
     A:		Optional[int]			=      field(
         default=__lowerCAmelCase					,				metadata={
             "help": (
                 "For debugging purposes or quicker training, truncate the number of prediction examples to this "
                 "value if set."
             )
         }					,				)



@dataclass
class       __magic_name__	:
     A:		str			=      field(
         default=__lowerCAmelCase					,				metadata={"help": "Path to pretrained model or model identifier from huggingface.co/models"})
     A:		str			=      field(
         default=__lowerCAmelCase					,				metadata={"help": "Evaluation language. Also train language if `train_language` is set to None."})
     A:		Optional[str]			=      field(
         default=__lowerCAmelCase					,				metadata={"help": "Train language if it is different from the evaluation language."})
     A:		Optional[str]			=      field(
         default=__lowerCAmelCase					,				metadata={"help": "Pretrained config name or path if not the same as model_name"})
     A:		Optional[str]			=      field(
         default=__lowerCAmelCase					,				metadata={"help": "Pretrained tokenizer name or path if not the same as model_name"})
     A:		Optional[str]			=      field(
         default=__lowerCAmelCase					,				metadata={"help": "Where do you want to store the pretrained models downloaded from huggingface.co"}					,				)
     A:		Optional[bool]			=      field(
         default=__lowerCAmelCase					,				metadata={"help": "arg to indicate if tokenizer should do lower case in AutoTokenizer.from_pretrained()"}					,				)
     A:		bool			=      field(
         default=__lowerCAmelCase					,				metadata={"help": "Whether to use one of the fast tokenizer (backed by the tokenizers library) or not."}					,				)
     A:		str			=      field(
         default="main"					,				metadata={"help": "The specific model version to use (can be a branch name, tag name or commit id)."}					,				)
     A:		bool			=      field(
         default=__lowerCAmelCase					,				metadata={
             "help": (
                 "Will use the token generated when running `huggingface-cli login` (necessary to use this script "
                 "with private models)."
             )
         }					,				)
     A:		bool			=      field(
         default=__lowerCAmelCase					,				metadata={"help": "Will enable to load a pretrained model whose head dimensions are different."}					,				)



def 			_a  (				):







 """simple docstring"""



 UpperCamelCase__					:    Optional[Any]          =   HfArgumentParser((ModelArguments, DataTrainingArguments, TrainingArguments)     )
 UpperCamelCase__       ,				UpperCamelCase__       ,				UpperCamelCase__					:    List[str]          =   parser.parse_args_into_dataclasses()

 # Sending telemetry. Tracking the example usage helps us better allocate resources to maintain them. The
 # information sent is the one passed as arguments along with your Python/PyTorch versions.
 send_example_telemetry('''run_xnli'''    , SCREAMING_SNAKE_CASE     )

 # Setup logging
 logging.basicConfig(
     format='''%(asctime)s - %(levelname)s - %(name)s - %(message)s'''    , datefmt='''%m/%d/%Y %H:%M:%S'''    , handlers=[logging.StreamHandler(sys.stdout     )]    , )

 if training_args.should_log:
  # The default of training_args.log_level is passive, so we set log level at info here to have that default.
  transformers.utils.logging.set_verbosity_info()

 UpperCamelCase__					:    int          =   training_args.get_process_log_level()
 logger.setLevel(SCREAMING_SNAKE_CASE     )
 datasets.utils.logging.set_verbosity(SCREAMING_SNAKE_CASE     )
 transformers.utils.logging.set_verbosity(SCREAMING_SNAKE_CASE     )
 transformers.utils.logging.enable_default_handler()
 transformers.utils.logging.enable_explicit_format()

 # Log on each process the small summary:
 logger.warning(
     F"Process rank: {training_args.local_rank}, device: {training_args.device}, n_gpu: {training_args.n_gpu}"
     + F"distributed training: {bool(training_args.local_rank != -1     )}, 16-bits training: {training_args.fpaa}"     )
 logger.info(F"Training/evaluation parameters {training_args}"     )

 # Detecting last checkpoint.
 UpperCamelCase__					:    Optional[int]          =   None
 if os.path.isdir(training_args.output_dir     ) and training_args.do_train and not training_args.overwrite_output_dir:
  UpperCamelCase__					:    int          =   get_last_checkpoint(training_args.output_dir     )
  if last_checkpoint is None and len(os.listdir(training_args.output_dir     )     ) > 0:
   raise ValueError(
       F"Output directory ({training_args.output_dir}) already exists and is not empty. "
       '''Use --overwrite_output_dir to overcome.'''     )
  elif last_checkpoint is not None:
   logger.info(
       F"Checkpoint detected, resuming training at {last_checkpoint}. To avoid this behavior, change "
       '''the `--output_dir` or add `--overwrite_output_dir` to train from scratch.'''     )

    # Set seed before initializing model.
 set_seed(training_args.seed     )

 # In distributed training, the load_dataset function guarantees that only one local process can concurrently
 # download the dataset.
 # Downloading and loading xnli dataset from the hub.
 if training_args.do_train:
  if model_args.train_language is None:
   UpperCamelCase__					:    Union[str, Any]          =   load_dataset(
       '''xnli'''    , model_args.language    , split='''train'''    , cache_dir=model_args.cache_dir    , use_auth_token=True if model_args.use_auth_token else None    , )
  else:
   UpperCamelCase__					:    Union[str, Any]          =   load_dataset(
       '''xnli'''    , model_args.train_language    , split='''train'''    , cache_dir=model_args.cache_dir    , use_auth_token=True if model_args.use_auth_token else None    , )
  UpperCamelCase__					:    Optional[int]          =   train_dataset.features['''label'''].names

 if training_args.do_eval:
  UpperCamelCase__					:    Tuple          =   load_dataset(
      '''xnli'''    , model_args.language    , split='''validation'''    , cache_dir=model_args.cache_dir    , use_auth_token=True if model_args.use_auth_token else None    , )
  UpperCamelCase__					:    str          =   eval_dataset.features['''label'''].names

 if training_args.do_predict:
  UpperCamelCase__					:    int          =   load_dataset(
      '''xnli'''    , model_args.language    , split='''test'''    , cache_dir=model_args.cache_dir    , use_auth_token=True if model_args.use_auth_token else None    , )
  UpperCamelCase__					:    Tuple          =   predict_dataset.features['''label'''].names

 # Labels
 UpperCamelCase__					:    str          =   len(SCREAMING_SNAKE_CASE     )

 # Load pretrained model and tokenizer
 # In distributed training, the .from_pretrained methods guarantee that only one local process can concurrently
 # download model & vocab.
 UpperCamelCase__					:    str          =   AutoConfig.from_pretrained(
     model_args.config_name if model_args.config_name else model_args.model_name_or_path    , num_labels=SCREAMING_SNAKE_CASE    , idalabel={str(SCREAMING_SNAKE_CASE     ): label for i, label in enumerate(SCREAMING_SNAKE_CASE     )}    , labelaid={label: i for i, label in enumerate(SCREAMING_SNAKE_CASE     )}    , finetuning_task='''xnli'''    , cache_dir=model_args.cache_dir    , revision=model_args.model_revision    , use_auth_token=True if model_args.use_auth_token else None    , )
 UpperCamelCase__					:    int          =   AutoTokenizer.from_pretrained(
     model_args.tokenizer_name if model_args.tokenizer_name else model_args.model_name_or_path    , do_lower_case=model_args.do_lower_case    , cache_dir=model_args.cache_dir    , use_fast=model_args.use_fast_tokenizer    , revision=model_args.model_revision    , use_auth_token=True if model_args.use_auth_token else None    , )
 UpperCamelCase__					:    Optional[int]          =   AutoModelForSequenceClassification.from_pretrained(
     model_args.model_name_or_path    , from_tf=bool('''.ckpt''' in model_args.model_name_or_path     )    , config=SCREAMING_SNAKE_CASE    , cache_dir=model_args.cache_dir    , revision=model_args.model_revision    , use_auth_token=True if model_args.use_auth_token else None    , ignore_mismatched_sizes=model_args.ignore_mismatched_sizes    , )

 # Preprocessing the datasets
 # Padding strategy
 if data_args.pad_to_max_length:
  UpperCamelCase__					:    Optional[int]          =   '''max_length'''
 else:
  # We will pad later, dynamically at batch creation, to the max sequence length in each batch
  UpperCamelCase__					:    Optional[Any]          =   False

 def preprocess_function(SCREAMING_SNAKE_CASE	:				Optional[int]     ):
  # Tokenize the texts
  return tokenizer(
      examples['''premise''']    , examples['''hypothesis''']    , padding=SCREAMING_SNAKE_CASE    , max_length=data_args.max_seq_length    , truncation=SCREAMING_SNAKE_CASE    , )

 if training_args.do_train:
  if data_args.max_train_samples is not None:
   UpperCamelCase__					:    Union[str, Any]          =   min(len(SCREAMING_SNAKE_CASE     )    , data_args.max_train_samples     )
   UpperCamelCase__					:    Optional[Any]          =   train_dataset.select(range(SCREAMING_SNAKE_CASE     )     )
  with training_args.main_process_first(desc='''train dataset map pre-processing'''     ):
   UpperCamelCase__					:    Tuple          =   train_dataset.map(
       SCREAMING_SNAKE_CASE    , batched=SCREAMING_SNAKE_CASE    , load_from_cache_file=not data_args.overwrite_cache    , desc='''Running tokenizer on train dataset'''    , )
  # Log a few random samples from the training set:
  for index in random.sample(range(len(SCREAMING_SNAKE_CASE     )     )    , 3     ):
   logger.info(F"Sample {index} of the training set: {train_dataset[index]}."     )

 if training_args.do_eval:
  if data_args.max_eval_samples is not None:
   UpperCamelCase__					:    Optional[int]          =   min(len(SCREAMING_SNAKE_CASE     )    , data_args.max_eval_samples     )
   UpperCamelCase__					:    int          =   eval_dataset.select(range(SCREAMING_SNAKE_CASE     )     )
  with training_args.main_process_first(desc='''validation dataset map pre-processing'''     ):
   UpperCamelCase__					:    List[Any]          =   eval_dataset.map(
       SCREAMING_SNAKE_CASE    , batched=SCREAMING_SNAKE_CASE    , load_from_cache_file=not data_args.overwrite_cache    , desc='''Running tokenizer on validation dataset'''    , )

 if training_args.do_predict:
  if data_args.max_predict_samples is not None:
   UpperCamelCase__					:    Optional[int]          =   min(len(SCREAMING_SNAKE_CASE     )    , data_args.max_predict_samples     )
   UpperCamelCase__					:    Tuple          =   predict_dataset.select(range(SCREAMING_SNAKE_CASE     )     )
  with training_args.main_process_first(desc='''prediction dataset map pre-processing'''     ):
   UpperCamelCase__					:    Tuple          =   predict_dataset.map(
       SCREAMING_SNAKE_CASE    , batched=SCREAMING_SNAKE_CASE    , load_from_cache_file=not data_args.overwrite_cache    , desc='''Running tokenizer on prediction dataset'''    , )

    # Get the metric function
 UpperCamelCase__					:    Any          =   evaluate.load('''xnli'''     )

 # You can define your custom compute_metrics function. It takes an `EvalPrediction` object (a namedtuple with a
 # predictions and label_ids field) and has to return a dictionary string to float.
 def compute_metrics(SCREAMING_SNAKE_CASE	:				EvalPrediction     ):
  UpperCamelCase__					:    List[str]          =   p.predictions[0] if isinstance(p.predictions    , SCREAMING_SNAKE_CASE     ) else p.predictions
  UpperCamelCase__					:    Union[str, Any]          =   np.argmax(SCREAMING_SNAKE_CASE    , axis=1     )
  return metric.compute(predictions=SCREAMING_SNAKE_CASE    , references=p.label_ids     )

 # Data collator will default to DataCollatorWithPadding, so we change it if we already did the padding.
 if data_args.pad_to_max_length:
  UpperCamelCase__					:    Optional[Any]          =   default_data_collator
 elif training_args.fpaa:
  UpperCamelCase__					:    Optional[Any]          =   DataCollatorWithPadding(SCREAMING_SNAKE_CASE    , pad_to_multiple_of=8     )
 else:
  UpperCamelCase__					:    Tuple          =   None

 # Initialize our Trainer
 UpperCamelCase__					:    Optional[int]          =   Trainer(
     model=SCREAMING_SNAKE_CASE    , args=SCREAMING_SNAKE_CASE    , train_dataset=train_dataset if training_args.do_train else None    , eval_dataset=eval_dataset if training_args.do_eval else None    , compute_metrics=SCREAMING_SNAKE_CASE    , tokenizer=SCREAMING_SNAKE_CASE    , data_collator=SCREAMING_SNAKE_CASE    , )

 # Training
 if training_args.do_train:
  UpperCamelCase__					:    str          =   None
  if training_args.resume_from_checkpoint is not None:
   UpperCamelCase__					:    Tuple          =   training_args.resume_from_checkpoint
  elif last_checkpoint is not None:
   UpperCamelCase__					:    List[str]          =   last_checkpoint
  UpperCamelCase__					:    Tuple          =   trainer.train(resume_from_checkpoint=SCREAMING_SNAKE_CASE     )
  UpperCamelCase__					:    Tuple          =   train_result.metrics
  UpperCamelCase__					:    int          =   (
      data_args.max_train_samples if data_args.max_train_samples is not None else len(SCREAMING_SNAKE_CASE     )
  )
  UpperCamelCase__					:    Optional[int]          =   min(SCREAMING_SNAKE_CASE    , len(SCREAMING_SNAKE_CASE     )     )

  trainer.save_model()  # Saves the tokenizer too for easy upload

  trainer.log_metrics('''train'''    , SCREAMING_SNAKE_CASE     )
  trainer.save_metrics('''train'''    , SCREAMING_SNAKE_CASE     )
  trainer.save_state()

 # Evaluation
 if training_args.do_eval:
  logger.info('''*** Evaluate ***'''     )
  UpperCamelCase__					:    List[str]          =   trainer.evaluate(eval_dataset=SCREAMING_SNAKE_CASE     )

  UpperCamelCase__					:    Optional[int]          =   data_args.max_eval_samples if data_args.max_eval_samples is not None else len(SCREAMING_SNAKE_CASE     )
  UpperCamelCase__					:    Any          =   min(SCREAMING_SNAKE_CASE    , len(SCREAMING_SNAKE_CASE     )     )

  trainer.log_metrics('''eval'''    , SCREAMING_SNAKE_CASE     )
  trainer.save_metrics('''eval'''    , SCREAMING_SNAKE_CASE     )

 # Prediction
 if training_args.do_predict:
  logger.info('''*** Predict ***'''     )
  UpperCamelCase__       ,				UpperCamelCase__       ,				UpperCamelCase__					:    str          =   trainer.predict(SCREAMING_SNAKE_CASE    , metric_key_prefix='''predict'''     )

  UpperCamelCase__					:    Union[str, Any]          =   (
      data_args.max_predict_samples if data_args.max_predict_samples is not None else len(SCREAMING_SNAKE_CASE     )
  )
  UpperCamelCase__					:    List[Any]          =   min(SCREAMING_SNAKE_CASE    , len(SCREAMING_SNAKE_CASE     )     )

  trainer.log_metrics('''predict'''    , SCREAMING_SNAKE_CASE     )
  trainer.save_metrics('''predict'''    , SCREAMING_SNAKE_CASE     )

  UpperCamelCase__					:    List[str]          =   np.argmax(SCREAMING_SNAKE_CASE    , axis=1     )
  UpperCamelCase__					:    Union[str, Any]          =   os.path.join(training_args.output_dir    , '''predictions.txt'''     )
  if trainer.is_world_process_zero():
   with open(SCREAMING_SNAKE_CASE    , '''w'''     ) as writer:
    writer.write('''index\tprediction\n'''     )
    for index, item in enumerate(SCREAMING_SNAKE_CASE     ):
     UpperCamelCase__					:    Union[str, Any]          =   label_list[item]
     writer.write(F"{index}\t{item}\n"     )


if __name__ == "__main__":
       main()






from argparse import ArgumentParser, Namespace

from ..utils import logging
from . import BaseTransformersCLICommand

def 			_a  (				SCREAMING_SNAKE_CASE	:				Namespace     ):







 """simple docstring"""



 return ConvertCommand(
     args.model_type    , args.tf_checkpoint    , args.pytorch_dump_output    , args.config    , args.finetuning_task_name     )


__UpperCamelCase       :       List[Any]						       =				"\ntransformers can only be used from the commandline to convert TensorFlow models in PyTorch, In that case, it requires\nTensorFlow to be installed. Please see https://www.tensorflow.org/install/ for installation instructions.\n"






class       __magic_name__	(     __lowerCAmelCase):


     @staticmethod
     def      UpperCAmelCase__	(      lowerCamelCase__							:     ArgumentParser			)  ->      Optional[int]:





      '''simple docstring'''






      UpperCamelCase__					:    int          =   parser.add_parser(
          '''convert'''							,	help='''CLI tool to run convert model from original author checkpoints to Transformers PyTorch checkpoints.'''							,	)
      train_parser.add_argument('''--model_type'''							,	type=lowerCamelCase__							,	required=lowerCamelCase__							,	help='''Model\'s type.'''			)
      train_parser.add_argument(
          '''--tf_checkpoint'''							,	type=lowerCamelCase__							,	required=lowerCamelCase__							,	help='''TensorFlow checkpoint path or folder.'''			)
      train_parser.add_argument(
          '''--pytorch_dump_output'''							,	type=lowerCamelCase__							,	required=lowerCamelCase__							,	help='''Path to the PyTorch saved model output.'''			)
      train_parser.add_argument('''--config'''							,	type=lowerCamelCase__							,	default=''''''							,	help='''Configuration file path or folder.'''			)
      train_parser.add_argument(
          '''--finetuning_task_name'''							,	type=lowerCamelCase__							,	default=lowerCamelCase__							,	help='''Optional fine-tuning task name if the TF model was a finetuned model.'''							,	)
      train_parser.set_defaults(func=lowerCamelCase__			)


     def __init__(      self							:     Optional[Any]							,	lowerCamelCase__							:     str							,	lowerCamelCase__							:     str							,	lowerCamelCase__							:     str							,	lowerCamelCase__							:     str							,	lowerCamelCase__							:     str							,	*lowerCamelCase__							:     Optional[int]							,	)  ->      List[Any]:





      '''simple docstring'''






      UpperCamelCase__					:    List[Any]          =   logging.get_logger('''transformers-cli/converting'''			)

      self._logger.info(F"Loading model {model_type}"			)
      UpperCamelCase__					:    List[str]          =   model_type
      UpperCamelCase__					:    Optional[int]          =   tf_checkpoint
      UpperCamelCase__					:    List[Any]          =   pytorch_dump_output
      UpperCamelCase__					:    List[Any]          =   config
      UpperCamelCase__					:    Any          =   finetuning_task_name


     def      UpperCAmelCase__	(      self							:     Optional[Any]			)  ->      Optional[Any]:





      '''simple docstring'''






      if self._model_type == "albert":
       try:
        from ..models.albert.convert_albert_original_tf_checkpoint_to_pytorch import (
            convert_tf_checkpoint_to_pytorch,
        )
       except ImportError:
        raise ImportError(lowerCamelCase__			)

       convert_tf_checkpoint_to_pytorch(self._tf_checkpoint							,	self._config							,	self._pytorch_dump_output			)
      elif self._model_type == "bert":
       try:
        from ..models.bert.convert_bert_original_tf_checkpoint_to_pytorch import (
            convert_tf_checkpoint_to_pytorch,
        )
       except ImportError:
        raise ImportError(lowerCamelCase__			)

       convert_tf_checkpoint_to_pytorch(self._tf_checkpoint							,	self._config							,	self._pytorch_dump_output			)
      elif self._model_type == "funnel":
       try:
        from ..models.funnel.convert_funnel_original_tf_checkpoint_to_pytorch import (
            convert_tf_checkpoint_to_pytorch,
        )
       except ImportError:
        raise ImportError(lowerCamelCase__			)

       convert_tf_checkpoint_to_pytorch(self._tf_checkpoint							,	self._config							,	self._pytorch_dump_output			)
      elif self._model_type == "t5":
       try:
        from ..models.ta.convert_ta_original_tf_checkpoint_to_pytorch import convert_tf_checkpoint_to_pytorch
       except ImportError:
        raise ImportError(lowerCamelCase__			)

       convert_tf_checkpoint_to_pytorch(self._tf_checkpoint							,	self._config							,	self._pytorch_dump_output			)
      elif self._model_type == "gpt":
       from ..models.openai.convert_openai_original_tf_checkpoint_to_pytorch import (
           convert_openai_checkpoint_to_pytorch,
       )

       convert_openai_checkpoint_to_pytorch(self._tf_checkpoint							,	self._config							,	self._pytorch_dump_output			)
      elif self._model_type == "transfo_xl":
       try:
        from ..models.transfo_xl.convert_transfo_xl_original_tf_checkpoint_to_pytorch import (
            convert_transfo_xl_checkpoint_to_pytorch,
        )
       except ImportError:
        raise ImportError(lowerCamelCase__			)

       if "ckpt" in self._tf_checkpoint.lower():
        UpperCamelCase__					:    str          =   self._tf_checkpoint
        UpperCamelCase__					:    List[Any]          =   ''''''
       else:
        UpperCamelCase__					:    Any          =   self._tf_checkpoint
        UpperCamelCase__					:    List[Any]          =   ''''''
       convert_transfo_xl_checkpoint_to_pytorch(
           lowerCamelCase__							,	self._config							,	self._pytorch_dump_output							,	lowerCamelCase__			)
      elif self._model_type == "gpt2":
       try:
        from ..models.gpta.convert_gpta_original_tf_checkpoint_to_pytorch import (
            convert_gpta_checkpoint_to_pytorch,
        )
       except ImportError:
        raise ImportError(lowerCamelCase__			)

       convert_gpta_checkpoint_to_pytorch(self._tf_checkpoint							,	self._config							,	self._pytorch_dump_output			)
      elif self._model_type == "xlnet":
       try:
        from ..models.xlnet.convert_xlnet_original_tf_checkpoint_to_pytorch import (
            convert_xlnet_checkpoint_to_pytorch,
        )
       except ImportError:
        raise ImportError(lowerCamelCase__			)

       convert_xlnet_checkpoint_to_pytorch(
           self._tf_checkpoint							,	self._config							,	self._pytorch_dump_output							,	self._finetuning_task_name			)
      elif self._model_type == "xlm":
       from ..models.xlm.convert_xlm_original_pytorch_checkpoint_to_pytorch import (
           convert_xlm_checkpoint_to_pytorch,
       )

       convert_xlm_checkpoint_to_pytorch(self._tf_checkpoint							,	self._pytorch_dump_output			)
      elif self._model_type == "lxmert":
       from ..models.lxmert.convert_lxmert_original_tf_checkpoint_to_pytorch import (
           convert_lxmert_checkpoint_to_pytorch,
       )

       convert_lxmert_checkpoint_to_pytorch(self._tf_checkpoint							,	self._pytorch_dump_output			)
      elif self._model_type == "rembert":
       from ..models.rembert.convert_rembert_tf_checkpoint_to_pytorch import (
           convert_rembert_tf_checkpoint_to_pytorch,
       )

       convert_rembert_tf_checkpoint_to_pytorch(self._tf_checkpoint							,	self._config							,	self._pytorch_dump_output			)
      else:
       raise ValueError(
           '''--model_type should be selected in the list [bert, gpt, gpt2, t5, transfo_xl, xlnet, xlm, lxmert]'''			)


