



"""simple docstring"""
import json
import os
import unittest

from transformers import AutoTokenizer, GPTaTokenizer, GPTaTokenizerFast
from transformers.models.gpta.tokenization_gpta import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers

from ...test_tokenization_common import TokenizerTesterMixin


@require_tokenizers
class 							lowerCamelCase_(   A__,				unittest.TestCase    ):





					'''simple docstring'''



					lowercase__   :       Optional[int]										= GPTaTokenizer
					lowercase__   :       Optional[int]										= GPTaTokenizerFast
					lowercase__   :       List[str]										= True
					lowercase__   :       List[Any]										= {'add_prefix_space': True}
					lowercase__   :       str										= False

					def 			snake_case__      (    self   ):
									super().setUp()

									# Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
									_lowerCamelCase        =				[
									    '''l''',
									    '''o''',
									    '''w''',
									    '''e''',
									    '''r''',
									    '''s''',
									    '''t''',
									    '''i''',
									    '''d''',
									    '''n''',
									    '''\u0120''',
									    '''\u0120l''',
									    '''\u0120n''',
									    '''\u0120lo''',
									    '''\u0120low''',
									    '''er''',
									    '''\u0120lowest''',
									    '''\u0120newer''',
									    '''\u0120wider''',
									    '''<unk>''',
									    '''<|endoftext|>''',
									]
									_lowerCamelCase        =				dict(zip(lowerCamelCase__				,       range(len(lowerCamelCase__   )   )   )   )
									_lowerCamelCase        =				['''#version: 0.2''', '''\u0120 l''', '''\u0120l o''', '''\u0120lo w''', '''e r''', '''''']
									_lowerCamelCase        =				{'''unk_token''': '''<unk>'''}

									_lowerCamelCase        =				os.path.join(self.tmpdirname				,       VOCAB_FILES_NAMES['''vocab_file''']   )
									_lowerCamelCase        =				os.path.join(self.tmpdirname				,       VOCAB_FILES_NAMES['''merges_file''']   )
									with open(self.vocab_file				,       '''w'''				,       encoding='''utf-8'''   ) as fp:
													fp.write(json.dumps(lowerCamelCase__   ) + '''\n'''   )
									with open(self.merges_file				,       '''w'''				,       encoding='''utf-8'''   ) as fp:
													fp.write('''\n'''.join(lowerCamelCase__   )   )

					def 			snake_case__      (    self				,       **lowerCamelCase__   ):
									kwargs.update(self.special_tokens_map   )
									return GPTaTokenizer.from_pretrained(self.tmpdirname				,       **lowerCamelCase__   )

					def 			snake_case__      (    self				,       **lowerCamelCase__   ):
									kwargs.update(self.special_tokens_map   )
									return GPTaTokenizerFast.from_pretrained(self.tmpdirname				,       **lowerCamelCase__   )

					def 			snake_case__      (    self				,       lowerCamelCase__   ):
									_lowerCamelCase        =				'''lower newer'''
									_lowerCamelCase        =				'''lower newer'''
									return input_text, output_text

					def 			snake_case__      (    self   ):
									_lowerCamelCase        =				GPTaTokenizer(self.vocab_file				,       self.merges_file				,       **self.special_tokens_map   )
									_lowerCamelCase        =				'''lower newer'''
									_lowerCamelCase        =				['''\u0120low''', '''er''', '''\u0120''', '''n''', '''e''', '''w''', '''er''']
									_lowerCamelCase        =				tokenizer.tokenize(lowerCamelCase__				,       add_prefix_space=lowerCamelCase__   )
									self.assertListEqual(lowerCamelCase__				,       lowerCamelCase__   )

									_lowerCamelCase        =				tokens + [tokenizer.unk_token]
									_lowerCamelCase        =				[1_4, 1_5, 1_0, 9, 3, 2, 1_5, 1_9]
									self.assertListEqual(tokenizer.convert_tokens_to_ids(lowerCamelCase__   )				,       lowerCamelCase__   )

					def 			snake_case__      (    self   ):
									if not self.test_rust_tokenizer:
													return

									_lowerCamelCase        =				self.get_tokenizer()
									_lowerCamelCase        =				self.get_rust_tokenizer(add_prefix_space=lowerCamelCase__   )

									_lowerCamelCase        =				'''lower newer'''

									# Testing tokenization
									_lowerCamelCase        =				tokenizer.tokenize(lowerCamelCase__				,       add_prefix_space=lowerCamelCase__   )
									_lowerCamelCase        =				rust_tokenizer.tokenize(lowerCamelCase__   )
									self.assertListEqual(lowerCamelCase__				,       lowerCamelCase__   )

									# Testing conversion to ids without special tokens
									_lowerCamelCase        =				tokenizer.encode(lowerCamelCase__				,       add_special_tokens=lowerCamelCase__				,       add_prefix_space=lowerCamelCase__   )
									_lowerCamelCase        =				rust_tokenizer.encode(lowerCamelCase__				,       add_special_tokens=lowerCamelCase__   )
									self.assertListEqual(lowerCamelCase__				,       lowerCamelCase__   )

									# Testing conversion to ids with special tokens
									_lowerCamelCase        =				self.get_rust_tokenizer(add_prefix_space=lowerCamelCase__   )
									_lowerCamelCase        =				tokenizer.encode(lowerCamelCase__				,       add_prefix_space=lowerCamelCase__   )
									_lowerCamelCase        =				rust_tokenizer.encode(lowerCamelCase__   )
									self.assertListEqual(lowerCamelCase__				,       lowerCamelCase__   )

									# Testing the unknown token
									_lowerCamelCase        =				tokens + [rust_tokenizer.unk_token]
									_lowerCamelCase        =				[1_4, 1_5, 1_0, 9, 3, 2, 1_5, 1_9]
									self.assertListEqual(rust_tokenizer.convert_tokens_to_ids(lowerCamelCase__   )				,       lowerCamelCase__   )

					def 			snake_case__      (    self				,       *lowerCamelCase__				,       **lowerCamelCase__   ):
									# It's very difficult to mix/test pretokenization with byte-level
									# And get both GPT2 and Roberta to work at the same time (mostly an issue of adding a space before the string)
									pass

					def 			snake_case__      (    self				,       lowerCamelCase__=1_5   ):
									for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
													with self.subTest(F"""{tokenizer.__class__.__name__} ({pretrained_name})"""   ):
																	_lowerCamelCase        =				self.rust_tokenizer_class.from_pretrained(lowerCamelCase__				,       **lowerCamelCase__   )

																	# Simple input
																	_lowerCamelCase        =				'''This is a simple input'''
																	_lowerCamelCase        =				['''This is a simple input 1''', '''This is a simple input 2''']
																	_lowerCamelCase        =				('''This is a simple input''', '''This is a pair''')
																	_lowerCamelCase        =				[
																	    ('''This is a simple input 1''', '''This is a simple input 2'''),
																	    ('''This is a simple pair 1''', '''This is a simple pair 2'''),
																	]

																	# Simple input tests
																	self.assertRaises(lowerCamelCase__				,       tokenizer_r.encode				,       lowerCamelCase__				,       max_length=lowerCamelCase__				,       padding='''max_length'''   )

																	# Simple input
																	self.assertRaises(lowerCamelCase__				,       tokenizer_r.encode_plus				,       lowerCamelCase__				,       max_length=lowerCamelCase__				,       padding='''max_length'''   )

																	# Simple input
																	self.assertRaises(
																	    lowerCamelCase__				,       tokenizer_r.batch_encode_plus				,       lowerCamelCase__				,       max_length=lowerCamelCase__				,       padding='''max_length'''				,       )

																	# Pair input
																	self.assertRaises(lowerCamelCase__				,       tokenizer_r.encode				,       lowerCamelCase__				,       max_length=lowerCamelCase__				,       padding='''max_length'''   )

																	# Pair input
																	self.assertRaises(lowerCamelCase__				,       tokenizer_r.encode_plus				,       lowerCamelCase__				,       max_length=lowerCamelCase__				,       padding='''max_length'''   )

																	# Pair input
																	self.assertRaises(
																	    lowerCamelCase__				,       tokenizer_r.batch_encode_plus				,       lowerCamelCase__				,       max_length=lowerCamelCase__				,       padding='''max_length'''				,       )

					def 			snake_case__      (    self   ):
									_lowerCamelCase        =				GPTaTokenizer.from_pretrained(self.tmpdirname				,       pad_token='''<pad>'''   )

									# Simple input
									_lowerCamelCase        =				'''This is a simple input'''
									_lowerCamelCase        =				['''This is a simple input looooooooong''', '''This is a simple input''']
									_lowerCamelCase        =				('''This is a simple input''', '''This is a pair''')
									_lowerCamelCase        =				[
									    ('''This is a simple input loooooong''', '''This is a simple input'''),
									    ('''This is a simple pair loooooong''', '''This is a simple pair'''),
									]

									_lowerCamelCase        =				tokenizer.pad_token_id

									_lowerCamelCase        =				tokenizer(lowerCamelCase__				,       padding='''max_length'''				,       max_length=3_0				,       return_tensors='''np'''   )
									_lowerCamelCase        =				tokenizer(lowerCamelCase__				,       padding=lowerCamelCase__				,       truncate=lowerCamelCase__				,       return_tensors='''np'''   )
									_lowerCamelCase        =				tokenizer(*lowerCamelCase__				,       padding='''max_length'''				,       max_length=6_0				,       return_tensors='''np'''   )
									_lowerCamelCase        =				tokenizer(lowerCamelCase__				,       padding=lowerCamelCase__				,       truncate=lowerCamelCase__				,       return_tensors='''np'''   )

									# s
									# test single string max_length padding
									self.assertEqual(out_s['''input_ids'''].shape[-1]				,       3_0   )
									self.assertTrue(pad_token_id in out_s['''input_ids''']   )
									self.assertTrue(0 in out_s['''attention_mask''']   )

									# s2
									# test automatic padding
									self.assertEqual(out_sa['''input_ids'''].shape[-1]				,       3_3   )
									# long slice doesn't have padding
									self.assertFalse(pad_token_id in out_sa['''input_ids'''][0]   )
									self.assertFalse(0 in out_sa['''attention_mask'''][0]   )
									# short slice does have padding
									self.assertTrue(pad_token_id in out_sa['''input_ids'''][1]   )
									self.assertTrue(0 in out_sa['''attention_mask'''][1]   )

									# p
									# test single pair max_length padding
									self.assertEqual(out_p['''input_ids'''].shape[-1]				,       6_0   )
									self.assertTrue(pad_token_id in out_p['''input_ids''']   )
									self.assertTrue(0 in out_p['''attention_mask''']   )

									# p2
									# test automatic padding pair
									self.assertEqual(out_pa['''input_ids'''].shape[-1]				,       5_2   )
									# long slice pair doesn't have padding
									self.assertFalse(pad_token_id in out_pa['''input_ids'''][0]   )
									self.assertFalse(0 in out_pa['''attention_mask'''][0]   )
									# short slice pair does have padding
									self.assertTrue(pad_token_id in out_pa['''input_ids'''][1]   )
									self.assertTrue(0 in out_pa['''attention_mask'''][1]   )

					def 			snake_case__      (    self   ):
									_lowerCamelCase        =				'''$$$'''
									_lowerCamelCase        =				GPTaTokenizer.from_pretrained(self.tmpdirname				,       bos_token=lowerCamelCase__				,       add_bos_token=lowerCamelCase__   )

									_lowerCamelCase        =				'''This is a simple input'''
									_lowerCamelCase        =				['''This is a simple input 1''', '''This is a simple input 2''']

									_lowerCamelCase        =				tokenizer.bos_token_id

									_lowerCamelCase        =				tokenizer(lowerCamelCase__   )
									_lowerCamelCase        =				tokenizer(lowerCamelCase__   )

									self.assertEqual(out_s.input_ids[0]				,       lowerCamelCase__   )
									self.assertTrue(all(o[0] == bos_token_id for o in out_sa.input_ids   )   )

									_lowerCamelCase        =				tokenizer.decode(out_s.input_ids   )
									_lowerCamelCase        =				tokenizer.batch_decode(out_sa.input_ids   )

									self.assertEqual(decode_s.split()[0]				,       lowerCamelCase__   )
									self.assertTrue(all(d.split()[0] == bos_token for d in decode_sa   )   )

					def 			snake_case__      (    self   ):
									pass





					def 			snake_case__      (    self   ):
									# TODO: change to self.get_tokenizers() when the fast version is implemented
									_lowerCamelCase        =				[self.get_tokenizer(do_lower_case=lowerCamelCase__				,       add_bos_token=lowerCamelCase__   )]
									for tokenizer in tokenizers:
													with self.subTest(F"""{tokenizer.__class__.__name__}"""   ):
																	_lowerCamelCase        =				'''Encode this.'''
																	_lowerCamelCase        =				'''This one too please.'''
																	_lowerCamelCase        =				tokenizer.encode(lowerCamelCase__				,       add_special_tokens=lowerCamelCase__   )
																	encoded_sequence += tokenizer.encode(lowerCamelCase__				,       add_special_tokens=lowerCamelCase__   )
																	_lowerCamelCase        =				tokenizer.encode_plus(
																	    lowerCamelCase__				,       lowerCamelCase__				,       add_special_tokens=lowerCamelCase__				,       return_special_tokens_mask=lowerCamelCase__				,       )
																	_lowerCamelCase        =				encoded_sequence_dict['''input_ids''']
																	_lowerCamelCase        =				encoded_sequence_dict['''special_tokens_mask''']
																	self.assertEqual(len(lowerCamelCase__   )				,       len(lowerCamelCase__   )   )

																	_lowerCamelCase        =				[
																	    (x if not special_tokens_mask[i] else None) for i, x in enumerate(lowerCamelCase__   )
																	]
																	_lowerCamelCase        =				[x for x in filtered_sequence if x is not None]
																	self.assertEqual(lowerCamelCase__				,       lowerCamelCase__   )


