
'''simple docstring'''






import math
import os
import unittest

from transformers import MegatronBertConfig, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, 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 (
					    MODEL_FOR_PRETRAINING_MAPPING,
					    MegatronBertForCausalLM,
					    MegatronBertForMaskedLM,
					    MegatronBertForMultipleChoice,
					    MegatronBertForNextSentencePrediction,
					    MegatronBertForPreTraining,
					    MegatronBertForQuestionAnswering,
					    MegatronBertForSequenceClassification,
					    MegatronBertForTokenClassification,
					    MegatronBertModel,
					)




class     __snake_case		:
					def __init__(     self,    A,    A=13,    A=7,    A=True,    A=True,    A=True,    A=True,    A=99,    A=64,    A=32,    A=5,    A=4,    A=37,    A="gelu",    A=0.1,    A=0.1,    A=512,    A=16,    A=2,    A=0.02,    A=3,    A=4,    A=None,    ):

									"""simple docstring"""


									lowerCamelCase					:			Tuple									= parent
									lowerCamelCase					:			int									= batch_size
									lowerCamelCase					:			List[str]									= seq_length
									lowerCamelCase					:			Dict									= is_training
									lowerCamelCase					:			Dict									= use_input_mask
									lowerCamelCase					:			List[Any]									= use_token_type_ids
									lowerCamelCase					:			List[str]									= use_labels
									lowerCamelCase					:			Any									= vocab_size
									lowerCamelCase					:			Optional[int]									= hidden_size
									lowerCamelCase					:			Union[str, Any]									= embedding_size
									lowerCamelCase					:			str									= num_hidden_layers
									lowerCamelCase					:			str									= num_attention_heads
									lowerCamelCase					:			Tuple									= intermediate_size
									lowerCamelCase					:			Optional[int]									= hidden_act
									lowerCamelCase					:			Optional[Any]									= hidden_dropout_prob
									lowerCamelCase					:			List[Any]									= attention_probs_dropout_prob
									lowerCamelCase					:			Union[str, Any]									= max_position_embeddings
									lowerCamelCase					:			Dict									= type_vocab_size
									lowerCamelCase					:			Dict									= type_sequence_label_size
									lowerCamelCase					:			List[str]									= initializer_range
									lowerCamelCase					:			Optional[int]									= num_labels
									lowerCamelCase					:			Any									= num_choices
									lowerCamelCase					:			int									= scope
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									lowerCamelCase					:			Union[str, Any]									= ids_tensor([self.batch_size, self.seq_length],    self.vocab_size      )

									lowerCamelCase					:			str									= None
									if self.use_input_mask:
													lowerCamelCase					:			Optional[Any]									= random_attention_mask([self.batch_size, self.seq_length]      )

									lowerCamelCase					:			Tuple									= None
									if self.use_token_type_ids:
													lowerCamelCase					:			str									= ids_tensor([self.batch_size, self.seq_length],    self.type_vocab_size      )

									lowerCamelCase					:			Optional[Any]									= None
									lowerCamelCase					:			int									= None
									lowerCamelCase					:			Dict									= None
									if self.use_labels:
													lowerCamelCase					:			str									= ids_tensor([self.batch_size],    self.type_sequence_label_size      )
													lowerCamelCase					:			Union[str, Any]									= ids_tensor([self.batch_size, self.seq_length],    self.num_labels      )
													lowerCamelCase					:			Dict									= ids_tensor([self.batch_size],    self.num_choices      )

									lowerCamelCase					:			Dict									= self.get_config()

									return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									return MegatronBertConfig(
									    vocab_size=self.vocab_size,    hidden_size=self.hidden_size,    num_hidden_layers=self.num_hidden_layers,    num_attention_heads=self.num_attention_heads,    intermediate_size=self.intermediate_size,    embedding_size=self.embedding_size,    hidden_act=self.hidden_act,    hidden_dropout_prob=self.hidden_dropout_prob,    attention_probs_dropout_prob=self.attention_probs_dropout_prob,    max_position_embeddings=self.max_position_embeddings,    type_vocab_size=self.type_vocab_size,    is_decoder=A,    initializer_range=self.initializer_range,    )
					def     UpperCAmelCase_							(     self,    A,    A,    A,    A,    A,    A,    A      ):

									"""simple docstring"""


									lowerCamelCase					:			List[Any]									= MegatronBertModel(config=A      )
									model.to(A      )
									model.eval()
									lowerCamelCase					:			Optional[int]									= model(A,    attention_mask=A,    token_type_ids=A      )
									lowerCamelCase					:			int									= model(A,    token_type_ids=A      )
									lowerCamelCase					:			Optional[Any]									= model(A      )

									self.parent.assertEqual(result.last_hidden_state.shape,    (self.batch_size, self.seq_length, self.hidden_size)      )
									self.parent.assertEqual(result.pooler_output.shape,    (self.batch_size, self.hidden_size)      )
					def     UpperCAmelCase_							(     self,    A,    A,    A,    A,    A,    A,    A      ):

									"""simple docstring"""


									lowerCamelCase					:			str									= MegatronBertForMaskedLM(config=A      )
									model.to(A      )
									model.eval()
									lowerCamelCase					:			Tuple									= model(A,    attention_mask=A,    token_type_ids=A,    labels=A      )
									self.parent.assertEqual(result.logits.shape,    (self.batch_size, self.seq_length, self.vocab_size)      )
					def     UpperCAmelCase_							(     self,    A,    A,    A,    A,    A,    A,    A      ):

									"""simple docstring"""


									lowerCamelCase					:			str									= MegatronBertForCausalLM(config=A      )
									model.to(A      )
									model.eval()
									lowerCamelCase					:			Optional[Any]									= model(A,    attention_mask=A,    token_type_ids=A,    labels=A      )
									self.parent.assertEqual(result.logits.shape,    (self.batch_size, self.seq_length, self.vocab_size)      )
					def     UpperCAmelCase_							(     self,    A,    A,    A,    A,    A,    A,    A      ):

									"""simple docstring"""


									lowerCamelCase					:			Optional[int]									= MegatronBertForNextSentencePrediction(config=A      )
									model.to(A      )
									model.eval()
									lowerCamelCase					:			List[Any]									= model(
									    A,    attention_mask=A,    token_type_ids=A,    labels=A,    )
									self.parent.assertEqual(result.logits.shape,    (self.batch_size, 2)      )
					def     UpperCAmelCase_							(     self,    A,    A,    A,    A,    A,    A,    A      ):

									"""simple docstring"""


									lowerCamelCase					:			str									= MegatronBertForPreTraining(config=A      )
									model.to(A      )
									model.eval()
									lowerCamelCase					:			List[str]									= model(
									    A,    attention_mask=A,    token_type_ids=A,    labels=A,    next_sentence_label=A,    )
									self.parent.assertEqual(result.prediction_logits.shape,    (self.batch_size, self.seq_length, self.vocab_size)      )
									self.parent.assertEqual(result.seq_relationship_logits.shape,    (self.batch_size, 2)      )
					def     UpperCAmelCase_							(     self,    A,    A,    A,    A,    A,    A,    A      ):

									"""simple docstring"""


									lowerCamelCase					:			Optional[int]									= MegatronBertForQuestionAnswering(config=A      )
									model.to(A      )
									model.eval()
									lowerCamelCase					:			str									= model(
									    A,    attention_mask=A,    token_type_ids=A,    start_positions=A,    end_positions=A,    )
									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,    A,    A,    A,    A,    A,    A,    A      ):

									"""simple docstring"""


									lowerCamelCase					:			Dict									= self.num_labels
									lowerCamelCase					:			List[str]									= MegatronBertForSequenceClassification(A      )
									model.to(A      )
									model.eval()
									lowerCamelCase					:			Tuple									= model(A,    attention_mask=A,    token_type_ids=A,    labels=A      )
									self.parent.assertEqual(result.logits.shape,    (self.batch_size, self.num_labels)      )
					def     UpperCAmelCase_							(     self,    A,    A,    A,    A,    A,    A,    A      ):

									"""simple docstring"""


									lowerCamelCase					:			Union[str, Any]									= self.num_labels
									lowerCamelCase					:			str									= MegatronBertForTokenClassification(config=A      )
									model.to(A      )
									model.eval()
									lowerCamelCase					:			int									= model(A,    attention_mask=A,    token_type_ids=A,    labels=A      )
									self.parent.assertEqual(result.logits.shape,    (self.batch_size, self.seq_length, self.num_labels)      )
					def     UpperCAmelCase_							(     self,    A,    A,    A,    A,    A,    A,    A      ):

									"""simple docstring"""


									lowerCamelCase					:			List[str]									= self.num_choices
									lowerCamelCase					:			List[Any]									= MegatronBertForMultipleChoice(config=A      )
									model.to(A      )
									model.eval()
									lowerCamelCase					:			Any									= input_ids.unsqueeze(1      ).expand(-1,    self.num_choices,    -1      ).contiguous()
									lowerCamelCase					:			Optional[int]									= token_type_ids.unsqueeze(1      ).expand(-1,    self.num_choices,    -1      ).contiguous()
									lowerCamelCase					:			List[Any]									= input_mask.unsqueeze(1      ).expand(-1,    self.num_choices,    -1      ).contiguous()
									lowerCamelCase					:			List[str]									= model(
									    A,    attention_mask=A,    token_type_ids=A,    labels=A,    )
									self.parent.assertEqual(result.logits.shape,    (self.batch_size, self.num_choices)      )




					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									lowerCamelCase					:			Tuple									= self.prepare_config_and_inputs()
									(
									    (
									    lowerCamelCase
									)			, (
									    lowerCamelCase
									)			, (
									    lowerCamelCase
									)			, (
									    lowerCamelCase
									)			, (
									    lowerCamelCase
									)			, (
									    lowerCamelCase
									)			, (
									    lowerCamelCase
									)			, 
									)					:			List[str]									= config_and_inputs
									lowerCamelCase					:			Tuple									= {'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': input_mask}
									return config, inputs_dict





