

'''simple docstring'''






from __future__ import annotations

import copy
import inspect
import json
import math
import os
import tempfile
import unittest
from importlib import import_module

import numpy as np

from transformers import ViTMAEConfig
from transformers.file_utils import cached_property, is_tf_available, is_vision_available
from transformers.testing_utils import require_tf, require_vision, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
 import tensorflow as tf

 from transformers import TFViTMAEForPreTraining, TFViTMAEModel


if is_vision_available():
 from PIL import Image

 from transformers import ViTImageProcessor






class     lowercase_			:




  """simple docstring"""




  def __init__(   self     :  Optional[Any]      ,lowercase__     :  Any      ,lowercase__     :  Any=1_3      ,lowercase__     :  Dict=3_0      ,lowercase__     :  Any=2      ,lowercase__     :  Any=3      ,lowercase__     :  Dict=True      ,lowercase__     :  int=True      ,lowercase__     :  Optional[int]=3_2      ,lowercase__     :  List[Any]=2      ,lowercase__     :  List[Any]=4      ,lowercase__     :  Tuple=3_7      ,lowercase__     :  Dict="gelu"      ,lowercase__     :  Union[str, Any]=0.1      ,lowercase__     :  Dict=0.1      ,lowercase__     :  str=1_0      ,lowercase__     :  Optional[int]=0.0_2      ,lowercase__     :  int=3      ,lowercase__     :  str=0.6      ,lowercase__     :  Tuple=None      ,):
   __lowercase													=				parent
   __lowercase													=				batch_size
   __lowercase													=				image_size
   __lowercase													=				patch_size
   __lowercase													=				num_channels
   __lowercase													=				is_training
   __lowercase													=				use_labels
   __lowercase													=				hidden_size
   __lowercase													=				num_hidden_layers
   __lowercase													=				num_attention_heads
   __lowercase													=				intermediate_size
   __lowercase													=				hidden_act
   __lowercase													=				hidden_dropout_prob
   __lowercase													=				attention_probs_dropout_prob
   __lowercase													=				type_sequence_label_size
   __lowercase													=				initializer_range
   __lowercase													=				mask_ratio
   __lowercase													=				scope

   # in ViTMAE, the expected sequence length = (num_patches + 1) * (1 - config.mask_ratio), rounded above
   # (we add 1 for the [CLS] token)
   __lowercase													=				(image_size // patch_size) ** 2
   __lowercase													=				int(math.ceil((1 - mask_ratio) * (num_patches + 1)    )    )






  def       SCREAMING_SNAKE_CASE   (   self     :  List[str]    ):
   __lowercase													=				floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]    )

   __lowercase													=				None
   if self.use_labels:
    __lowercase													=				ids_tensor([self.batch_size]      ,self.type_sequence_label_size    )

   __lowercase													=				self.get_config()

   return config, pixel_values, labels






  def       SCREAMING_SNAKE_CASE   (   self     :  Dict    ):
   return ViTMAEConfig(
       image_size=self.image_size      ,patch_size=self.patch_size      ,num_channels=self.num_channels      ,hidden_size=self.hidden_size      ,num_hidden_layers=self.num_hidden_layers      ,num_attention_heads=self.num_attention_heads      ,intermediate_size=self.intermediate_size      ,decoder_hidden_size=self.hidden_size      ,decoder_num_hidden_layers=self.num_hidden_layers      ,decoder_num_attention_heads=self.num_attention_heads      ,decoder_intermediate_size=self.intermediate_size      ,hidden_act=self.hidden_act      ,hidden_dropout_prob=self.hidden_dropout_prob      ,attention_probs_dropout_prob=self.attention_probs_dropout_prob      ,is_decoder=lowercase__      ,initializer_range=self.initializer_range      ,mask_ratio=self.mask_ratio      ,)






  def       SCREAMING_SNAKE_CASE   (   self     :  List[Any]      ,lowercase__     :  List[Any]      ,lowercase__     :  Union[str, Any]      ,lowercase__     :  Optional[int]    ):
   __lowercase													=				TFViTMAEModel(config=lowercase__    )
   __lowercase													=				model(lowercase__      ,training=lowercase__    )
   self.parent.assertEqual(result.last_hidden_state.shape      ,(self.batch_size, self.seq_length, self.hidden_size)    )






  def       SCREAMING_SNAKE_CASE   (   self     :  Dict      ,lowercase__     :  Dict      ,lowercase__     :  List[Any]      ,lowercase__     :  List[str]    ):
   __lowercase													=				TFViTMAEForPreTraining(lowercase__    )
   __lowercase													=				model(lowercase__      ,training=lowercase__    )
   # expected sequence length = num_patches
   __lowercase													=				(self.image_size // self.patch_size) ** 2
   __lowercase													=				self.patch_size**2 * self.num_channels
   self.parent.assertEqual(result.logits.shape      ,(self.batch_size, num_patches, expected_num_channels)    )

   # test greyscale images
   __lowercase													=				1
   __lowercase													=				TFViTMAEForPreTraining(lowercase__    )

   __lowercase													=				floats_tensor([self.batch_size, 1, self.image_size, self.image_size]    )
   __lowercase													=				model(lowercase__      ,training=lowercase__    )
   __lowercase													=				self.patch_size**2
   self.parent.assertEqual(result.logits.shape      ,(self.batch_size, num_patches, expected_num_channels)    )






  def       SCREAMING_SNAKE_CASE   (   self     :  int    ):
   __lowercase													=				self.prepare_config_and_inputs()
   ((__lowercase)						,			(__lowercase)						,			(__lowercase))													=				config_and_inputs
   __lowercase													=				{'''pixel_values''': pixel_values}
   return config, inputs_dict






@require_tf
class     lowercase_			(lowerCamelCase__       , lowerCamelCase__       , unittest.TestCase   ):




  """simple docstring"""




  SCREAMING_SNAKE_CASE					:						int           =    (TFViTMAEModel, TFViTMAEForPreTraining) if is_tf_available() else ()
  SCREAMING_SNAKE_CASE					:						Dict           =    {'feature-extraction': TFViTMAEModel} if is_tf_available() else {}

  SCREAMING_SNAKE_CASE					:						int           =    False
  SCREAMING_SNAKE_CASE					:						Optional[Any]           =    False
  SCREAMING_SNAKE_CASE					:						List[Any]           =    False
  SCREAMING_SNAKE_CASE					:						List[str]           =    False






  def       SCREAMING_SNAKE_CASE   (   self     :  Any    ):
   __lowercase													=				TFViTMAEModelTester(self    )
   __lowercase													=				ConfigTester(self      ,config_class=lowercase__      ,has_text_modality=lowercase__      ,hidden_size=3_7    )






  def       SCREAMING_SNAKE_CASE   (   self     :  Optional[int]    ):
   self.config_tester.run_common_tests()






  @unittest.skip(reason='''ViTMAE does not use inputs_embeds'''    )
  def       SCREAMING_SNAKE_CASE   (   self     :  str    ):
   pass






  def       SCREAMING_SNAKE_CASE   (   self     :  List[Any]    ):
   __lowercase						,			__lowercase													=				self.model_tester.prepare_config_and_inputs_for_common()

   for model_class in self.all_model_classes:
    __lowercase													=				model_class(lowercase__    )
    self.assertIsInstance(model.get_input_embeddings()      ,(tf.keras.layers.Layer)    )
    __lowercase													=				model.get_output_embeddings()
    self.assertTrue(x is None or isinstance(lowercase__      ,tf.keras.layers.Layer    )    )






  def       SCREAMING_SNAKE_CASE   (   self     :  Tuple    ):
   __lowercase						,			__lowercase													=				self.model_tester.prepare_config_and_inputs_for_common()

   for model_class in self.all_model_classes:
    __lowercase													=				model_class(lowercase__    )
    __lowercase													=				inspect.signature(model.call    )
    # signature.parameters is an OrderedDict => so arg_names order is deterministic
    __lowercase													=				[*signature.parameters.keys()]

    __lowercase													=				['''pixel_values''']
    self.assertListEqual(arg_names[:1]      ,lowercase__    )






  def       SCREAMING_SNAKE_CASE   (   self     :  List[Any]    ):
   __lowercase													=				self.model_tester.prepare_config_and_inputs()
   self.model_tester.create_and_check_model(*lowercase__    )






  def       SCREAMING_SNAKE_CASE   (   self     :  Any    ):
   __lowercase													=				self.model_tester.prepare_config_and_inputs()
   self.model_tester.create_and_check_for_pretraining(*lowercase__    )






  def       SCREAMING_SNAKE_CASE   (   self     :  Optional[Any]    ):
   # make the mask reproducible
   np.random.seed(2    )

   __lowercase						,			__lowercase													=				self.model_tester.prepare_config_and_inputs_for_common()

   __lowercase													=				int((config.image_size // config.patch_size) ** 2    )
   __lowercase													=				np.random.uniform(size=(self.model_tester.batch_size, num_patches)    )

   for model_class in self.all_model_classes:
    __lowercase													=				model_class(lowercase__    )
    __lowercase													=				self._prepare_for_class(lowercase__      ,lowercase__    )

    __lowercase													=				model(lowercase__      ,noise=lowercase__    )

    __lowercase													=				copy.deepcopy(self._prepare_for_class(lowercase__      ,lowercase__    )    )
    __lowercase													=				model(**lowercase__      ,noise=lowercase__    )
    __lowercase													=				outputs_dict[0].numpy()
    __lowercase													=				outputs_keywords[0].numpy()

    self.assertLess(np.sum(np.abs(output_dict - output_keywords    )    )      ,1e-6    )






  def       SCREAMING_SNAKE_CASE   (   self     :  Optional[Any]    ):
   # make the mask reproducible
   np.random.seed(2    )

   __lowercase						,			__lowercase													=				self.model_tester.prepare_config_and_inputs_for_common()

   __lowercase													=				int((config.image_size // config.patch_size) ** 2    )
   __lowercase													=				np.random.uniform(size=(self.model_tester.batch_size, num_patches)    )

   def prepare_numpy_arrays(lowercase__     :  Tuple    ):
    __lowercase													=				{}
    for k, v in inputs_dict.items():
     if tf.is_tensor(lowercase__    ):
      __lowercase													=				v.numpy()
     else:
      __lowercase													=				np.array(lowercase__    )

    return inputs_np_dict

   for model_class in self.all_model_classes:
    __lowercase													=				model_class(lowercase__    )

    __lowercase													=				self._prepare_for_class(lowercase__      ,lowercase__    )
    __lowercase													=				prepare_numpy_arrays(lowercase__    )

    __lowercase													=				model(lowercase__      ,noise=lowercase__    )
    __lowercase													=				model(**lowercase__      ,noise=lowercase__    )
    self.assert_outputs_same(lowercase__      ,lowercase__    )






  def       SCREAMING_SNAKE_CASE   (   self     :  Optional[Any]      ,lowercase__     :  Any      ,lowercase__     :  Tuple      ,lowercase__     :  List[str]    ):
   # make masks reproducible
   np.random.seed(2    )

   __lowercase													=				int((tf_model.config.image_size // tf_model.config.patch_size) ** 2    )
   __lowercase													=				np.random.uniform(size=(self.model_tester.batch_size, num_patches)    )
   __lowercase													=				tf.constant(lowercase__    )

   # Add `noise` argument.
   # PT inputs will be prepared in `super().check_pt_tf_models()` with this added `noise` argument
   __lowercase													=				tf_noise

   super().check_pt_tf_models(lowercase__      ,lowercase__      ,lowercase__    )






  def       SCREAMING_SNAKE_CASE   (   self     :  Optional[Any]    ):
   # make mask reproducible
   np.random.seed(2    )

   __lowercase						,			__lowercase													=				self.model_tester.prepare_config_and_inputs_for_common()

   __lowercase													=				{
       module_member
       for model_class in self.all_model_classes
       for module in (import_module(model_class.__module__    ),)
       for module_member_name in dir(lowercase__    )
       if module_member_name.endswith('''MainLayer'''    )
       # This condition is required, since `modeling_tf_clip.py` has 3 classes whose names end with `MainLayer`.
       and module_member_name[: -len('''MainLayer'''    )] == model_class.__name__[: -len('''Model'''    )]
       for module_member in (getattr(lowercase__      ,lowercase__    ),)
       if isinstance(lowercase__      ,lowercase__    )
       and tf.keras.layers.Layer in module_member.__bases__
       and getattr(lowercase__      ,'''_keras_serializable'''      ,lowercase__    )
   }

   __lowercase													=				int((config.image_size // config.patch_size) ** 2    )
   __lowercase													=				np.random.uniform(size=(self.model_tester.batch_size, num_patches)    )
   __lowercase													=				tf.convert_to_tensor(lowercase__    )
   inputs_dict.update({'''noise''': noise}    )

   for main_layer_class in tf_main_layer_classes:
    __lowercase													=				main_layer_class(lowercase__    )

    __lowercase													=				{
        name: tf.keras.Input(tensor.shape[1:]      ,dtype=tensor.dtype    ) for name, tensor in inputs_dict.items()
    }

    __lowercase													=				tf.keras.Model(lowercase__      ,outputs=main_layer(lowercase__    )    )
    __lowercase													=				model(lowercase__    )

    with tempfile.TemporaryDirectory() as tmpdirname:
     __lowercase													=				os.path.join(lowercase__      ,'''keras_model.h5'''    )
     model.save(lowercase__    )
     __lowercase													=				tf.keras.models.load_model(
         lowercase__      ,custom_objects={main_layer_class.__name__: main_layer_class}    )
     assert isinstance(lowercase__      ,tf.keras.Model    )
     __lowercase													=				model(lowercase__    )
     self.assert_outputs_same(lowercase__      ,lowercase__    )






  @slow
  def       SCREAMING_SNAKE_CASE   (   self     :  Dict    ):
   # make mask reproducible
   np.random.seed(2    )

   __lowercase						,			__lowercase													=				self.model_tester.prepare_config_and_inputs_for_common()

   __lowercase													=				int((config.image_size // config.patch_size) ** 2    )
   __lowercase													=				np.random.uniform(size=(self.model_tester.batch_size, num_patches)    )

   for model_class in self.all_model_classes:
    __lowercase													=				model_class(lowercase__    )
    __lowercase													=				self._prepare_for_class(lowercase__      ,lowercase__    )
    __lowercase													=				model(lowercase__      ,noise=lowercase__    )

    if model_class.__name__ == "TFViTMAEModel":
     __lowercase													=				outputs.last_hidden_state.numpy()
     __lowercase													=				0
    else:
     __lowercase													=				outputs.logits.numpy()
     __lowercase													=				0

    with tempfile.TemporaryDirectory() as tmpdirname:
     model.save_pretrained(lowercase__      ,saved_model=lowercase__    )
     __lowercase													=				model_class.from_pretrained(lowercase__    )
     __lowercase													=				model(lowercase__      ,noise=lowercase__    )

     if model_class.__name__ == "TFViTMAEModel":
      __lowercase													=				after_outputs['''last_hidden_state'''].numpy()
      __lowercase													=				0
     else:
      __lowercase													=				after_outputs['''logits'''].numpy()
      __lowercase													=				0

     __lowercase													=				np.amax(np.abs(out_a - out_a    )    )
     self.assertLessEqual(lowercase__      ,1e-5    )






  def       SCREAMING_SNAKE_CASE   (   self     :  Any    ):
   # make mask reproducible
   np.random.seed(2    )

   __lowercase						,			__lowercase													=				self.model_tester.prepare_config_and_inputs_for_common()

   __lowercase													=				int((config.image_size // config.patch_size) ** 2    )
   __lowercase													=				np.random.uniform(size=(self.model_tester.batch_size, num_patches)    )

   for model_class in self.all_model_classes:
    __lowercase													=				model_class(lowercase__    )
    __lowercase													=				self._prepare_for_class(lowercase__      ,lowercase__    )

    __lowercase													=				model(lowercase__      ,noise=lowercase__    )
    __lowercase													=				model.get_config()
    # make sure that returned config is jsonifiable, which is required by keras
    json.dumps(lowercase__    )
    __lowercase													=				model_class.from_config(model.get_config()    )
    # make sure it also accepts a normal config
    __lowercase													=				model_class.from_config(model.config    )
    __lowercase													=				new_model(lowercase__    )  # Build model
    new_model.set_weights(model.get_weights()    )
    __lowercase													=				new_model(lowercase__      ,noise=lowercase__    )

    self.assert_outputs_same(lowercase__      ,lowercase__    )






  @unittest.skip(
      reason='''ViTMAE returns a random mask + ids_restore in each forward pass. See test_save_load
    to get deterministic results.'''    )
  def       SCREAMING_SNAKE_CASE   (   self     :  str    ):
   pass






  @unittest.skip(reason='''ViTMAE returns a random mask + ids_restore in each forward pass. See test_save_load'''    )
  def       SCREAMING_SNAKE_CASE   (   self     :  Dict    ):
   pass






  @slow
  def       SCREAMING_SNAKE_CASE   (   self     :  Tuple    ):
   __lowercase													=				TFViTMAEModel.from_pretrained('''google/vit-base-patch16-224'''    )
   self.assertIsNotNone(lowercase__    )


def 	_A  (					):






 """simple docstring"""



 __lowercase													=				Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''   )
 return image






@require_tf
@require_vision
class     lowercase_			(unittest.TestCase   ):




  """simple docstring"""




  @cached_property
  def       SCREAMING_SNAKE_CASE   (   self     :  int    ):
   return ViTImageProcessor.from_pretrained('''facebook/vit-mae-base'''    ) if is_vision_available() else None






  @slow
  def       SCREAMING_SNAKE_CASE   (   self     :  Dict    ):
   # make random mask reproducible across the PT and TF model
   np.random.seed(2    )

   __lowercase													=				TFViTMAEForPreTraining.from_pretrained('''facebook/vit-mae-base'''    )

   __lowercase													=				self.default_image_processor
   __lowercase													=				prepare_img()
   __lowercase													=				image_processor(images=lowercase__      ,return_tensors='''tf'''    )

   # prepare a noise vector that will be also used for testing the TF model
   # (this way we can ensure that the PT and TF models operate on the same inputs)
   __lowercase													=				ViTMAEConfig()
   __lowercase													=				int((vit_mae_config.image_size // vit_mae_config.patch_size) ** 2    )
   __lowercase													=				np.random.uniform(size=(1, num_patches)    )

   # forward pass
   __lowercase													=				model(**lowercase__      ,noise=lowercase__    )

   # verify the logits
   __lowercase													=				tf.convert_to_tensor([1, 1_9_6, 7_6_8]    )
   self.assertEqual(outputs.logits.shape      ,lowercase__    )

   __lowercase													=				tf.convert_to_tensor(
       [[-0.0_5_4_8, -1.7_0_2_3, -0.9_3_2_5], [0.3_7_2_1, -0.5_6_7_0, -0.2_2_3_3], [0.8_2_3_5, -1.3_8_7_8, -0.3_5_2_4]]    )

   tf.debugging.assert_near(outputs.logits[0, :3, :3]      ,lowercase__      ,atol=1e-4    )




'''simple docstring'''






import argparse
import logging
from collections import namedtuple

import torch
from model_bertabs import BertAbsSummarizer
from models.model_builder import AbsSummarizer  # The authors' implementation

from transformers import BertTokenizer


logging.basicConfig(level=logging.INFO)
lowerCAmelCase__      		=			logging.getLogger(__name__)


lowerCAmelCase__      		=			'''Hello world! cécé herlolip'''


lowerCAmelCase__      		=			namedtuple(
    '''BertAbsConfig''',
    [
        '''temp_dir''',
        '''large''',
        '''use_bert_emb''',
        '''finetune_bert''',
        '''encoder''',
        '''share_emb''',
        '''max_pos''',
        '''enc_layers''',
        '''enc_hidden_size''',
        '''enc_heads''',
        '''enc_ff_size''',
        '''enc_dropout''',
        '''dec_layers''',
        '''dec_hidden_size''',
        '''dec_heads''',
        '''dec_ff_size''',
        '''dec_dropout''',
    ],
)


def 	_A  (					A__  ,       A__   ):






 """simple docstring"""



 __lowercase													=				BertAbsConfig(
     temp_dir='''.'''  ,       finetune_bert=A__  ,       large=A__  ,       share_emb=A__  ,       use_bert_emb=A__  ,       encoder='''bert'''  ,       max_pos=512  ,       enc_layers=6  ,       enc_hidden_size=512  ,       enc_heads=8  ,       enc_ff_size=512  ,       enc_dropout=0.2  ,       dec_layers=6  ,       dec_hidden_size=768  ,       dec_heads=8  ,       dec_ff_size=2048  ,       dec_dropout=0.2  ,       )
 __lowercase													=				torch.load(A__  ,       lambda A__  ,       A__   : storage   )
 __lowercase													=				AbsSummarizer(A__  ,       torch.device('''cpu'''   )  ,       A__   )
 original.eval()

 __lowercase													=				BertAbsSummarizer(A__  ,       torch.device('''cpu'''   )   )
 new_model.eval()

 # -------------------
 # Convert the weights
 # -------------------

 logging.info('''convert the model'''   )
 new_model.bert.load_state_dict(original.bert.state_dict()   )
 new_model.decoder.load_state_dict(original.decoder.state_dict()   )
 new_model.generator.load_state_dict(original.generator.state_dict()   )

 # ----------------------------------
 # Make sure the outpus are identical
 # ----------------------------------

 logging.info('''Make sure that the models\' outputs are identical'''   )
 __lowercase													=				BertTokenizer.from_pretrained('''bert-base-uncased'''   )

 # prepare the model inputs
 __lowercase													=				tokenizer.encode('''This is sample éàalj\'-.'''   )
 encoder_input_ids.extend([tokenizer.pad_token_id] * (512 - len(A__   ))   )
 __lowercase													=				torch.tensor(A__   ).unsqueeze(0   )
 __lowercase													=				tokenizer.encode('''This is sample 3 éàalj\'-.'''   )
 decoder_input_ids.extend([tokenizer.pad_token_id] * (512 - len(A__   ))   )
 __lowercase													=				torch.tensor(A__   ).unsqueeze(0   )

 # failsafe to make sure the weights reset does not affect the
 # loaded weights.
 assert torch.max(torch.abs(original.generator[0].weight - new_model.generator[0].weight   )   ) == 0

 # forward pass
 __lowercase													=				encoder_input_ids
 __lowercase													=				decoder_input_ids
 __lowercase													=				__lowercase													=				None
 __lowercase													=				None
 __lowercase													=				__lowercase													=				None
 __lowercase													=				__lowercase													=				None
 __lowercase													=				None

 # The original model does not apply the geneator layer immediatly but rather in
 # the beam search (where it combines softmax + linear layer). Since we already
 # apply the softmax in our generation process we only apply the linear layer here.
 # We make sure that the outputs of the full stack are identical
 __lowercase													=				original(A__  ,       A__  ,       A__  ,       A__  ,       A__  ,       A__  ,       A__   )[0]
 __lowercase													=				original.generator(A__   )

 __lowercase													=				new_model(
     A__  ,       A__  ,       A__  ,       A__  ,       A__   )[0]
 __lowercase													=				new_model.generator(A__   )

 __lowercase													=				torch.max(torch.abs(output_converted_model - output_original_model   )   ).item()
 print('''Maximum absolute difference beween weights: {:.2f}'''.format(A__   )   )
 __lowercase													=				torch.max(torch.abs(output_converted_generator - output_original_generator   )   ).item()
 print('''Maximum absolute difference beween weights: {:.2f}'''.format(A__   )   )

 __lowercase													=				torch.allclose(A__  ,       A__  ,       atol=1e-3   )
 if are_identical:
  logging.info('''all weights are equal up to 1e-3'''   )
 else:
  raise ValueError('''the weights are different. The new model is likely different from the original one.'''   )

 # The model has been saved with torch.save(model) and this is bound to the exact
 # directory structure. We save the state_dict instead.
 logging.info('''saving the model\'s state dictionary'''   )
 torch.save(
     new_model.state_dict()  ,       '''./bertabs-finetuned-cnndm-extractive-abstractive-summarization/pytorch_model.bin'''   )


if __name__ == "__main__":
 lowerCAmelCase__      		=			argparse.ArgumentParser()
 parser.add_argument(
     '''--bertabs_checkpoint_path''',
     default=None,
     type=str,
     required=True,
     help='''Path the official PyTorch dump.''',
 )
 parser.add_argument(
     '''--pytorch_dump_folder_path''',
     default=None,
     type=str,
     required=True,
     help='''Path to the output PyTorch model.''',
 )
 lowerCAmelCase__      		=			parser.parse_args()

 convert_bertabs_checkpoints(
     args.bertabs_checkpoint_path,
     args.pytorch_dump_folder_path,
 )

