

"""simple docstring"""


import os
import tempfile
import unittest

from transformers import FlaubertConfig, is_torch_available
from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
  import torch

  from transformers import (
      FlaubertForMultipleChoice,
      FlaubertForQuestionAnswering,
      FlaubertForQuestionAnsweringSimple,
      FlaubertForSequenceClassification,
      FlaubertForTokenClassification,
      FlaubertModel,
      FlaubertWithLMHeadModel,
  )
  from transformers.models.flaubert.modeling_flaubert import FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST





class lowerCamelCase__   (				SCREAMING_SNAKE_CASE_    ):



    '''simple docstring'''




    def __init__( self ,lowerCamelCase_ ,lowerCamelCase_=1_3 ,lowerCamelCase_=7 ,lowerCamelCase_=True ,lowerCamelCase_=True ,lowerCamelCase_=True ,lowerCamelCase_=True ,lowerCamelCase_=True ,lowerCamelCase_=False ,lowerCamelCase_=False ,lowerCamelCase_=False ,lowerCamelCase_=2 ,lowerCamelCase_=9_9 ,lowerCamelCase_=0 ,lowerCamelCase_=3_2 ,lowerCamelCase_=5 ,lowerCamelCase_=4 ,lowerCamelCase_=0.1 ,lowerCamelCase_=0.1 ,lowerCamelCase_=5_1_2 ,lowerCamelCase_=1_2 ,lowerCamelCase_=2 ,lowerCamelCase_=0.02 ,lowerCamelCase_=3 ,lowerCamelCase_=4 ,lowerCamelCase_="last" ,lowerCamelCase_=None ,lowerCamelCase_=None ,)    ->      Tuple:
          A				  =		parent
          A				  =		batch_size
          A				  =		seq_length
          A				  =		is_training
          A				  =		use_input_lengths
          A				  =		use_token_type_ids
          A				  =		use_labels
          A				  =		gelu_activation
          A				  =		sinusoidal_embeddings
          A				  =		causal
          A				  =		asm
          A				  =		n_langs
          A				  =		vocab_size
          A				  =		n_special
          A				  =		hidden_size
          A				  =		num_hidden_layers
          A				  =		num_attention_heads
          A				  =		hidden_dropout_prob
          A				  =		attention_probs_dropout_prob
          A				  =		max_position_embeddings
          A				  =		type_vocab_size
          A				  =		type_sequence_label_size
          A				  =		initializer_range
          A				  =		num_labels
          A				  =		num_choices
          A				  =		summary_type
          A				  =		use_proj
          A				  =		scope




    def UpperCamelCase__		( self    )    ->      List[str]:
          A				  =		ids_tensor([self.batch_size, self.seq_length] ,self.vocab_size    )
          A				  =		random_attention_mask([self.batch_size, self.seq_length]    )

          A				  =		None
          if self.use_input_lengths:
                A				  =		(
                    ids_tensor([self.batch_size] ,vocab_size=2    ) + self.seq_length - 2
                )  # small variation of seq_length

          A				  =		None
          if self.use_token_type_ids:
                A				  =		ids_tensor([self.batch_size, self.seq_length] ,self.n_langs    )

          A				  =		None
          A				  =		None
          A				  =		None
          if self.use_labels:
                A				  =		ids_tensor([self.batch_size] ,self.type_sequence_label_size    )
                A				  =		ids_tensor([self.batch_size, self.seq_length] ,self.num_labels    )
                A				  =		ids_tensor([self.batch_size] ,2    ).float()
                A				  =		ids_tensor([self.batch_size] ,self.num_choices    )

          A				  =		self.get_config()

          return (
              config,
              input_ids,
              token_type_ids,
              input_lengths,
              sequence_labels,
              token_labels,
              is_impossible_labels,
              choice_labels,
              input_mask,
          )




    def UpperCamelCase__		( self    )    ->      Optional[Any]:
          return FlaubertConfig(
              vocab_size=self.vocab_size ,n_special=self.n_special ,emb_dim=self.hidden_size ,n_layers=self.num_hidden_layers ,n_heads=self.num_attention_heads ,dropout=self.hidden_dropout_prob ,attention_dropout=self.attention_probs_dropout_prob ,gelu_activation=self.gelu_activation ,sinusoidal_embeddings=self.sinusoidal_embeddings ,asm=self.asm ,causal=self.causal ,n_langs=self.n_langs ,max_position_embeddings=self.max_position_embeddings ,initializer_range=self.initializer_range ,summary_type=self.summary_type ,use_proj=self.use_proj ,)




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,)    ->      List[str]:
          A				  =		FlaubertModel(config=snake_case__    )
          model.to(snake_case__    )
          model.eval()
          A				  =		model(snake_case__ ,lengths=snake_case__ ,langs=snake_case__    )
          A				  =		model(snake_case__ ,langs=snake_case__    )
          A				  =		model(snake_case__    )
          self.parent.assertEqual(result.last_hidden_state.shape ,(self.batch_size, self.seq_length, self.hidden_size)    )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,)    ->      Dict:
          A				  =		FlaubertWithLMHeadModel(snake_case__    )
          model.to(snake_case__    )
          model.eval()

          A				  =		model(snake_case__ ,token_type_ids=snake_case__ ,labels=snake_case__    )
          self.parent.assertEqual(result.loss.shape ,()    )
          self.parent.assertEqual(result.logits.shape ,(self.batch_size, self.seq_length, self.vocab_size)    )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,)    ->      Any:
          A				  =		FlaubertForQuestionAnsweringSimple(snake_case__    )
          model.to(snake_case__    )
          model.eval()

          A				  =		model(snake_case__    )

          A				  =		model(snake_case__ ,start_positions=snake_case__ ,end_positions=snake_case__    )
          self.parent.assertEqual(result.start_logits.shape ,(self.batch_size, self.seq_length)    )
          self.parent.assertEqual(result.end_logits.shape ,(self.batch_size, self.seq_length)    )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,)    ->      Tuple:
          A				  =		FlaubertForQuestionAnswering(snake_case__    )
          model.to(snake_case__    )
          model.eval()

          A				  =		model(snake_case__    )

          A				  =		model(
              snake_case__ ,start_positions=snake_case__ ,end_positions=snake_case__ ,cls_index=snake_case__ ,is_impossible=snake_case__ ,p_mask=snake_case__ ,)

          A				  =		model(
              snake_case__ ,start_positions=snake_case__ ,end_positions=snake_case__ ,cls_index=snake_case__ ,is_impossible=snake_case__ ,)

          (A  )				  =		result_with_labels.to_tuple()

          A				  =		model(snake_case__ ,start_positions=snake_case__ ,end_positions=snake_case__    )

          (A  )				  =		result_with_labels.to_tuple()

          self.parent.assertEqual(result_with_labels.loss.shape ,()    )
          self.parent.assertEqual(result.start_top_log_probs.shape ,(self.batch_size, model.config.start_n_top)    )
          self.parent.assertEqual(result.start_top_index.shape ,(self.batch_size, model.config.start_n_top)    )
          self.parent.assertEqual(
              result.end_top_log_probs.shape ,(self.batch_size, model.config.start_n_top * model.config.end_n_top)    )
          self.parent.assertEqual(
              result.end_top_index.shape ,(self.batch_size, model.config.start_n_top * model.config.end_n_top)    )
          self.parent.assertEqual(result.cls_logits.shape ,(self.batch_size,)    )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,)    ->      Any:
          A				  =		FlaubertForSequenceClassification(snake_case__    )
          model.to(snake_case__    )
          model.eval()

          A				  =		model(snake_case__    )
          A				  =		model(snake_case__ ,labels=snake_case__    )

          self.parent.assertEqual(result.loss.shape ,()    )
          self.parent.assertEqual(result.logits.shape ,(self.batch_size, self.type_sequence_label_size)    )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,)    ->      List[Any]:
          A				  =		self.num_labels
          A				  =		FlaubertForTokenClassification(snake_case__    )
          model.to(snake_case__    )
          model.eval()

          A				  =		model(snake_case__ ,attention_mask=snake_case__ ,labels=snake_case__    )
          self.parent.assertEqual(result.logits.shape ,(self.batch_size, self.seq_length, self.num_labels)    )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,)    ->      Optional[int]:
          A				  =		self.num_choices
          A				  =		FlaubertForMultipleChoice(config=snake_case__    )
          model.to(snake_case__    )
          model.eval()
          A				  =		input_ids.unsqueeze(1    ).expand(-1 ,self.num_choices ,-1    ).contiguous()
          A				  =		token_type_ids.unsqueeze(1    ).expand(-1 ,self.num_choices ,-1    ).contiguous()
          A				  =		input_mask.unsqueeze(1    ).expand(-1 ,self.num_choices ,-1    ).contiguous()
          A				  =		model(
              snake_case__ ,attention_mask=snake_case__ ,token_type_ids=snake_case__ ,labels=snake_case__ ,)
          self.parent.assertEqual(result.logits.shape ,(self.batch_size, self.num_choices)    )




    def UpperCamelCase__		( self    )    ->      List[str]:
          A				  =		self.prepare_config_and_inputs()
          (
              A  
          )				  =		config_and_inputs
          A				  =		{
              'input_ids': input_ids,
              'token_type_ids': token_type_ids,
              'lengths': input_lengths,
              'attention_mask': input_mask,
          }
          return config, inputs_dict





