


import copy
import inspect
import unittest

import numpy as np
from huggingface_hub import hf_hub_download

from transformers import VivitConfig
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor


if is_torch_available():
 import torch
 from torch import nn

 from transformers import MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING, VivitForVideoClassification, VivitModel
 from transformers.models.vivit.modeling_vivit import VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
 from transformers import VivitImageProcessor




class A						:






      def __init__(      self		:  Optional[Any]    ,     lowercase_		:  str    ,     lowercase_		:  Dict=2    ,     lowercase_		:  Optional[int]=True    ,     lowercase_		:  List[str]=True    ,     lowercase_		:  str=10    ,     lowercase_		:  Optional[Any]=10    ,     lowercase_		:  Union[str, Any]=8    ,     lowercase_		:  Optional[int]=[2, 4, 4]    ,     lowercase_		:  Optional[int]=3    ,     lowercase_		:  Optional[Any]=768    ,     lowercase_		:  Dict=5    ,     lowercase_		:  Union[str, Any]=4    ,     lowercase_		:  str=37    ,     lowercase_		:  Union[str, Any]="gelu_fast"    ,     lowercase_		:  int=0.0    ,     lowercase_		:  Union[str, Any]=0.0    ,     lowercase_		:  Tuple=0.02    ,     lowercase_		:  int=1E-06    ,     lowercase_		:  List[Any]=True    ,     lowercase_		:  Optional[int]=None    ,     )      ->		Any:
             """simple docstring"""




             _lowerCamelCase :	int						=parent
             _lowerCamelCase :	Tuple						=batch_size
             _lowerCamelCase :	Optional[Any]						=is_training
             _lowerCamelCase :	Optional[int]						=use_labels
             _lowerCamelCase :	str						=num_labels
             _lowerCamelCase :	int						=image_size
             _lowerCamelCase :	int						=num_frames
             _lowerCamelCase :	Union[str, Any]						=tubelet_size
             _lowerCamelCase :	str						=num_channels
             _lowerCamelCase :	Any						=hidden_size
             _lowerCamelCase :	Union[str, Any]						=num_hidden_layers
             _lowerCamelCase :	List[Any]						=num_attention_heads
             _lowerCamelCase :	int						=intermediate_size
             _lowerCamelCase :	Optional[int]						=hidden_act
             _lowerCamelCase :	Optional[int]						=hidden_dropout_prob
             _lowerCamelCase :	Any						=attention_probs_dropout_prob
             _lowerCamelCase :	Any						=initializer_range
             _lowerCamelCase :	str						=layer_norm_eps
             _lowerCamelCase :	Optional[int]						=qkv_bias
             _lowerCamelCase :	Dict						=scope

             _lowerCamelCase :	Tuple						=(
                 (self.image_size // self.tubelet_size[2])
                 * (self.image_size // self.tubelet_size[1])
                 * (self.num_frames // self.tubelet_size[0])
             ) + 1  # CLS token






      def  lowerCamelCase (      self		:  Union[str, Any]				)      ->		Any:
             """simple docstring"""




             _lowerCamelCase :	List[str]						=floats_tensor(
                 [self.batch_size, self.num_frames, self.num_channels, self.image_size, self.image_size]				)

             _lowerCamelCase :	Union[str, Any]						=None
             if self.use_labels:
                    _lowerCamelCase :	List[Any]						=ids_tensor([self.batch_size]    ,     self.num_labels				)

             _lowerCamelCase :	Optional[int]						=self.get_config()

             return config, pixel_values, labels






      def  lowerCamelCase (      self		:  Optional[int]				)      ->		Union[str, Any]:
             """simple docstring"""




             _lowerCamelCase :	Tuple						=VivitConfig(
                 num_frames=self.num_frames    ,     image_size=self.image_size    ,     tubelet_size=self.tubelet_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    ,     hidden_act=self.hidden_act    ,     hidden_dropout_prob=self.hidden_dropout_prob    ,     attention_probs_dropout_prob=self.attention_probs_dropout_prob    ,     initializer_range=self.initializer_range    ,     layer_norm_eps=self.layer_norm_eps    ,     qkv_bias=self.qkv_bias    ,     )
             _lowerCamelCase :	Union[str, Any]						=self.num_labels
             return config






      def  lowerCamelCase (      self		:  Optional[Any]    ,     lowercase_		:  Dict    ,     lowercase_		:  List[Any]    ,     lowercase_		:  Tuple				)      ->		Any:
             """simple docstring"""




             _lowerCamelCase :	Dict						=VivitModel(config=lowercase_				)
             model.to(lowercase_				)
             model.eval()
             _lowerCamelCase :	Optional[int]						=model(lowercase_				)
             self.parent.assertEqual(result.last_hidden_state.shape    ,     (self.batch_size, self.seq_length, self.hidden_size)				)






      def  lowerCamelCase (      self		:  List[Any]    ,     lowercase_		:  List[Any]    ,     lowercase_		:  Dict    ,     lowercase_		:  List[Any]				)      ->		Dict:
             """simple docstring"""




             _lowerCamelCase :	Union[str, Any]						=VivitForVideoClassification(lowercase_				)
             model.to(lowercase_				)
             model.eval()

             _lowerCamelCase :	int						=model(lowercase_				)

             # verify the logits shape
             _lowerCamelCase :	int						=torch.Size((self.batch_size, self.num_labels)				)
             self.parent.assertEqual(result.logits.shape    ,     lowercase_				)






      def  lowerCamelCase (      self		:  List[Any]				)      ->		List[str]:
             """simple docstring"""




             _lowerCamelCase :	Tuple						=self.prepare_config_and_inputs()
             _lowerCamelCase			,  _lowerCamelCase			,  _lowerCamelCase :	Optional[int]						=config_and_inputs
             _lowerCamelCase :	List[str]						={'pixel_values': pixel_values}
             return config, inputs_dict




@require_torch
class A						(     UpperCamelCase_					,							unittest.TestCase  ):
      UpperCamelCase__							:						int   =(VivitModel, VivitForVideoClassification) if is_torch_available() else ()

      UpperCamelCase__							:						Union[str, Any]   =False
      UpperCamelCase__							:						str   =False
      UpperCamelCase__							:						int   =False
      UpperCamelCase__							:						List[Any]   =False






      def  lowerCamelCase (      self		:  Any				)      ->		int:
             """simple docstring"""




             _lowerCamelCase :	str						=VivitModelTester(self				)
             _lowerCamelCase :	List[str]						=ConfigTester(self    ,     config_class=lowercase_    ,     has_text_modality=lowercase_    ,     hidden_size=37				)






      def  lowerCamelCase (      self		:  Dict    ,     lowercase_		:  Optional[Any]    ,     lowercase_		:  List[str]    ,     lowercase_		:  Tuple=False				)      ->		str:
             """simple docstring"""




             _lowerCamelCase :	Dict						=copy.deepcopy(lowercase_				)

             if return_labels:
                    if model_class in get_values(lowercase_				):
                           _lowerCamelCase :	int						=torch.zeros(
                               self.model_tester.batch_size    ,     dtype=torch.long    ,     device=lowercase_				)

             return inputs_dict






      def  lowerCamelCase (      self		:  List[Any]				)      ->		List[str]:
             """simple docstring"""




             self.config_tester.run_common_tests()






      @unittest.skip(reason='Vivit does not use inputs_embeds'				)
      def  lowerCamelCase (      self		:  List[Any]				)      ->		Optional[int]:
             """simple docstring"""




             pass






      def  lowerCamelCase (      self		:  Tuple				)      ->		Any:
             """simple docstring"""




             _lowerCamelCase			,  _lowerCamelCase :	Dict						=self.model_tester.prepare_config_and_inputs_for_common()

             for model_class in self.all_model_classes:
                    _lowerCamelCase :	List[Any]						=model_class(lowercase_				)
                    self.assertIsInstance(model.get_input_embeddings()    ,     (nn.Module)				)
                    _lowerCamelCase :	Dict						=model.get_output_embeddings()
                    self.assertTrue(x is None or isinstance(lowercase_    ,     nn.Linear				)				)






      def  lowerCamelCase (      self		:  Optional[Any]				)      ->		Union[str, Any]:
             """simple docstring"""




             _lowerCamelCase			,  _lowerCamelCase :	Optional[Any]						=self.model_tester.prepare_config_and_inputs_for_common()

             for model_class in self.all_model_classes:
                    _lowerCamelCase :	str						=model_class(lowercase_				)
                    _lowerCamelCase :	List[str]						=inspect.signature(model.forward				)
                    # signature.parameters is an OrderedDict => so arg_names order is deterministic
                    _lowerCamelCase :	Optional[Any]						=[*signature.parameters.keys()]

                    _lowerCamelCase :	List[Any]						=['pixel_values', 'head_mask']
                    self.assertListEqual(arg_names[:2]    ,     lowercase_				)






      def  lowerCamelCase (      self		:  List[str]				)      ->		int:
             """simple docstring"""




             _lowerCamelCase :	int						=self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_model(*lowercase_				)






      def  lowerCamelCase (      self		:  Optional[Any]				)      ->		Any:
             """simple docstring"""




             _lowerCamelCase :	str						=self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_for_video_classification(*lowercase_				)






      @slow
      def  lowerCamelCase (      self		:  Optional[int]				)      ->		Optional[Any]:
             """simple docstring"""




             for model_name in VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                    _lowerCamelCase :	Optional[int]						=VivitModel.from_pretrained(lowercase_				)
                    self.assertIsNotNone(lowercase_				)






      def  lowerCamelCase (      self		:  List[Any]				)      ->		Dict:
             """simple docstring"""




             _lowerCamelCase			,  _lowerCamelCase :	Dict						=self.model_tester.prepare_config_and_inputs_for_common()
             _lowerCamelCase :	str						=True

             for model_class in self.all_model_classes:
                    _lowerCamelCase :	List[Any]						=self.model_tester.seq_length

                    _lowerCamelCase :	Optional[Any]						=True
                    _lowerCamelCase :	str						=False
                    _lowerCamelCase :	int						=True
                    _lowerCamelCase :	int						=model_class(lowercase_				)
                    model.to(lowercase_				)
                    model.eval()
                    with torch.no_grad():
                           _lowerCamelCase :	List[Any]						=model(**self._prepare_for_class(lowercase_    ,     lowercase_				)				)
                    _lowerCamelCase :	str						=outputs.attentions
                    self.assertEqual(len(lowercase_				)    ,     self.model_tester.num_hidden_layers				)

                    # check that output_attentions also work using config
                    del inputs_dict["output_attentions"]
                    _lowerCamelCase :	List[str]						=True
                    _lowerCamelCase :	Dict						=model_class(lowercase_				)
                    model.to(lowercase_				)
                    model.eval()
                    with torch.no_grad():
                           _lowerCamelCase :	Dict						=model(**self._prepare_for_class(lowercase_    ,     lowercase_				)				)
                    _lowerCamelCase :	Any						=outputs.attentions
                    self.assertEqual(len(lowercase_				)    ,     self.model_tester.num_hidden_layers				)

                    self.assertListEqual(
                        list(attentions[0].shape[-3:]				)    ,     [self.model_tester.num_attention_heads, seq_len, seq_len]    ,     )
                    _lowerCamelCase :	int						=len(lowercase_				)

                    # Check attention is always last and order is fine
                    _lowerCamelCase :	List[str]						=True
                    _lowerCamelCase :	Dict						=True
                    _lowerCamelCase :	str						=model_class(lowercase_				)
                    model.to(lowercase_				)
                    model.eval()
                    with torch.no_grad():
                           _lowerCamelCase :	Any						=model(**self._prepare_for_class(lowercase_    ,     lowercase_				)				)

                    self.assertEqual(out_len + 1    ,     len(lowercase_				)				)

                    _lowerCamelCase :	List[Any]						=outputs.attentions

                    self.assertEqual(len(lowercase_				)    ,     self.model_tester.num_hidden_layers				)

                    self.assertListEqual(
                        list(self_attentions[0].shape[-3:]				)    ,     [self.model_tester.num_attention_heads, seq_len, seq_len]    ,     )






      def  lowerCamelCase (      self		:  Any				)      ->		Dict:
             """simple docstring"""




             def check_hidden_states_output(lowercase_		:  Any    ,     lowercase_		:  Any    ,     lowercase_		:  Tuple				):
                    _lowerCamelCase :	Optional[Any]						=model_class(lowercase_				)
                    model.to(lowercase_				)
                    model.eval()

                    with torch.no_grad():
                           _lowerCamelCase :	Tuple						=model(**self._prepare_for_class(lowercase_    ,     lowercase_				)				)

                    _lowerCamelCase :	Dict						=outputs.hidden_states
                    _lowerCamelCase :	Optional[int]						=self.model_tester.num_hidden_layers + 1
                    self.assertEqual(len(lowercase_				)    ,     lowercase_				)

                    _lowerCamelCase :	str						=self.model_tester.seq_length

                    self.assertListEqual(
                        list(hidden_states[0].shape[-2:]				)    ,     [seq_length, self.model_tester.hidden_size]    ,     )

             _lowerCamelCase			,  _lowerCamelCase :	Optional[int]						=self.model_tester.prepare_config_and_inputs_for_common()

             for model_class in self.all_model_classes:
                    _lowerCamelCase :	str						=True
                    check_hidden_states_output(lowercase_    ,     lowercase_    ,     lowercase_				)

                    # check that output_hidden_states also work using config
                    del inputs_dict["output_hidden_states"]
                    _lowerCamelCase :	Union[str, Any]						=True

                    check_hidden_states_output(lowercase_    ,     lowercase_    ,     lowercase_				)






      @unittest.skip('Will be fixed soon by reducing the size of the model used for common tests.'				)
      def  lowerCamelCase (      self		:  List[str]				)      ->		Union[str, Any]:
             """simple docstring"""




             pass




def 			a_   (					):
       '''simple docstring'''





       _lowerCamelCase :	int						=hf_hub_download(
           repo_id='hf-internal-testing/spaghetti-video'	,    filename='eating_spaghetti_32_frames.npy'	,    repo_type='dataset'  )
       _lowerCamelCase :	Any						=np.load(SCREAMING_SNAKE_CASE__  )
       return list(SCREAMING_SNAKE_CASE__  )




@require_torch
@require_vision
class A						(     unittest.TestCase  ):






      @cached_property
      def  lowerCamelCase (      self		:  Union[str, Any]				)      ->		List[str]:
             """simple docstring"""




             return VivitImageProcessor() if is_vision_available() else None






      @slow
      def  lowerCamelCase (      self		:  Dict				)      ->		int:
             """simple docstring"""




             _lowerCamelCase :	Union[str, Any]						=VivitForVideoClassification.from_pretrained('google/vivit-b-16x2-kinetics400'				).to(lowercase_				)

             _lowerCamelCase :	Union[str, Any]						=self.default_image_processor
             _lowerCamelCase :	int						=prepare_video()
             _lowerCamelCase :	Any						=image_processor(lowercase_    ,     return_tensors='pt'				).to(lowercase_				)

             # forward pass
             with torch.no_grad():
                    _lowerCamelCase :	Optional[Any]						=model(**lowercase_				)

             # verify the logits
             _lowerCamelCase :	int						=torch.Size((1, 400)				)
             self.assertEqual(outputs.logits.shape    ,     lowercase_				)

             # taken from original model
             _lowerCamelCase :	Optional[int]						=torch.tensor([-1.0543, 2.0764, -0.2104, 0.4439, -0.9658]				).to(lowercase_				)

             self.assertTrue(torch.allclose(outputs.logits[0, :5]    ,     lowercase_    ,     atol=1E-4				)				)






import argparse
import pathlib

import fairseq
import torch
from fairseq.models.roberta import RobertaModel as FairseqRobertaModel
from fairseq.modules import TransformerSentenceEncoderLayer
from packaging import version

from transformers import RobertaConfig, RobertaForMaskedLM, RobertaForSequenceClassification
from transformers.models.bert.modeling_bert import (
    BertIntermediate,
    BertLayer,
    BertOutput,
    BertSelfAttention,
    BertSelfOutput,
)
from transformers.utils import logging


if version.parse(fairseq.__version__) < version.parse('0.9.0'):
 raise Exception('requires fairseq >= 0.9.0')


logging.set_verbosity_info()
lowerCamelCase		      = logging.get_logger(__name__)

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




def 			a_   (					SCREAMING_SNAKE_CASE__      :   str	,    SCREAMING_SNAKE_CASE__      :   str	,    SCREAMING_SNAKE_CASE__      :   bool  ):
       '''simple docstring'''





       _lowerCamelCase :	Dict						=FairseqRobertaModel.from_pretrained(SCREAMING_SNAKE_CASE__  )
       roberta.eval()  # disable dropout
       _lowerCamelCase :	int						=roberta.model.encoder.sentence_encoder
       _lowerCamelCase :	Union[str, Any]						=RobertaConfig(
           vocab_size=roberta_sent_encoder.embed_tokens.num_embeddings	,    hidden_size=roberta.args.encoder_embed_dim	,    num_hidden_layers=roberta.args.encoder_layers	,    num_attention_heads=roberta.args.encoder_attention_heads	,    intermediate_size=roberta.args.encoder_ffn_embed_dim	,    max_position_embeddings=514	,    type_vocab_size=1	,    layer_norm_eps=1e-5	,    )
       if classification_head:
              _lowerCamelCase :	int						=roberta.model.classification_heads['mnli'].out_proj.weight.shape[0]
       print('Our BERT config:'	,    SCREAMING_SNAKE_CASE__  )

       _lowerCamelCase :	Optional[int]						=RobertaForSequenceClassification(SCREAMING_SNAKE_CASE__  ) if classification_head else RobertaForMaskedLM(SCREAMING_SNAKE_CASE__  )
       model.eval()

       # Now let's copy all the weights.
       # Embeddings
       _lowerCamelCase :	List[str]						=roberta_sent_encoder.embed_tokens.weight
       _lowerCamelCase :	int						=roberta_sent_encoder.embed_positions.weight
       _lowerCamelCase :	Tuple						=torch.zeros_like(
           model.roberta.embeddings.token_type_embeddings.weight  )  # just zero them out b/c RoBERTa doesn't use them.
       _lowerCamelCase :	Optional[Any]						=roberta_sent_encoder.emb_layer_norm.weight
       _lowerCamelCase :	int						=roberta_sent_encoder.emb_layer_norm.bias

       for i in range(config.num_hidden_layers  ):
              # Encoder: start of layer
              _lowerCamelCase :	BertLayer						=model.roberta.encoder.layer[i]
              _lowerCamelCase :	TransformerSentenceEncoderLayer						=roberta_sent_encoder.layers[i]

              # self attention
              _lowerCamelCase :	BertSelfAttention						=layer.attention.self
              assert (
                  roberta_layer.self_attn.k_proj.weight.data.shape
                  == roberta_layer.self_attn.q_proj.weight.data.shape
                  == roberta_layer.self_attn.v_proj.weight.data.shape
                  == torch.Size((config.hidden_size, config.hidden_size)  )
              )

              _lowerCamelCase :	Dict						=roberta_layer.self_attn.q_proj.weight
              _lowerCamelCase :	List[Any]						=roberta_layer.self_attn.q_proj.bias
              _lowerCamelCase :	Optional[Any]						=roberta_layer.self_attn.k_proj.weight
              _lowerCamelCase :	int						=roberta_layer.self_attn.k_proj.bias
              _lowerCamelCase :	Optional[Any]						=roberta_layer.self_attn.v_proj.weight
              _lowerCamelCase :	int						=roberta_layer.self_attn.v_proj.bias

              # self-attention output
              _lowerCamelCase :	BertSelfOutput						=layer.attention.output
              assert self_output.dense.weight.shape == roberta_layer.self_attn.out_proj.weight.shape
              _lowerCamelCase :	Union[str, Any]						=roberta_layer.self_attn.out_proj.weight
              _lowerCamelCase :	str						=roberta_layer.self_attn.out_proj.bias
              _lowerCamelCase :	List[Any]						=roberta_layer.self_attn_layer_norm.weight
              _lowerCamelCase :	List[Any]						=roberta_layer.self_attn_layer_norm.bias

              # intermediate
              _lowerCamelCase :	BertIntermediate						=layer.intermediate
              assert intermediate.dense.weight.shape == roberta_layer.fca.weight.shape
              _lowerCamelCase :	str						=roberta_layer.fca.weight
              _lowerCamelCase :	Optional[int]						=roberta_layer.fca.bias

              # output
              _lowerCamelCase :	BertOutput						=layer.output
              assert bert_output.dense.weight.shape == roberta_layer.fca.weight.shape
              _lowerCamelCase :	str						=roberta_layer.fca.weight
              _lowerCamelCase :	List[Any]						=roberta_layer.fca.bias
              _lowerCamelCase :	List[str]						=roberta_layer.final_layer_norm.weight
              _lowerCamelCase :	Optional[int]						=roberta_layer.final_layer_norm.bias
              # end of layer

       if classification_head:
              _lowerCamelCase :	Any						=roberta.model.classification_heads['mnli'].dense.weight
              _lowerCamelCase :	Optional[Any]						=roberta.model.classification_heads['mnli'].dense.bias
              _lowerCamelCase :	List[str]						=roberta.model.classification_heads['mnli'].out_proj.weight
              _lowerCamelCase :	Tuple						=roberta.model.classification_heads['mnli'].out_proj.bias
       else:
              # LM Head
              _lowerCamelCase :	Optional[Any]						=roberta.model.encoder.lm_head.dense.weight
              _lowerCamelCase :	Tuple						=roberta.model.encoder.lm_head.dense.bias
              _lowerCamelCase :	Tuple						=roberta.model.encoder.lm_head.layer_norm.weight
              _lowerCamelCase :	int						=roberta.model.encoder.lm_head.layer_norm.bias
              _lowerCamelCase :	Dict						=roberta.model.encoder.lm_head.weight
              _lowerCamelCase :	str						=roberta.model.encoder.lm_head.bias

       # Let's check that we get the same results.
       _lowerCamelCase :	torch.Tensor						=roberta.encode(SCREAMING_SNAKE_CASE__  ).unsqueeze(0  )  # batch of size 1

       _lowerCamelCase :	List[Any]						=model(SCREAMING_SNAKE_CASE__  )[0]
       if classification_head:
              _lowerCamelCase :	int						=roberta.model.classification_heads['mnli'](roberta.extract_features(SCREAMING_SNAKE_CASE__  )  )
       else:
              _lowerCamelCase :	int						=roberta.model(SCREAMING_SNAKE_CASE__  )[0]
       print(our_output.shape	,    their_output.shape  )
       _lowerCamelCase :	Any						=torch.max(torch.abs(our_output - their_output  )  ).item()
       print(F'''max_absolute_diff = {max_absolute_diff}'''  )  # ~ 1e-7
       _lowerCamelCase :	Optional[Any]						=torch.allclose(SCREAMING_SNAKE_CASE__	,    SCREAMING_SNAKE_CASE__	,    atol=1e-3  )
       print('Do both models output the same tensors?'	,    '🔥' if success else '💩'  )
       if not success:
              raise Exception('Something went wRoNg'  )

       pathlib.Path(SCREAMING_SNAKE_CASE__  ).mkdir(parents=SCREAMING_SNAKE_CASE__	,    exist_ok=SCREAMING_SNAKE_CASE__  )
       print(F'''Saving model to {pytorch_dump_folder_path}'''  )
       model.save_pretrained(SCREAMING_SNAKE_CASE__  )


if __name__ == "__main__":
 lowerCamelCase		      = argparse.ArgumentParser()
 # Required parameters
 parser.add_argument(
     '--roberta_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.'
 )
 parser.add_argument(
     '--classification_head', action='store_true', help='Whether to convert a final classification head.'
 )
 lowerCamelCase		      = parser.parse_args()
 convert_roberta_checkpoint_to_pytorch(
     args.roberta_checkpoint_path, args.pytorch_dump_folder_path, args.classification_head
 )