@require_torch
class     __snake_case		(   a__    ,   a__    ,   unittest.TestCase):
					_lowerCAmelCase			     =	(
					    (
					        MegatronBertModel,
					        MegatronBertForMaskedLM,
					        MegatronBertForCausalLM,
					        MegatronBertForMultipleChoice,
					        MegatronBertForNextSentencePrediction,
					        MegatronBertForPreTraining,
					        MegatronBertForQuestionAnswering,
					        MegatronBertForSequenceClassification,
					        MegatronBertForTokenClassification,
					    )
					    if is_torch_available()
					    else ()
					)
					_lowerCAmelCase			     =	(
					    {
					        '''feature-extraction''': MegatronBertModel,
					        '''fill-mask''': MegatronBertForMaskedLM,
					        '''question-answering''': MegatronBertForQuestionAnswering,
					        '''text-classification''': MegatronBertForSequenceClassification,
					        '''text-generation''': MegatronBertForCausalLM,
					        '''token-classification''': MegatronBertForTokenClassification,
					        '''zero-shot''': MegatronBertForSequenceClassification,
					    }
					    if is_torch_available()
					    else {}
					)
					_lowerCAmelCase			     =	True
					# test_resize_embeddings = False
					_lowerCAmelCase			     =	False
					def     UpperCAmelCase_							(     self,    A,    A,    A=False      ):

									"""simple docstring"""


									lowerCamelCase					:			Dict									= super()._prepare_for_class(A,    A,    return_labels=A      )

									if return_labels:
													if model_class in get_values(A      ):
																	lowerCamelCase					:			Optional[Any]									= torch.zeros(
																	    (self.model_tester.batch_size, self.model_tester.seq_length),    dtype=torch.long,    device=A      )
																	lowerCamelCase					:			Any									= torch.zeros(
																	    self.model_tester.batch_size,    dtype=torch.long,    device=A      )
									return inputs_dict
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									lowerCamelCase					:			Dict									= MegatronBertModelTester(self      )
									lowerCamelCase					:			Tuple									= ConfigTester(self,    config_class=A,    hidden_size=37      )
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									self.config_tester.run_common_tests()
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									lowerCamelCase					:			Dict									= self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_megatron_bert_model(*A      )
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									lowerCamelCase					:			Optional[Any]									= self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_megatron_bert_for_masked_lm(*A      )
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									lowerCamelCase					:			Union[str, Any]									= self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_megatron_bert_for_multiple_choice(*A      )
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									lowerCamelCase					:			Optional[int]									= self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_megatron_bert_for_next_sequence_prediction(*A      )
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									lowerCamelCase					:			Dict									= self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_megatron_bert_for_pretraining(*A      )
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									lowerCamelCase					:			Any									= self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_megatron_bert_for_question_answering(*A      )
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									lowerCamelCase					:			str									= self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_megatron_bert_for_sequence_classification(*A      )




					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									lowerCamelCase					:			List[str]									= self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_megatron_bert_for_token_classification(*A      )