@require_torch
class lowerCamelCase__   (				SCREAMING_SNAKE_CASE_     ,   SCREAMING_SNAKE_CASE_     ,   unittest.TestCase    ):



    '''simple docstring'''




    _lowerCamelCase					=   (
        (
            FlaubertModel,
            FlaubertWithLMHeadModel,
            FlaubertForQuestionAnswering,
            FlaubertForQuestionAnsweringSimple,
            FlaubertForSequenceClassification,
            FlaubertForTokenClassification,
            FlaubertForMultipleChoice,
        )
        if is_torch_available()
        else ()
    )
    _lowerCamelCase					=   (
        {
            '''feature-extraction''': FlaubertModel,
            '''fill-mask''': FlaubertWithLMHeadModel,
            '''question-answering''': FlaubertForQuestionAnsweringSimple,
            '''text-classification''': FlaubertForSequenceClassification,
            '''token-classification''': FlaubertForTokenClassification,
            '''zero-shot''': FlaubertForSequenceClassification,
        }
        if is_torch_available()
        else {}
    )




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_    )    ->      Optional[Any]:

          if (
              pipeline_test_casse_name == "QAPipelineTests"
              and tokenizer_name is not None
              and not tokenizer_name.endswith("""Fast"""    )
          ):
                # `QAPipelineTests` fails for a few models when the slower tokenizer are used.
                # (The slower tokenizers were never used for pipeline tests before the pipeline testing rework)
                # TODO: check (and possibly fix) the `QAPipelineTests` with slower tokenizer
                return True

          return False




    def UpperCamelCase__		( self ,lowerCamelCase_ ,lowerCamelCase_ ,lowerCamelCase_=False    )    ->      int:
          A				  =		super()._prepare_for_class(snake_case__ ,snake_case__ ,return_labels=snake_case__    )

          if return_labels:
                if model_class.__name__ == "FlaubertForQuestionAnswering":
                      A				  =		torch.zeros(
                          self.model_tester.batch_size ,dtype=torch.long ,device=snake_case__    )
                      A				  =		torch.zeros(
                          self.model_tester.batch_size ,dtype=torch.long ,device=snake_case__    )

          return inputs_dict




    def UpperCamelCase__		( self    )    ->      List[Any]:
          A				  =		FlaubertModelTester(self    )
          A				  =		ConfigTester(self ,config_class=snake_case__ ,emb_dim=3_7    )




    def UpperCamelCase__		( self    )    ->      List[Any]:
          self.config_tester.run_common_tests()




    def UpperCamelCase__		( self    )    ->      Optional[Any]:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_flaubert_model(*snake_case__    )




    def UpperCamelCase__		( self    )    ->      Tuple:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_flaubert_lm_head(*snake_case__    )




    def UpperCamelCase__		( self    )    ->      str:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_flaubert_simple_qa(*snake_case__    )




    def UpperCamelCase__		( self    )    ->      List[str]:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_flaubert_qa(*snake_case__    )




    def UpperCamelCase__		( self    )    ->      int:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_flaubert_sequence_classif(*snake_case__    )




    def UpperCamelCase__		( self    )    ->      Dict:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_flaubert_token_classif(*snake_case__    )




    def UpperCamelCase__		( self    )    ->      List[Any]:
          A				  =		self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_flaubert_multiple_choice(*snake_case__    )




    @slow
    def UpperCamelCase__		( self    )    ->      str:

          for model_name in FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                A				  =		FlaubertModel.from_pretrained(snake_case__    )
                self.assertIsNotNone(snake_case__    )




    @slow
    @require_torch_gpu
    def UpperCamelCase__		( self    )    ->      Union[str, Any]:
          A				  =		self.model_tester.prepare_config_and_inputs_for_common()
          for model_class in self.all_model_classes:
                # FlauBertForMultipleChoice behaves incorrectly in JIT environments.
                if model_class == FlaubertForMultipleChoice:
                      return

                A				  =		True
                A				  =		model_class(config=snake_case__    )

                A				  =		self._prepare_for_class(snake_case__ ,snake_case__    )
                A				  =		torch.jit.trace(
                    snake_case__ ,(inputs_dict["""input_ids"""].to("""cpu"""    ), inputs_dict["""attention_mask"""].to("""cpu"""    ))    )

                with tempfile.TemporaryDirectory() as tmp:
                      torch.jit.save(snake_case__ ,os.path.join(snake_case__ ,"""traced_model.pt"""    )    )
                      A				  =		torch.jit.load(os.path.join(snake_case__ ,"""traced_model.pt"""    ) ,map_location=snake_case__    )
                      loaded(inputs_dict["""input_ids"""].to(snake_case__    ) ,inputs_dict["""attention_mask"""].to(snake_case__    )    )





