
import json
import pathlib
import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision, slow
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
   import torch

if is_vision_available():
   from PIL import Image

   from transformers import ConditionalDetrImageProcessor





class   __UpperCamelCase      (				unittest.TestCase    ):






     """simple docstring"""







     def __init__(							self				:				Any			,		_A				:				Union[str, Any]			,		_A				:				Union[str, Any]=7			,		_A				:				int=3			,		_A				:				List[str]=30			,		_A				:				Optional[Any]=400			,		_A				:				List[str]=True			,		_A				:				Union[str, Any]=None			,		_A				:				Tuple=True			,		_A				:				Union[str, Any]=[0.5, 0.5, 0.5]			,		_A				:				List[str]=[0.5, 0.5, 0.5]			,		_A				:				str=True			,		_A				:				Optional[int]=1 / 255			,		_A				:				Optional[int]=True			,		):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE	:     int =						size if size is not None else {'''shortest_edge''': 18, '''longest_edge''': 1333}
       __SCREAMING_SNAKE_CASE	:     Optional[Any] =						parent
       __SCREAMING_SNAKE_CASE	:     Dict =						batch_size
       __SCREAMING_SNAKE_CASE	:     Optional[int] =						num_channels
       __SCREAMING_SNAKE_CASE	:     int =						min_resolution
       __SCREAMING_SNAKE_CASE	:     Dict =						max_resolution
       __SCREAMING_SNAKE_CASE	:     Dict =						do_resize
       __SCREAMING_SNAKE_CASE	:     Tuple =						size
       __SCREAMING_SNAKE_CASE	:     Union[str, Any] =						do_normalize
       __SCREAMING_SNAKE_CASE	:     Optional[int] =						image_mean
       __SCREAMING_SNAKE_CASE	:     str =						image_std
       __SCREAMING_SNAKE_CASE	:     Optional[Any] =						do_rescale
       __SCREAMING_SNAKE_CASE	:     Any =						rescale_factor
       __SCREAMING_SNAKE_CASE	:     Optional[Any] =						do_pad



     def       UpperCAmelCase__				(							self				:				Any      ):







       """simple docstring"""




       return {
           "do_resize": self.do_resize,
           "size": self.size,
           "do_normalize": self.do_normalize,
           "image_mean": self.image_mean,
           "image_std": self.image_std,
           "do_rescale": self.do_rescale,
           "rescale_factor": self.rescale_factor,
           "do_pad": self.do_pad,
       }




     def       UpperCAmelCase__				(							self				:				Dict			,		_A				:				Union[str, Any]			,		_A				:				Dict=False      ):







       """simple docstring"""




       if not batched:
         __SCREAMING_SNAKE_CASE	:     Union[str, Any] =						image_inputs[0]
         if isinstance(_a			,		Image.Image      ):
           __SCREAMING_SNAKE_CASE,						__SCREAMING_SNAKE_CASE	:     Optional[int] =						image.size
         else:
           __SCREAMING_SNAKE_CASE,						__SCREAMING_SNAKE_CASE	:     Optional[int] =						image.shape[1], image.shape[2]
         if w < h:
           __SCREAMING_SNAKE_CASE	:     Any =						int(self.size['''shortest_edge'''] * h / w      )
           __SCREAMING_SNAKE_CASE	:     Any =						self.size['''shortest_edge''']
         elif w > h:
           __SCREAMING_SNAKE_CASE	:     Dict =						self.size['''shortest_edge''']
           __SCREAMING_SNAKE_CASE	:     List[Any] =						int(self.size['''shortest_edge'''] * w / h      )
         else:
           __SCREAMING_SNAKE_CASE	:     Tuple =						self.size['''shortest_edge''']
           __SCREAMING_SNAKE_CASE	:     List[Any] =						self.size['''shortest_edge''']

       else:
         __SCREAMING_SNAKE_CASE	:     int =						[]
         for image in image_inputs:
           __SCREAMING_SNAKE_CASE,						__SCREAMING_SNAKE_CASE	:     Optional[Any] =						self.get_expected_values([image]      )
           expected_values.append((expected_height, expected_width)      )
         __SCREAMING_SNAKE_CASE	:     Dict =						max(_a			,		key=lambda _A      : item[0]      )[0]
         __SCREAMING_SNAKE_CASE	:     Optional[int] =						max(_a			,		key=lambda _A      : item[1]      )[1]

       return expected_height, expected_width