@require_tokenizers
class 							lowerCamelCase_(   unittest.TestCase    ):





					'''simple docstring'''



					def 			snake_case__      (    self   ):
									# More context:
									# https://huggingface.co/wjmcat/opt-350m-paddle/discussions/1
									# https://huggingface.slack.com/archives/C01N44FJDHT/p1653511495183519
									# https://github.com/huggingface/transformers/pull/17088#discussion_r871246439

									_lowerCamelCase        =				AutoTokenizer.from_pretrained('''facebook/opt-350m'''				,       from_slow=lowerCamelCase__   )
									_lowerCamelCase        =				'''A photo of a cat'''

									_lowerCamelCase        =				tokenizer.encode(
									    lowerCamelCase__				,       )
									self.assertEqual(lowerCamelCase__				,       [2, 2_5_0, 1_3_4_5, 9, 1_0, 4_7_5_8]   )
									tokenizer.save_pretrained('''test_opt'''   )

									_lowerCamelCase        =				AutoTokenizer.from_pretrained('''./test_opt'''   )
									_lowerCamelCase        =				tokenizer.encode(
									    lowerCamelCase__				,       )
									self.assertEqual(lowerCamelCase__				,       [2, 2_5_0, 1_3_4_5, 9, 1_0, 4_7_5_8]   )

					def 			snake_case__      (    self   ):
									_lowerCamelCase        =				AutoTokenizer.from_pretrained('''facebook/opt-350m'''				,       use_slow=lowerCamelCase__   )
									_lowerCamelCase        =				'''A photo of a cat'''

									_lowerCamelCase        =				tokenizer.encode(
									    lowerCamelCase__				,       )
									# Same as above
									self.assertEqual(lowerCamelCase__				,       [2, 2_5_0, 1_3_4_5, 9, 1_0, 4_7_5_8]   )





					@unittest.skip('''This test is failing because of a bug in the fast tokenizer'''   )
					def 			snake_case__      (    self   ):
									_lowerCamelCase        =				AutoTokenizer.from_pretrained('''facebook/opt-350m'''				,       from_slow=lowerCamelCase__   )

									_lowerCamelCase        =				'''bos'''
									_lowerCamelCase        =				tokenizer.get_vocab()['''bos''']

									_lowerCamelCase        =				'''A photo of a cat'''
									_lowerCamelCase        =				tokenizer.encode(
									    lowerCamelCase__				,       )
									# We changed the bos token
									self.assertEqual(lowerCamelCase__				,       [3_1_9_5_7, 2_5_0, 1_3_4_5, 9, 1_0, 4_7_5_8]   )
									tokenizer.save_pretrained('''./tok'''   )
									_lowerCamelCase        =				AutoTokenizer.from_pretrained('''./tok'''   )
									self.assertTrue(tokenizer.is_fast   )
									_lowerCamelCase        =				tokenizer.encode(
									    lowerCamelCase__				,       )
									self.assertEqual(lowerCamelCase__				,       [3_1_9_5_7, 2_5_0, 1_3_4_5, 9, 1_0, 4_7_5_8]   )