@require_torch
class lowerCamelCase__   (				unittest.TestCase    ):



    '''simple docstring'''




    @slow
    def UpperCamelCase__		( self    )    ->      List[Any]:
          A				  =		FlaubertModel.from_pretrained("""flaubert/flaubert_base_cased"""    )
          A				  =		torch.tensor([[0, 3_4_5, 2_3_2, 3_2_8, 7_4_0, 1_4_0, 1_6_9_5, 6_9, 6_0_7_8, 1_5_8_8, 2]]    )
          with torch.no_grad():
                A				  =		model(snake_case__    )[0]
          A				  =		torch.Size((1, 1_1, 7_6_8)    )
          self.assertEqual(output.shape ,snake_case__    )
          A				  =		torch.tensor(
              [[[-2.62_51, -1.42_98, -0.02_27], [-2.85_10, -1.63_87, 0.22_58], [-2.81_14, -1.18_32, -0.30_66]]]    )

          self.assertTrue(torch.allclose(output[:, :3, :3] ,snake_case__ ,atol=1E-4    )    )








'''simple docstring'''







from argparse import ArgumentParser, Namespace

from ..utils import logging
from . import BaseTransformersCLICommand






def       lowercase					(_A       ):







       """simple docstring"""







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


lowerCAmelCase     :  Optional[int]											=    """
transformers can only be used from the commandline to convert TensorFlow models in PyTorch, In that case, it requires
TensorFlow to be installed. Please see https://www.tensorflow.org/install/ for installation instructions.
"""
class 						UpperCamelCase__       (			SCREAMING_SNAKE_CASE_						):



     """simple docstring"""






     @staticmethod
     def a						(			snake_case__ ):

            '''simple docstring'''

            _lowerCAmelCase     :				str       =							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=snake_case__   ,						required=snake_case__   ,						help='Model\'s type.' )
            train_parser.add_argument(
                '--tf_checkpoint'   ,						type=snake_case__   ,						required=snake_case__   ,						help='TensorFlow checkpoint path or folder.' )
            train_parser.add_argument(
                '--pytorch_dump_output'   ,						type=snake_case__   ,						required=snake_case__   ,						help='Path to the PyTorch saved model output.' )
            train_parser.add_argument('--config'   ,						type=snake_case__   ,						default=''   ,						help='Configuration file path or folder.' )
            train_parser.add_argument(
                '--finetuning_task_name'   ,						type=snake_case__   ,						default=snake_case__   ,						help='Optional fine-tuning task name if the TF model was a finetuned model.'   ,						)
            train_parser.set_defaults(func=snake_case__ )







     def __init__(			self   ,						snake_case__   ,						snake_case__   ,						snake_case__   ,						snake_case__   ,						snake_case__   ,						*snake_case__   ,						):

            '''simple docstring'''

            _lowerCAmelCase     :				str       =							logging.get_logger('transformers-cli/converting' )

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







     def a						(			self ):

            '''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(snake_case__ )

                   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(snake_case__ )

                   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(snake_case__ )

                   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(snake_case__ )

                   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(snake_case__ )

                   if "ckpt" in self._tf_checkpoint.lower():
                          _lowerCAmelCase     :				List[Any]       =							self._tf_checkpoint
                          _lowerCAmelCase     :				Optional[int]       =							''
                   else:
                          _lowerCAmelCase     :				int       =							self._tf_checkpoint
                          _lowerCAmelCase     :				Dict       =							''
                   convert_transfo_xl_checkpoint_to_pytorch(
                       snake_case__   ,						self._config   ,						self._pytorch_dump_output   ,						snake_case__ )
            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(snake_case__ )

                   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(snake_case__ )

                   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]' )