def    UpperCAmelCase							(  UpperCAmelCase__							:							str):
				return torch.tensor(
				    UpperCAmelCase__       ,							dtype=torch.long       ,							device=UpperCAmelCase__       ,							)


A			      =      1E-4




@require_torch
@require_sentencepiece
@require_tokenizers
class     __snake_case		(   unittest.TestCase):
					@slow
					@unittest.skip('Model is not available.'      )
					def     UpperCAmelCase_							(     self      ):

									"""simple docstring"""


									lowerCamelCase					:			Any									= 'nvidia/megatron-bert-uncased-345m'
									if "MYDIR" in os.environ:
													lowerCamelCase					:			Union[str, Any]									= os.path.join(os.environ['MYDIR'],    A      )
									lowerCamelCase					:			Any									= MegatronBertModel.from_pretrained(A      )
									model.to(A      )
									model.half()
									lowerCamelCase					:			Optional[int]									= _long_tensor([[101, 7110, 1005, 1056, 2023, 1_1333, 1_7413, 1029, 102]]      )
									with torch.no_grad():
													lowerCamelCase					:			Optional[Any]									= model(A      )[0]
									lowerCamelCase					:			Optional[Any]									= torch.Size((1, 9, 1024)      )
									self.assertEqual(output.shape,    A      )

									lowerCamelCase					:			Any									= [-0.6040, -0.2517, -0.1025, 0.3420, -0.6758, -0.0017, -0.1089, -0.1990, 0.5728]
									for ii in range(3      ):
													for jj in range(3      ):
																	lowerCamelCase					:			List[str]									= output[0, ii, jj]
																	lowerCamelCase					:			int									= expected[3 * ii + jj]
																	lowerCamelCase					:			List[Any]									= 'ii={} jj={} a={} b={}'.format(A,    A,    A,    A      )
																	self.assertTrue(math.isclose(A,    A,    rel_tol=A,    abs_tol=A      ),    msg=A      )