"""simple docstring"""
import argparse
import json
import os

import torch

from transformers import LukeConfig, LukeModel, LukeTokenizer, RobertaTokenizer
from transformers.tokenization_utils_base import AddedToken



@torch.no_grad()
def        lowerCAmelCase_(   lowercase_     :							int						,   lowercase_     :							List[Any]						,   lowercase_     :							List[Any]						,   lowercase_     :							Tuple						,   lowercase_     :							List[str]							)	->       Dict:
				# Load configuration defined in the metadata file
				with open(lowercase_							) as metadata_file:
								_lowerCamelCase        =				json.load(lowercase_							)
				_lowerCamelCase        =				LukeConfig(use_entity_aware_attention=lowercase_						,   **metadata['''model_config''']							)

				# Load in the weights from the checkpoint_path
				_lowerCamelCase        =				torch.load(lowercase_						,   map_location='''cpu'''							)

				# Load the entity vocab file
				_lowerCamelCase        =				load_entity_vocab(lowercase_							)

				_lowerCamelCase        =				RobertaTokenizer.from_pretrained(metadata['''model_config''']['''bert_model_name''']							)

				# Add special tokens to the token vocabulary for downstream tasks
				_lowerCamelCase        =				AddedToken('''<ent>'''						,   lstrip=lowercase_						,   rstrip=lowercase_							)
				_lowerCamelCase        =				AddedToken('''<ent2>'''						,   lstrip=lowercase_						,   rstrip=lowercase_							)
				tokenizer.add_special_tokens({'''additional_special_tokens''': [entity_token_a, entity_token_a]}							)
				config.vocab_size += 2

				print(F"""Saving tokenizer to {pytorch_dump_folder_path}"""							)
				tokenizer.save_pretrained(lowercase_							)
				with open(os.path.join(lowercase_						,   LukeTokenizer.vocab_files_names['''entity_vocab_file''']							)						,   '''w'''							) as f:
								json.dump(lowercase_						,   lowercase_							)

				_lowerCamelCase        =				LukeTokenizer.from_pretrained(lowercase_							)

				# Initialize the embeddings of the special tokens
				_lowerCamelCase        =				state_dict['''embeddings.word_embeddings.weight''']
				_lowerCamelCase        =				word_emb[tokenizer.convert_tokens_to_ids(['''@''']							)[0]].unsqueeze(0							)
				_lowerCamelCase        =				word_emb[tokenizer.convert_tokens_to_ids(['''#''']							)[0]].unsqueeze(0							)
				_lowerCamelCase        =				torch.cat([word_emb, ent_emb, enta_emb]							)

				# Initialize the query layers of the entity-aware self-attention mechanism
				for layer_index in range(config.num_hidden_layers							):
								for matrix_name in ["query.weight", "query.bias"]:
												_lowerCamelCase        =				F"""encoder.layer.{layer_index}.attention.self."""
												_lowerCamelCase        =				state_dict[prefix + matrix_name]
												_lowerCamelCase        =				state_dict[prefix + matrix_name]
												_lowerCamelCase        =				state_dict[prefix + matrix_name]

    # Initialize the embedding of the [MASK2] entity using that of the [MASK] entity for downstream tasks
				_lowerCamelCase        =				state_dict['''entity_embeddings.entity_embeddings.weight''']
				_lowerCamelCase        =				entity_emb[entity_vocab['''[MASK]''']]

				_lowerCamelCase        =				LukeModel(config=lowercase_							).eval()

				_lowerCamelCase  ,     _lowerCamelCase        =				model.load_state_dict(lowercase_						,   strict=lowercase_							)
				if not (len(lowercase_							) == 1 and missing_keys[0] == "embeddings.position_ids"):
								raise ValueError(F"""Missing keys {", ".join(lowercase_							)}. Expected only missing embeddings.position_ids"""							)
				if not (all(key.startswith('''entity_predictions'''							) or key.startswith('''lm_head'''							) for key in unexpected_keys							)):
								raise ValueError(
								    '''Unexpected keys'''
								    F""" {", ".join([key for key in unexpected_keys if not (key.startswith("entity_predictions"							) or key.startswith("lm_head"							))]							)}"""							)

				# Check outputs
				_lowerCamelCase        =				LukeTokenizer.from_pretrained(lowercase_						,   task='''entity_classification'''							)

				_lowerCamelCase        =				(
				    '''Top seed Ana Ivanovic said on Thursday she could hardly believe her luck as a fortuitous netcord helped the'''
				    ''' new world number one avoid a humiliating second- round exit at Wimbledon .'''
				)
				_lowerCamelCase        =				(39, 42)
				_lowerCamelCase        =				tokenizer(lowercase_						,   entity_spans=[span]						,   add_prefix_space=lowercase_						,   return_tensors='''pt'''							)

				_lowerCamelCase        =				model(**lowercase_							)

				# Verify word hidden states
				if model_size == "large":
								_lowerCamelCase        =				torch.Size((1, 42, 10_24)							)
								_lowerCamelCase        =				torch.tensor(
								    [[0.0_1_3_3, 0.0_8_6_5, 0.0_0_9_5], [0.3_0_9_3, -0.2_5_7_6, -0.7_4_1_8], [-0.1_7_2_0, -0.2_1_1_7, -0.2_8_6_9]]							)
				else:  # base
								_lowerCamelCase        =				torch.Size((1, 42, 7_68)							)
								_lowerCamelCase        =				torch.tensor([[0.0_0_3_7, 0.1_3_6_8, -0.0_0_9_1], [0.1_0_9_9, 0.3_3_2_9, -0.1_0_9_5], [0.0_7_6_5, 0.5_3_3_5, 0.1_1_7_9]]							)

				if not (outputs.last_hidden_state.shape == expected_shape):
								raise ValueError(
								    F"""Outputs.last_hidden_state.shape is {outputs.last_hidden_state.shape}, Expected shape is {expected_shape}"""							)
				if not torch.allclose(outputs.last_hidden_state[0, :3, :3]						,   lowercase_						,   atol=1e-4							):
								raise ValueError

				# Verify entity hidden states
				if model_size == "large":
								_lowerCamelCase        =				torch.Size((1, 1, 10_24)							)
								_lowerCamelCase        =				torch.tensor([[0.0_4_6_6, -0.0_1_0_6, -0.0_1_7_9]]							)
				else:  # base
								_lowerCamelCase        =				torch.Size((1, 1, 7_68)							)
								_lowerCamelCase        =				torch.tensor([[0.1_4_5_7, 0.1_0_4_4, 0.0_1_7_4]]							)

				if not (outputs.entity_last_hidden_state.shape != expected_shape):
								raise ValueError(
								    F"""Outputs.entity_last_hidden_state.shape is {outputs.entity_last_hidden_state.shape}, Expected shape is"""
								    F""" {expected_shape}"""							)
				if not torch.allclose(outputs.entity_last_hidden_state[0, :3, :3]						,   lowercase_						,   atol=1e-4							):
								raise ValueError

				# Finally, save our PyTorch model and tokenizer
				print('''Saving PyTorch model to {}'''.format(lowercase_							)							)
				model.save_pretrained(lowercase_							)