@require_torch
@require_vision
class   __UpperCamelCase      (				__SCREAMING_SNAKE_CASE      ,		unittest.TestCase    ):






     """simple docstring"""







     lowerCAmelCase_									=       ConditionalDetrImageProcessor if is_vision_available() else None



     def       UpperCAmelCase__				(							self				:				int      ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE	:     Optional[Any] =						ConditionalDetrImageProcessingTester(self      )



     @property
     def       UpperCAmelCase__				(							self				:				Optional[int]      ):







       """simple docstring"""




       return self.image_processor_tester.prepare_image_processor_dict()



     def       UpperCAmelCase__				(							self				:				Any      ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE	:     List[Any] =						self.image_processing_class(**self.image_processor_dict      )
       self.assertTrue(hasattr(_a			,		'''image_mean'''      )      )
       self.assertTrue(hasattr(_a			,		'''image_std'''      )      )
       self.assertTrue(hasattr(_a			,		'''do_normalize'''      )      )
       self.assertTrue(hasattr(_a			,		'''do_resize'''      )      )
       self.assertTrue(hasattr(_a			,		'''size'''      )      )



     def       UpperCAmelCase__				(							self				:				List[str]      ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE	:     List[str] =						self.image_processing_class.from_dict(self.image_processor_dict      )
       self.assertEqual(image_processor.size			,		{'''shortest_edge''': 18, '''longest_edge''': 1333}      )
       self.assertEqual(image_processor.do_pad			,		_a      )

       __SCREAMING_SNAKE_CASE	:     List[Any] =						self.image_processing_class.from_dict(
           self.image_processor_dict			,		size=42			,		max_size=84			,		pad_and_return_pixel_mask=_a      )
       self.assertEqual(image_processor.size			,		{'''shortest_edge''': 42, '''longest_edge''': 84}      )
       self.assertEqual(image_processor.do_pad			,		_a      )



     def       UpperCAmelCase__				(							self				:				Tuple      ):







       """simple docstring"""




       pass



     def       UpperCAmelCase__				(							self				:				Optional[Any]      ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE	:     Any =						self.image_processing_class(**self.image_processor_dict      )
       # create random PIL images
       __SCREAMING_SNAKE_CASE	:     Optional[Any] =						prepare_image_inputs(self.image_processor_tester			,		equal_resolution=_a      )
       for image in image_inputs:
         self.assertIsInstance(_a			,		Image.Image      )

       # Test not batched input
       __SCREAMING_SNAKE_CASE	:     Union[str, Any] =						image_processing(image_inputs[0]			,		return_tensors='''pt'''      ).pixel_values

       __SCREAMING_SNAKE_CASE,						__SCREAMING_SNAKE_CASE	:     Dict =						self.image_processor_tester.get_expected_values(_a      )

       self.assertEqual(
           encoded_images.shape			,		(1, self.image_processor_tester.num_channels, expected_height, expected_width)			,		)

       # Test batched
       __SCREAMING_SNAKE_CASE,						__SCREAMING_SNAKE_CASE	:     List[str] =						self.image_processor_tester.get_expected_values(_a			,		batched=_a      )

       __SCREAMING_SNAKE_CASE	:     str =						image_processing(_a			,		return_tensors='''pt'''      ).pixel_values
       self.assertEqual(
           encoded_images.shape			,		(
               self.image_processor_tester.batch_size,
               self.image_processor_tester.num_channels,
               expected_height,
               expected_width,
           )			,		)



     def       UpperCAmelCase__				(							self				:				Any      ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE	:     Any =						self.image_processing_class(**self.image_processor_dict      )
       # create random numpy tensors
       __SCREAMING_SNAKE_CASE	:     Tuple =						prepare_image_inputs(self.image_processor_tester			,		equal_resolution=_a			,		numpify=_a      )
       for image in image_inputs:
         self.assertIsInstance(_a			,		np.ndarray      )

       # Test not batched input
       __SCREAMING_SNAKE_CASE	:     List[str] =						image_processing(image_inputs[0]			,		return_tensors='''pt'''      ).pixel_values

       __SCREAMING_SNAKE_CASE,						__SCREAMING_SNAKE_CASE	:     str =						self.image_processor_tester.get_expected_values(_a      )

       self.assertEqual(
           encoded_images.shape			,		(1, self.image_processor_tester.num_channels, expected_height, expected_width)			,		)

       # Test batched
       __SCREAMING_SNAKE_CASE	:     Dict =						image_processing(_a			,		return_tensors='''pt'''      ).pixel_values

       __SCREAMING_SNAKE_CASE,						__SCREAMING_SNAKE_CASE	:     Tuple =						self.image_processor_tester.get_expected_values(_a			,		batched=_a      )

       self.assertEqual(
           encoded_images.shape			,		(
               self.image_processor_tester.batch_size,
               self.image_processor_tester.num_channels,
               expected_height,
               expected_width,
           )			,		)



     def       UpperCAmelCase__				(							self				:				int      ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE	:     int =						self.image_processing_class(**self.image_processor_dict      )
       # create random PyTorch tensors
       __SCREAMING_SNAKE_CASE	:     str =						prepare_image_inputs(self.image_processor_tester			,		equal_resolution=_a			,		torchify=_a      )
       for image in image_inputs:
         self.assertIsInstance(_a			,		torch.Tensor      )

       # Test not batched input
       __SCREAMING_SNAKE_CASE	:     Dict =						image_processing(image_inputs[0]			,		return_tensors='''pt'''      ).pixel_values

       __SCREAMING_SNAKE_CASE,						__SCREAMING_SNAKE_CASE	:     List[str] =						self.image_processor_tester.get_expected_values(_a      )

       self.assertEqual(
           encoded_images.shape			,		(1, self.image_processor_tester.num_channels, expected_height, expected_width)			,		)

       # Test batched
       __SCREAMING_SNAKE_CASE	:     List[str] =						image_processing(_a			,		return_tensors='''pt'''      ).pixel_values

       __SCREAMING_SNAKE_CASE,						__SCREAMING_SNAKE_CASE	:     Tuple =						self.image_processor_tester.get_expected_values(_a			,		batched=_a      )

       self.assertEqual(
           encoded_images.shape			,		(
               self.image_processor_tester.batch_size,
               self.image_processor_tester.num_channels,
               expected_height,
               expected_width,
           )			,		)



     @slow
     def       UpperCAmelCase__				(							self				:				int      ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE	:     Optional[Any] =						Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''      )
       with open('''./tests/fixtures/tests_samples/COCO/coco_annotations.txt'''			,		'''r'''      ) as f:
         __SCREAMING_SNAKE_CASE	:     List[str] =						json.loads(f.read()      )

       __SCREAMING_SNAKE_CASE	:     Union[str, Any] =						{'''image_id''': 3_9769, '''annotations''': target}

       # encode them
       __SCREAMING_SNAKE_CASE	:     List[str] =						ConditionalDetrImageProcessor.from_pretrained('''microsoft/conditional-detr-resnet-50'''      )
       __SCREAMING_SNAKE_CASE	:     Optional[int] =						image_processing(images=_a			,		annotations=_a			,		return_tensors='''pt'''      )

       # verify pixel values
       __SCREAMING_SNAKE_CASE	:     List[Any] =						torch.Size([1, 3, 800, 1066]      )
       self.assertEqual(encoding['''pixel_values'''].shape			,		_a      )

       __SCREAMING_SNAKE_CASE	:     Any =						torch.tensor([0.27_96, 0.31_38, 0.34_81]      )
       self.assertTrue(torch.allclose(encoding['''pixel_values'''][0, 0, 0, :3]			,		_a			,		atol=1e-4      )      )

       # verify area
       __SCREAMING_SNAKE_CASE	:     Any =						torch.tensor([58_87.96_00, 1_1250.2061, 48_9353.8438, 83_7122.7500, 14_7967.5156, 16_5732.3438]      )
       self.assertTrue(torch.allclose(encoding['''labels'''][0]['''area''']			,		_a      )      )
       # verify boxes
       __SCREAMING_SNAKE_CASE	:     List[Any] =						torch.Size([6, 4]      )
       self.assertEqual(encoding['''labels'''][0]['''boxes'''].shape			,		_a      )
       __SCREAMING_SNAKE_CASE	:     Any =						torch.tensor([0.55_03, 0.27_65, 0.06_04, 0.22_15]      )
       self.assertTrue(torch.allclose(encoding['''labels'''][0]['''boxes'''][0]			,		_a			,		atol=1e-3      )      )
       # verify image_id
       __SCREAMING_SNAKE_CASE	:     Optional[Any] =						torch.tensor([3_9769]      )
       self.assertTrue(torch.allclose(encoding['''labels'''][0]['''image_id''']			,		_a      )      )
       # verify is_crowd
       __SCREAMING_SNAKE_CASE	:     Dict =						torch.tensor([0, 0, 0, 0, 0, 0]      )
       self.assertTrue(torch.allclose(encoding['''labels'''][0]['''iscrowd''']			,		_a      )      )
       # verify class_labels
       __SCREAMING_SNAKE_CASE	:     Optional[Any] =						torch.tensor([75, 75, 63, 65, 17, 17]      )
       self.assertTrue(torch.allclose(encoding['''labels'''][0]['''class_labels''']			,		_a      )      )
       # verify orig_size
       __SCREAMING_SNAKE_CASE	:     Tuple =						torch.tensor([480, 640]      )
       self.assertTrue(torch.allclose(encoding['''labels'''][0]['''orig_size''']			,		_a      )      )
       # verify size
       __SCREAMING_SNAKE_CASE	:     Any =						torch.tensor([800, 1066]      )
       self.assertTrue(torch.allclose(encoding['''labels'''][0]['''size''']			,		_a      )      )




     @slow
     def       UpperCAmelCase__				(							self				:				Union[str, Any]      ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE	:     Any =						Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''      )
       with open('''./tests/fixtures/tests_samples/COCO/coco_panoptic_annotations.txt'''			,		'''r'''      ) as f:
         __SCREAMING_SNAKE_CASE	:     Any =						json.loads(f.read()      )

       __SCREAMING_SNAKE_CASE	:     int =						{'''file_name''': '''000000039769.png''', '''image_id''': 3_9769, '''segments_info''': target}

       __SCREAMING_SNAKE_CASE	:     List[str] =						pathlib.Path('''./tests/fixtures/tests_samples/COCO/coco_panoptic'''      )

       # encode them
       __SCREAMING_SNAKE_CASE	:     Optional[Any] =						ConditionalDetrImageProcessor(format='''coco_panoptic'''      )
       __SCREAMING_SNAKE_CASE	:     Tuple =						image_processing(images=_a			,		annotations=_a			,		masks_path=_a			,		return_tensors='''pt'''      )

       # verify pixel values
       __SCREAMING_SNAKE_CASE	:     int =						torch.Size([1, 3, 800, 1066]      )
       self.assertEqual(encoding['''pixel_values'''].shape			,		_a      )

       __SCREAMING_SNAKE_CASE	:     int =						torch.tensor([0.27_96, 0.31_38, 0.34_81]      )
       self.assertTrue(torch.allclose(encoding['''pixel_values'''][0, 0, 0, :3]			,		_a			,		atol=1e-4      )      )

       # verify area
       __SCREAMING_SNAKE_CASE	:     List[str] =						torch.tensor([14_7979.6875, 16_5527.0469, 48_4638.5938, 1_1292.9375, 58_79.65_62, 76_34.11_47]      )
       self.assertTrue(torch.allclose(encoding['''labels'''][0]['''area''']			,		_a      )      )
       # verify boxes
       __SCREAMING_SNAKE_CASE	:     Any =						torch.Size([6, 4]      )
       self.assertEqual(encoding['''labels'''][0]['''boxes'''].shape			,		_a      )
       __SCREAMING_SNAKE_CASE	:     List[Any] =						torch.tensor([0.26_25, 0.54_37, 0.46_88, 0.86_25]      )
       self.assertTrue(torch.allclose(encoding['''labels'''][0]['''boxes'''][0]			,		_a			,		atol=1e-3      )      )
       # verify image_id
       __SCREAMING_SNAKE_CASE	:     Any =						torch.tensor([3_9769]      )
       self.assertTrue(torch.allclose(encoding['''labels'''][0]['''image_id''']			,		_a      )      )
       # verify is_crowd
       __SCREAMING_SNAKE_CASE	:     Any =						torch.tensor([0, 0, 0, 0, 0, 0]      )
       self.assertTrue(torch.allclose(encoding['''labels'''][0]['''iscrowd''']			,		_a      )      )
       # verify class_labels
       __SCREAMING_SNAKE_CASE	:     Any =						torch.tensor([17, 17, 63, 75, 75, 93]      )
       self.assertTrue(torch.allclose(encoding['''labels'''][0]['''class_labels''']			,		_a      )      )
       # verify masks
       __SCREAMING_SNAKE_CASE	:     List[Any] =						82_2873
       self.assertEqual(encoding['''labels'''][0]['''masks'''].sum().item()			,		_a      )
       # verify orig_size
       __SCREAMING_SNAKE_CASE	:     int =						torch.tensor([480, 640]      )
       self.assertTrue(torch.allclose(encoding['''labels'''][0]['''orig_size''']			,		_a      )      )
       # verify size
       __SCREAMING_SNAKE_CASE	:     List[Any] =						torch.tensor([800, 1066]      )
       self.assertTrue(torch.allclose(encoding['''labels'''][0]['''size''']			,		_a      )      )




"""simple docstring"""




from argparse import ArgumentParser, Namespace

from ..utils import logging
from . import BaseTransformersCLICommand

def        lowercase							(		lowerCAmelCase__ :     Namespace			) ->      Tuple:
		return ConvertCommand(
		    args.model_type    ,					args.tf_checkpoint    ,					args.pytorch_dump_output    ,					args.config    ,					args.finetuning_task_name			)


lowercase_			     =  "\ntransformers can only be used from the commandline to convert TensorFlow models in PyTorch, In that case, it requires\nTensorFlow to be installed. Please see https://www.tensorflow.org/install/ for installation instructions.\n"




class 					__lowerCAmelCase					(   __SCREAMING_SNAKE_CASE       ):


		'''simple docstring'''



		@staticmethod
		def 			__UpperCAmelCase       (  _a      ):
				__a           =			parser.add_parser(
				    '''convert'''							, help='''CLI tool to run convert model from original author checkpoints to Transformers PyTorch checkpoints.'''							, )
				train_parser.add_argument('''--model_type'''							, type=_a							, required=_a							, help='''Model\'s type.'''      )
				train_parser.add_argument(
				    '''--tf_checkpoint'''							, type=_a							, required=_a							, help='''TensorFlow checkpoint path or folder.'''      )
				train_parser.add_argument(
				    '''--pytorch_dump_output'''							, type=_a							, required=_a							, help='''Path to the PyTorch saved model output.'''      )
				train_parser.add_argument('''--config'''							, type=_a							, default=''''''							, help='''Configuration file path or folder.'''      )
				train_parser.add_argument(
				    '''--finetuning_task_name'''							, type=_a							, default=_a							, help='''Optional fine-tuning task name if the TF model was a finetuned model.'''							, )
				train_parser.set_defaults(func=_a      )

		def __init__(  self							, _a							, _a							, _a							, _a							, _a							, *_a							, ):
				__a           =			logging.get_logger('''transformers-cli/converting'''      )

				self._logger.info(f'''Loading model {model_type}'''      )
				__a           =			model_type
				__a           =			tf_checkpoint
				__a           =			pytorch_dump_output
				__a           =			config
				__a           =			finetuning_task_name





		def 			__UpperCAmelCase       (  self      ):
				if self._model_type == "albert":
						try:
								from ..models.albert.convert_albert_original_tf_checkpoint_to_pytorch import (
								    convert_tf_checkpoint_to_pytorch,
								)
						except ImportError:
								raise ImportError(_a      )

						convert_tf_checkpoint_to_pytorch(self._tf_checkpoint							, self._config							, self._pytorch_dump_output      )
				elif self._model_type == "bert":
						try:
								from ..models.bert.convert_bert_original_tf_checkpoint_to_pytorch import (
								    convert_tf_checkpoint_to_pytorch,
								)
						except ImportError:
								raise ImportError(_a      )

						convert_tf_checkpoint_to_pytorch(self._tf_checkpoint							, self._config							, self._pytorch_dump_output      )
				elif self._model_type == "funnel":
						try:
								from ..models.funnel.convert_funnel_original_tf_checkpoint_to_pytorch import (
								    convert_tf_checkpoint_to_pytorch,
								)
						except ImportError:
								raise ImportError(_a      )

						convert_tf_checkpoint_to_pytorch(self._tf_checkpoint							, self._config							, self._pytorch_dump_output      )
				elif self._model_type == "t5":
						try:
								from ..models.ta.convert_ta_original_tf_checkpoint_to_pytorch import convert_tf_checkpoint_to_pytorch
						except ImportError:
								raise ImportError(_a      )

						convert_tf_checkpoint_to_pytorch(self._tf_checkpoint							, self._config							, self._pytorch_dump_output      )
				elif self._model_type == "gpt":
						from ..models.openai.convert_openai_original_tf_checkpoint_to_pytorch import (
						    convert_openai_checkpoint_to_pytorch,
						)

						convert_openai_checkpoint_to_pytorch(self._tf_checkpoint							, self._config							, self._pytorch_dump_output      )
				elif self._model_type == "transfo_xl":
						try:
								from ..models.transfo_xl.convert_transfo_xl_original_tf_checkpoint_to_pytorch import (
								    convert_transfo_xl_checkpoint_to_pytorch,
								)
						except ImportError:
								raise ImportError(_a      )

						if "ckpt" in self._tf_checkpoint.lower():
								__a           =			self._tf_checkpoint
								__a           =			''''''
						else:
								__a           =			self._tf_checkpoint
								__a           =			''''''
						convert_transfo_xl_checkpoint_to_pytorch(
						    _a							, self._config							, self._pytorch_dump_output							, _a      )
				elif self._model_type == "gpt2":
						try:
								from ..models.gpta.convert_gpta_original_tf_checkpoint_to_pytorch import (
								    convert_gpta_checkpoint_to_pytorch,
								)
						except ImportError:
								raise ImportError(_a      )

						convert_gpta_checkpoint_to_pytorch(self._tf_checkpoint							, self._config							, self._pytorch_dump_output      )
				elif self._model_type == "xlnet":
						try:
								from ..models.xlnet.convert_xlnet_original_tf_checkpoint_to_pytorch import (
								    convert_xlnet_checkpoint_to_pytorch,
								)
						except ImportError:
								raise ImportError(_a      )

						convert_xlnet_checkpoint_to_pytorch(
						    self._tf_checkpoint							, self._config							, self._pytorch_dump_output							, self._finetuning_task_name      )
				elif self._model_type == "xlm":
						from ..models.xlm.convert_xlm_original_pytorch_checkpoint_to_pytorch import (
						    convert_xlm_checkpoint_to_pytorch,
						)

						convert_xlm_checkpoint_to_pytorch(self._tf_checkpoint							, self._pytorch_dump_output      )
				elif self._model_type == "lxmert":
						from ..models.lxmert.convert_lxmert_original_tf_checkpoint_to_pytorch import (
						    convert_lxmert_checkpoint_to_pytorch,
						)

						convert_lxmert_checkpoint_to_pytorch(self._tf_checkpoint							, self._pytorch_dump_output      )
				elif self._model_type == "rembert":
						from ..models.rembert.convert_rembert_tf_checkpoint_to_pytorch import (
						    convert_rembert_tf_checkpoint_to_pytorch,
						)

						convert_rembert_tf_checkpoint_to_pytorch(self._tf_checkpoint							, self._config							, self._pytorch_dump_output      )
				else:
						raise ValueError(
						    '''--model_type should be selected in the list [bert, gpt, gpt2, t5, transfo_xl, xlnet, xlm, lxmert]'''      )