'''simple docstring'''






import argparse
import gc
import json
import os
import re

import torch
from huggingface_hub import hf_hub_download

from transformers import AutoModelForCausalLM, AutoTokenizer, PreTrainedTokenizerFast, RwkvConfig
from transformers.modeling_utils import WEIGHTS_INDEX_NAME, shard_checkpoint


A			      =      {
    '169M': 12,
    '430M': 24,
    '1B5': 24,
    '3B': 32,
    '7B': 32,
    '14B': 40,
}

A			      =      {
    '169M': 768,
    '430M': 1024,
    '1B5': 2048,
    '3B': 2560,
    '7B': 4096,
    '14B': 5120,
}





def    UpperCAmelCase							(  UpperCAmelCase__							:							Any):
				lowerCamelCase					:			Any									= list(state_dict.keys())
				for name in state_dict_keys:
								lowerCamelCase					:			List[str]									= state_dict.pop(UpperCAmelCase__)
								# emb -> embedding
								if name.startswith('emb.'):
												lowerCamelCase					:			Dict									= name.replace('emb.'       ,							'embeddings.')
								# ln_0 -> pre_ln (only present at block 0)
								if name.startswith('blocks.0.ln0'):
												lowerCamelCase					:			str									= name.replace('blocks.0.ln0'       ,							'blocks.0.pre_ln')
								# att -> attention
								lowerCamelCase					:			str									= re.sub(R'blocks\.(\d+)\.att'       ,							R'blocks.\1.attention'       ,							UpperCAmelCase__)
								# ffn -> feed_forward
								lowerCamelCase					:			List[Any]									= re.sub(R'blocks\.(\d+)\.ffn'       ,							R'blocks.\1.feed_forward'       ,							UpperCAmelCase__)
								# time_mix_k -> time_mix_key and reshape
								if name.endswith('.time_mix_k'):
												lowerCamelCase					:			Any									= name.replace('.time_mix_k'       ,							'.time_mix_key')
								# time_mix_v -> time_mix_value and reshape
								if name.endswith('.time_mix_v'):
												lowerCamelCase					:			str									= name.replace('.time_mix_v'       ,							'.time_mix_value')
								# time_mix_r -> time_mix_key and reshape
								if name.endswith('.time_mix_r'):
												lowerCamelCase					:			List[Any]									= name.replace('.time_mix_r'       ,							'.time_mix_receptance')

								if name != "head.weight":
												lowerCamelCase					:			Any									= 'rwkv.' + name

								lowerCamelCase					:			Any									= weight
				return state_dict