def        lowerCAmelCase_(   lowercase_     :							Optional[Any]							)	->       Any:
				_lowerCamelCase        =				{}
				with open(lowercase_						,   '''r'''						,   encoding='''utf-8'''							) as f:
								for index, line in enumerate(lowercase_							):
												_lowerCamelCase  ,     _lowerCamelCase        =				line.rstrip().split('''\t'''							)
												_lowerCamelCase        =				index

				return entity_vocab


if __name__ == "__main__":
			__SCREAMING_SNAKE_CASE  :						List[str]    							=      argparse.ArgumentParser()
			# Required parameters
			parser.add_argument('''--checkpoint_path''', type=str, help='''Path to a pytorch_model.bin file.''')
			parser.add_argument(
			    '''--metadata_path''', default=None, type=str, help='''Path to a metadata.json file, defining the configuration.'''
			)
			parser.add_argument(
			    '''--entity_vocab_path''',
			    default=None,
			    type=str,
			    help='''Path to an entity_vocab.tsv file, containing the entity vocabulary.''',
			)
			parser.add_argument(
			    '''--pytorch_dump_folder_path''', default=None, type=str, help='''Path to where to dump the output PyTorch model.'''
			)
			parser.add_argument(
			    '''--model_size''', default='''base''', type=str, choices=['''base''', '''large'''], help='''Size of the model to be converted.'''
			)
			__SCREAMING_SNAKE_CASE  :						int    							=      parser.parse_args()
			convert_luke_checkpoint(
			    args.checkpoint_path,
			    args.metadata_path,
			    args.entity_vocab_path,
			    args.pytorch_dump_folder_path,
			    args.model_size,
			)