def    UpperCAmelCase							(  UpperCAmelCase__							:							str       ,							UpperCAmelCase__							:							List[str]       ,							UpperCAmelCase__							:							Optional[int]       ,							UpperCAmelCase__							:							Optional[Any]=None       ,							UpperCAmelCase__							:							Tuple=None       ,							UpperCAmelCase__							:							List[Any]=False       ,							UpperCAmelCase__							:							Dict=None):
				# 1. If possible, build the tokenizer.
				if tokenizer_file is None:
								print('No `--tokenizer_file` provided, we will use the default tokenizer.')
								lowerCamelCase					:			Dict									= 5_02_77
								lowerCamelCase					:			Union[str, Any]									= AutoTokenizer.from_pretrained('EleutherAI/gpt-neox-20b')
				else:
								lowerCamelCase					:			int									= PreTrainedTokenizerFast(tokenizer_file=UpperCAmelCase__)
								lowerCamelCase					:			List[Any]									= len(UpperCAmelCase__)
				tokenizer.save_pretrained(UpperCAmelCase__)

				# 2. Build the config
				lowerCamelCase					:			Tuple									= list(NUM_HIDDEN_LAYERS_MAPPING.keys())
				if size is None:
								# Try to infer size from the checkpoint name
								for candidate in possible_sizes:
												if candidate in checkpoint_file:
																lowerCamelCase					:			Union[str, Any]									= candidate
																break
								if size is None:
												raise ValueError('Could not infer the size, please provide it with the `--size` argument.')
				if size not in possible_sizes:
								raise ValueError(F'''`size` should be one of {possible_sizes}, got {size}.''')

				lowerCamelCase					:			List[Any]									= RwkvConfig(
				    vocab_size=UpperCAmelCase__       ,							num_hidden_layers=NUM_HIDDEN_LAYERS_MAPPING[size]       ,							hidden_size=HIDEN_SIZE_MAPPING[size]       ,							)
				config.save_pretrained(UpperCAmelCase__)

				# 3. Download model file then convert state_dict
				lowerCamelCase					:			Tuple									= hf_hub_download(UpperCAmelCase__       ,							UpperCAmelCase__)
				lowerCamelCase					:			Any									= torch.load(UpperCAmelCase__       ,							map_location='cpu')
				lowerCamelCase					:			str									= convert_state_dict(UpperCAmelCase__)

				# 4. Split in shards and save
				lowerCamelCase			, lowerCamelCase					:			Optional[int]									= shard_checkpoint(UpperCAmelCase__)
				for shard_file, shard in shards.items():
								torch.save(UpperCAmelCase__       ,							os.path.join(UpperCAmelCase__       ,							UpperCAmelCase__))

				if index is not None:
								lowerCamelCase					:			Dict									= os.path.join(UpperCAmelCase__       ,							UpperCAmelCase__)
								# Save the index as well
								with open(UpperCAmelCase__       ,							'w'       ,							encoding='utf-8') as f:
												lowerCamelCase					:			int									= json.dumps(UpperCAmelCase__       ,							indent=2       ,							sort_keys=UpperCAmelCase__) + '\n'
												f.write(UpperCAmelCase__)

								# 5. Clean up shards (for some reason the file PyTorch saves take the same space as the whole state_dict
								print(
								    'Cleaning up shards. This may error with an OOM error, it this is the case don\'t worry you still have converted the model.')
								lowerCamelCase					:			List[str]									= list(shards.keys())

								del state_dict
								del shards
								gc.collect()

								for shard_file in shard_files:
												lowerCamelCase					:			Dict									= torch.load(os.path.join(UpperCAmelCase__       ,							UpperCAmelCase__))
												torch.save({k: v.cpu().clone() for k, v in state_dict.items()}       ,							os.path.join(UpperCAmelCase__       ,							UpperCAmelCase__))

				del state_dict
				gc.collect()

				if push_to_hub:
								if model_name is None:
												raise ValueError('Please provide a `model_name` to push the model to the Hub.')
								lowerCamelCase					:			List[Any]									= AutoModelForCausalLM.from_pretrained(UpperCAmelCase__)
								model.push_to_hub(UpperCAmelCase__       ,							max_shard_size='2GB')
								tokenizer.push_to_hub(UpperCAmelCase__)


if __name__ == "__main__":
					A			      =      argparse.ArgumentParser()
					# Required parameters
					parser.add_argument(
					    '--repo_id', default=None, type=str, required=True, help='Repo ID from which to pull the checkpoint.'
					)
					parser.add_argument(
					    '--checkpoint_file', default=None, type=str, required=True, help='Name of the checkpoint file in the repo.'
					)
					parser.add_argument(
					    '--output_dir', default=None, type=str, required=True, help='Where to save the converted model.'
					)
					parser.add_argument(
					    '--tokenizer_file',
					    default=None,
					    type=str,
					    help='Path to the tokenizer file to use (if not provided, only the model is converted).',
					)
					parser.add_argument(
					    '--size',
					    default=None,
					    type=str,
					    help='Size of the model. Will be inferred from the `checkpoint_file` if not passed.',
					)
					parser.add_argument(
					    '--push_to_hub',
					    action='store_true',
					    help='Push to the Hub the converted model.',
					)
					parser.add_argument(
					    '--model_name',
					    default=None,
					    type=str,
					    help='Name of the pushed model on the Hub, including the username / organization.',
					)

					A			      =      parser.parse_args()
					convert_rmkv_checkpoint_to_hf_format(
					    args.repo_id,
					    args.checkpoint_file,
					    args.output_dir,
					    size=args.size,
					    tokenizer_file=args.tokenizer_file,
					    push_to_hub=args.push_to_hub,
					    model_name=args.model_name,
					)
