
'''simple docstring'''

import argparse
import json
import os

import numpy as np
import PIL
import requests
import tensorflow.keras.applications.efficientnet as efficientnet
import torch
from huggingface_hub import hf_hub_download
from PIL import Image
from tensorflow.keras.preprocessing import image

from transformers import (
    EfficientNetConfig,
    EfficientNetForImageClassification,
    EfficientNetImageProcessor,
)
from transformers.utils import logging


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

snake_case									=    {
    """b0""": efficientnet.EfficientNetBa,
    """b1""": efficientnet.EfficientNetBa,
    """b2""": efficientnet.EfficientNetBa,
    """b3""": efficientnet.EfficientNetBa,
    """b4""": efficientnet.EfficientNetBa,
    """b5""": efficientnet.EfficientNetBa,
    """b6""": efficientnet.EfficientNetBa,
    """b7""": efficientnet.EfficientNetBa,
}

snake_case									=    {
    """b0""": {
        """hidden_dim""": 12_80,
        """width_coef""": 1.0,
        """depth_coef""": 1.0,
        """image_size""": 2_24,
        """dropout_rate""": 0.2,
        """dw_padding""": [],
    },
    """b1""": {
        """hidden_dim""": 12_80,
        """width_coef""": 1.0,
        """depth_coef""": 1.1,
        """image_size""": 2_40,
        """dropout_rate""": 0.2,
        """dw_padding""": [16],
    },
    """b2""": {
        """hidden_dim""": 14_08,
        """width_coef""": 1.1,
        """depth_coef""": 1.2,
        """image_size""": 2_60,
        """dropout_rate""": 0.3,
        """dw_padding""": [5, 8, 16],
    },
    """b3""": {
        """hidden_dim""": 15_36,
        """width_coef""": 1.2,
        """depth_coef""": 1.4,
        """image_size""": 3_00,
        """dropout_rate""": 0.3,
        """dw_padding""": [5, 18],
    },
    """b4""": {
        """hidden_dim""": 17_92,
        """width_coef""": 1.4,
        """depth_coef""": 1.8,
        """image_size""": 3_80,
        """dropout_rate""": 0.4,
        """dw_padding""": [6],
    },
    """b5""": {
        """hidden_dim""": 20_48,
        """width_coef""": 1.6,
        """depth_coef""": 2.2,
        """image_size""": 4_56,
        """dropout_rate""": 0.4,
        """dw_padding""": [13, 27],
    },
    """b6""": {
        """hidden_dim""": 23_04,
        """width_coef""": 1.8,
        """depth_coef""": 2.6,
        """image_size""": 5_28,
        """dropout_rate""": 0.5,
        """dw_padding""": [31],
    },
    """b7""": {
        """hidden_dim""": 25_60,
        """width_coef""": 2.0,
        """depth_coef""": 3.1,
        """image_size""": 6_00,
        """dropout_rate""": 0.5,
        """dw_padding""": [18],
    },
}


def        UpperCAmelCase_ (  lowerCamelCase_			):







 """simple docstring"""


 lowerCAmelCase__     :   Dict     		=	EfficientNetConfig()
 lowerCAmelCase__     :   List[Any]     		=	CONFIG_MAP[model_name]["hidden_dim"]
 lowerCAmelCase__     :   List[str]     		=	CONFIG_MAP[model_name]["width_coef"]
 lowerCAmelCase__     :   Dict     		=	CONFIG_MAP[model_name]["depth_coef"]
 lowerCAmelCase__     :   Any     		=	CONFIG_MAP[model_name]["image_size"]
 lowerCAmelCase__     :   Any     		=	CONFIG_MAP[model_name]["dropout_rate"]
 lowerCAmelCase__     :   Union[str, Any]     		=	CONFIG_MAP[model_name]["dw_padding"]

 lowerCAmelCase__     :   Dict     		=	"huggingface/label-files"
 lowerCAmelCase__     :   Tuple     		=	"imagenet-1k-id2label.json"
 lowerCAmelCase__     :   List[str]     		=	1_0_0_0
 lowerCAmelCase__     :   Optional[int]     		=	json.load(open(hf_hub_download(lowerCamelCase_      ,			lowerCamelCase_      ,			repo_type="dataset"			)      ,			"r"			)			)
 lowerCAmelCase__     :   Dict     		=	{int(lowerCamelCase_			): v for k, v in idalabel.items()}

 lowerCAmelCase__     :   Dict     		=	idalabel
 lowerCAmelCase__     :   str     		=	{v: k for k, v in idalabel.items()}
 return config


def        UpperCAmelCase_ (  ):







 """simple docstring"""


 lowerCAmelCase__     :   int     		=	"http://images.cocodataset.org/val2017/000000039769.jpg"
 lowerCAmelCase__     :   int     		=	Image.open(requests.get(lowerCamelCase_      ,			stream=lowerCamelCase_			).raw			)
 return im


def        UpperCAmelCase_ (  lowerCamelCase_			):







 """simple docstring"""


 lowerCAmelCase__     :   Tuple     		=	CONFIG_MAP[model_name]["image_size"]
 lowerCAmelCase__     :   Optional[int]     		=	EfficientNetImageProcessor(
     size={"height": size, "width": size}      ,			image_mean=[0.485, 0.456, 0.406]      ,			image_std=[0.4785_3944, 0.473_2864, 0.4743_4163]      ,			do_center_crop=lowerCamelCase_      ,			)
 return preprocessor


def        UpperCAmelCase_ (  lowerCamelCase_			):







 """simple docstring"""


 lowerCAmelCase__     :   List[Any]     		=	[v.split("_"			)[0].split("block"			)[1] for v in original_param_names if v.startswith("block"			)]
 lowerCAmelCase__     :   Optional[int]     		=	sorted(set(lowerCamelCase_			)			)
 lowerCAmelCase__     :   List[Any]     		=	len(lowerCamelCase_			)
 lowerCAmelCase__     :   Dict     		=	{b: str(lowerCamelCase_			) for b, i in zip(lowerCamelCase_      ,			range(lowerCamelCase_			)			)}

 lowerCAmelCase__     :   Any     		=	[]
 rename_keys.append(("stem_conv/kernel:0", "embeddings.convolution.weight")			)
 rename_keys.append(("stem_bn/gamma:0", "embeddings.batchnorm.weight")			)
 rename_keys.append(("stem_bn/beta:0", "embeddings.batchnorm.bias")			)
 rename_keys.append(("stem_bn/moving_mean:0", "embeddings.batchnorm.running_mean")			)
 rename_keys.append(("stem_bn/moving_variance:0", "embeddings.batchnorm.running_var")			)

 for b in block_names:
  lowerCAmelCase__     :   List[str]     		=	block_name_mapping[b]
  rename_keys.append((f'''block{b}_expand_conv/kernel:0''', f'''encoder.blocks.{hf_b}.expansion.expand_conv.weight''')			)
  rename_keys.append((f'''block{b}_expand_bn/gamma:0''', f'''encoder.blocks.{hf_b}.expansion.expand_bn.weight''')			)
  rename_keys.append((f'''block{b}_expand_bn/beta:0''', f'''encoder.blocks.{hf_b}.expansion.expand_bn.bias''')			)
  rename_keys.append(
      (f'''block{b}_expand_bn/moving_mean:0''', f'''encoder.blocks.{hf_b}.expansion.expand_bn.running_mean''')			)
  rename_keys.append(
      (f'''block{b}_expand_bn/moving_variance:0''', f'''encoder.blocks.{hf_b}.expansion.expand_bn.running_var''')			)
  rename_keys.append(
      (f'''block{b}_dwconv/depthwise_kernel:0''', f'''encoder.blocks.{hf_b}.depthwise_conv.depthwise_conv.weight''')			)
  rename_keys.append((f'''block{b}_bn/gamma:0''', f'''encoder.blocks.{hf_b}.depthwise_conv.depthwise_norm.weight''')			)
  rename_keys.append((f'''block{b}_bn/beta:0''', f'''encoder.blocks.{hf_b}.depthwise_conv.depthwise_norm.bias''')			)
  rename_keys.append(
      (f'''block{b}_bn/moving_mean:0''', f'''encoder.blocks.{hf_b}.depthwise_conv.depthwise_norm.running_mean''')			)
  rename_keys.append(
      (f'''block{b}_bn/moving_variance:0''', f'''encoder.blocks.{hf_b}.depthwise_conv.depthwise_norm.running_var''')			)

  rename_keys.append((f'''block{b}_se_reduce/kernel:0''', f'''encoder.blocks.{hf_b}.squeeze_excite.reduce.weight''')			)
  rename_keys.append((f'''block{b}_se_reduce/bias:0''', f'''encoder.blocks.{hf_b}.squeeze_excite.reduce.bias''')			)
  rename_keys.append((f'''block{b}_se_expand/kernel:0''', f'''encoder.blocks.{hf_b}.squeeze_excite.expand.weight''')			)
  rename_keys.append((f'''block{b}_se_expand/bias:0''', f'''encoder.blocks.{hf_b}.squeeze_excite.expand.bias''')			)
  rename_keys.append(
      (f'''block{b}_project_conv/kernel:0''', f'''encoder.blocks.{hf_b}.projection.project_conv.weight''')			)
  rename_keys.append((f'''block{b}_project_bn/gamma:0''', f'''encoder.blocks.{hf_b}.projection.project_bn.weight''')			)
  rename_keys.append((f'''block{b}_project_bn/beta:0''', f'''encoder.blocks.{hf_b}.projection.project_bn.bias''')			)
  rename_keys.append(
      (f'''block{b}_project_bn/moving_mean:0''', f'''encoder.blocks.{hf_b}.projection.project_bn.running_mean''')			)
  rename_keys.append(
      (f'''block{b}_project_bn/moving_variance:0''', f'''encoder.blocks.{hf_b}.projection.project_bn.running_var''')			)

 rename_keys.append(("top_conv/kernel:0", "encoder.top_conv.weight")			)
 rename_keys.append(("top_bn/gamma:0", "encoder.top_bn.weight")			)
 rename_keys.append(("top_bn/beta:0", "encoder.top_bn.bias")			)
 rename_keys.append(("top_bn/moving_mean:0", "encoder.top_bn.running_mean")			)
 rename_keys.append(("top_bn/moving_variance:0", "encoder.top_bn.running_var")			)

 lowerCAmelCase__     :   Any     		=	{}
 for item in rename_keys:
  if item[0] in original_param_names:
   lowerCAmelCase__     :   Any     		=	"efficientnet." + item[1]

 lowerCAmelCase__     :   Optional[Any]     		=	"classifier.weight"
 lowerCAmelCase__     :   Dict     		=	"classifier.bias"
 return key_mapping


def        UpperCAmelCase_ (  lowerCamelCase_      ,			lowerCamelCase_      ,			lowerCamelCase_			):







 """simple docstring"""


 for key, value in tf_params.items():
  if "normalization" in key:
   continue

  lowerCAmelCase__     :   Optional[int]     		=	key_mapping[key]
  if "_conv" in key and "kernel" in key:
   lowerCAmelCase__     :   Union[str, Any]     		=	torch.from_numpy(lowerCamelCase_			).permute(3      ,			2      ,			0      ,			1			)
  elif "depthwise_kernel" in key:
   lowerCAmelCase__     :   str     		=	torch.from_numpy(lowerCamelCase_			).permute(2      ,			3      ,			0      ,			1			)
  elif "kernel" in key:
   lowerCAmelCase__     :   Any     		=	torch.from_numpy(np.transpose(lowerCamelCase_			)			)
  else:
   lowerCAmelCase__     :   Optional[int]     		=	torch.from_numpy(lowerCamelCase_			)

  # Replace HF parameters with original TF model parameters
  assert hf_params[hf_key].shape == new_hf_value.shape
  hf_params[hf_key].copy_(lowerCamelCase_			)


@torch.no_grad()
def        UpperCAmelCase_ (  lowerCamelCase_      ,			lowerCamelCase_      ,			lowerCamelCase_      ,			lowerCamelCase_			):







 """simple docstring"""


 lowerCAmelCase__     :   Union[str, Any]     		=	model_classes[model_name](
     include_top=lowerCamelCase_      ,			weights="imagenet"      ,			input_tensor=lowerCamelCase_      ,			input_shape=lowerCamelCase_      ,			pooling=lowerCamelCase_      ,			classes=1_0_0_0      ,			classifier_activation="softmax"      ,			)

 lowerCAmelCase__     :   Optional[int]     		=	original_model.trainable_variables
 lowerCAmelCase__     :   List[str]     		=	original_model.non_trainable_variables
 lowerCAmelCase__     :   int     		=	{param.name: param.numpy() for param in tf_params}
 for param in tf_non_train_params:
  lowerCAmelCase__     :   Any     		=	param.numpy()
 lowerCAmelCase__     :   int     		=	list(tf_params.keys()			)

 # Load HuggingFace model
 lowerCAmelCase__     :   List[str]     		=	get_efficientnet_config(lowerCamelCase_			)
 lowerCAmelCase__     :   Dict     		=	EfficientNetForImageClassification(lowerCamelCase_			).eval()
 lowerCAmelCase__     :   int     		=	hf_model.state_dict()

 # Create src-to-dst parameter name mapping dictionary
 print("Converting parameters..."			)
 lowerCAmelCase__     :   List[str]     		=	rename_keys(lowerCamelCase_			)
 replace_params(lowerCamelCase_      ,			lowerCamelCase_      ,			lowerCamelCase_			)

 # Initialize preprocessor and preprocess input image
 lowerCAmelCase__     :   Dict     		=	convert_image_processor(lowerCamelCase_			)
 lowerCAmelCase__     :   Optional[Any]     		=	preprocessor(images=prepare_img()      ,			return_tensors="pt"			)

 # HF model inference
 hf_model.eval()
 with torch.no_grad():
  lowerCAmelCase__     :   List[Any]     		=	hf_model(**lowerCamelCase_			)
 lowerCAmelCase__     :   Tuple     		=	outputs.logits.detach().numpy()

 # Original model inference
 lowerCAmelCase__     :   Optional[int]     		=	False
 lowerCAmelCase__     :   List[str]     		=	CONFIG_MAP[model_name]["image_size"]
 lowerCAmelCase__     :   Dict     		=	prepare_img().resize((image_size, image_size)      ,			resample=PIL.Image.NEAREST			)
 lowerCAmelCase__     :   List[Any]     		=	image.img_to_array(lowerCamelCase_			)
 lowerCAmelCase__     :   Optional[int]     		=	np.expand_dims(lowerCamelCase_      ,			axis=0			)
 lowerCAmelCase__     :   str     		=	original_model.predict(lowerCamelCase_			)

 # Check whether original and HF model outputs match  -> np.allclose
 assert np.allclose(lowerCamelCase_      ,			lowerCamelCase_      ,			atol=1e-3			), "The predicted logits are not the same."
 print("Model outputs match!"			)

 if save_model:
  # Create folder to save model
  if not os.path.isdir(lowerCamelCase_			):
   os.mkdir(lowerCamelCase_			)
  # Save converted model and image processor
  hf_model.save_pretrained(lowerCamelCase_			)
  preprocessor.save_pretrained(lowerCamelCase_			)

 if push_to_hub:
  # Push model and image processor to hub
  print(f'''Pushing converted {model_name} to the hub...'''			)
  lowerCAmelCase__     :   Any     		=	f'''efficientnet-{model_name}'''
  preprocessor.push_to_hub(lowerCamelCase_			)
  hf_model.push_to_hub(lowerCamelCase_			)


if __name__ == "__main__":
     snake_case									=    argparse.ArgumentParser()
     # Required parameters
     parser.add_argument(
         """--model_name""",
         default="""b0""",
         type=str,
         help="""Version name of the EfficientNet model you want to convert, select from [b0, b1, b2, b3, b4, b5, b6, b7].""",
     )
     parser.add_argument(
         """--pytorch_dump_folder_path""",
         default="""hf_model""",
         type=str,
         help="""Path to the output PyTorch model directory.""",
     )
     parser.add_argument("""--save_model""", action="""store_true""", help="""Save model to local""")
     parser.add_argument("""--push_to_hub""", action="""store_true""", help="""Push model and image processor to the hub""")

     snake_case									=    parser.parse_args()
     convert_efficientnet_checkpoint(args.model_name, args.pytorch_dump_folder_path, args.save_model, args.push_to_hub)







'''simple docstring'''

import inspect
import unittest

import numpy as np

from transformers import ViTConfig, is_flax_available
from transformers.testing_utils import require_flax, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_flax_common import FlaxModelTesterMixin, floats_tensor


if is_flax_available():
     import jax

     from transformers.models.vit.modeling_flax_vit import FlaxViTForImageClassification, FlaxViTModel




class    lowerCAmelCase       (     unittest.TestCase  ):


 def __init__(    self  : Optional[Any]			,							a__  : List[Any]			,							a__  : Any=13			,							a__  : Optional[int]=30			,							a__  : List[Any]=2			,							a__  : Union[str, Any]=3			,							a__  : Tuple=True			,							a__  : Tuple=True			,							a__  : List[str]=32			,							a__  : Tuple=5			,							a__  : List[str]=4			,							a__  : str=37			,							a__  : Dict="gelu"			,							a__  : Union[str, Any]=0.1			,							a__  : Union[str, Any]=0.1			,							a__  : List[Any]=10			,							a__  : List[Any]=0.02			,							):
  '''simple docstring'''

  lowerCAmelCase__     :   Union[str, Any]     		=	parent
  lowerCAmelCase__     :   Union[str, Any]     		=	batch_size
  lowerCAmelCase__     :   List[Any]     		=	image_size
  lowerCAmelCase__     :   int     		=	patch_size
  lowerCAmelCase__     :   Tuple     		=	num_channels
  lowerCAmelCase__     :   List[str]     		=	is_training
  lowerCAmelCase__     :   str     		=	use_labels
  lowerCAmelCase__     :   Dict     		=	hidden_size
  lowerCAmelCase__     :   Any     		=	num_hidden_layers
  lowerCAmelCase__     :   Any     		=	num_attention_heads
  lowerCAmelCase__     :   Any     		=	intermediate_size
  lowerCAmelCase__     :   Union[str, Any]     		=	hidden_act
  lowerCAmelCase__     :   Optional[int]     		=	hidden_dropout_prob
  lowerCAmelCase__     :   str     		=	attention_probs_dropout_prob
  lowerCAmelCase__     :   Optional[int]     		=	type_sequence_label_size
  lowerCAmelCase__     :   List[str]     		=	initializer_range

  # in ViT, the seq length equals the number of patches + 1 (we add 1 for the [CLS] token)
  lowerCAmelCase__     :   Tuple     		=	(image_size // patch_size) ** 2
  lowerCAmelCase__     :   Dict     		=	num_patches + 1


 def    _A	(    self  : int    ):
  '''simple docstring'''

  lowerCAmelCase__     :   Dict     		=	floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]    )

  lowerCAmelCase__     :   Any     		=	ViTConfig(
      image_size=self.image_size			,							patch_size=self.patch_size			,							num_channels=self.num_channels			,							hidden_size=self.hidden_size			,							num_hidden_layers=self.num_hidden_layers			,							num_attention_heads=self.num_attention_heads			,							intermediate_size=self.intermediate_size			,							hidden_act=self.hidden_act			,							hidden_dropout_prob=self.hidden_dropout_prob			,							attention_probs_dropout_prob=self.attention_probs_dropout_prob			,							is_decoder=a__			,							initializer_range=self.initializer_range			,							)

  return config, pixel_values


 def    _A	(    self  : Optional[Any]			,							a__  : Optional[int]			,							a__  : Optional[Any]    ):
  '''simple docstring'''

  lowerCAmelCase__     :   List[str]     		=	FlaxViTModel(config=a__    )
  lowerCAmelCase__     :   Any     		=	model(a__    )
  # expected sequence length = num_patches + 1 (we add 1 for the [CLS] token)
  lowerCAmelCase__     :   List[str]     		=	(self.image_size, self.image_size)
  lowerCAmelCase__     :   List[str]     		=	(self.patch_size, self.patch_size)
  lowerCAmelCase__     :   int     		=	(image_size[1] // patch_size[1]) * (image_size[0] // patch_size[0])
  self.parent.assertEqual(result.last_hidden_state.shape			,							(self.batch_size, num_patches + 1, self.hidden_size)    )


 def    _A	(    self  : str			,							a__  : Optional[int]			,							a__  : Dict    ):
  '''simple docstring'''

  lowerCAmelCase__     :   Optional[Any]     		=	self.type_sequence_label_size
  lowerCAmelCase__     :   Any     		=	FlaxViTForImageClassification(config=a__    )
  lowerCAmelCase__     :   Dict     		=	model(a__    )
  self.parent.assertEqual(result.logits.shape			,							(self.batch_size, self.type_sequence_label_size)    )

  # test greyscale images
  lowerCAmelCase__     :   Tuple     		=	1
  lowerCAmelCase__     :   List[Any]     		=	FlaxViTForImageClassification(a__    )

  lowerCAmelCase__     :   Union[str, Any]     		=	floats_tensor([self.batch_size, 1, self.image_size, self.image_size]    )
  lowerCAmelCase__     :   int     		=	model(a__    )


 def    _A	(    self  : List[str]    ):
  '''simple docstring'''

  lowerCAmelCase__     :   str     		=	self.prepare_config_and_inputs()
  (
      (
      lowerCAmelCase__
  )		,     (
      lowerCAmelCase__
  )		,     
  )     :   Tuple     		=	config_and_inputs
  lowerCAmelCase__     :   Optional[Any]     		=	{"pixel_values": pixel_values}
  return config, inputs_dict




@require_flax
class    lowerCAmelCase       (     UpperCamelCase_    ,  unittest.TestCase  ):
 A_				:				Union[str, Any]	=			(FlaxViTModel, FlaxViTForImageClassification) if is_flax_available() else ()


 def    _A	(    self  : Any    ):
  '''simple docstring'''

  lowerCAmelCase__     :   Optional[Any]     		=	FlaxViTModelTester(self    )
  lowerCAmelCase__     :   Union[str, Any]     		=	ConfigTester(self			,							config_class=a__			,							has_text_modality=a__			,							hidden_size=37    )


 def    _A	(    self  : List[str]    ):
  '''simple docstring'''

  self.config_tester.run_common_tests()


 def    _A	(    self  : str    ):
  '''simple docstring'''

  lowerCAmelCase__     :   str     		=	self.model_tester.prepare_config_and_inputs()
  self.model_tester.create_and_check_model(*a__    )


 def    _A	(    self  : Optional[Any]    ):
  '''simple docstring'''

  lowerCAmelCase__     :   str     		=	self.model_tester.prepare_config_and_inputs()
  self.model_tester.create_and_check_for_image_classification(*a__    )


 def    _A	(    self  : Union[str, Any]    ):
  '''simple docstring'''

  lowerCAmelCase__		,     lowerCAmelCase__     :   List[Any]     		=	self.model_tester.prepare_config_and_inputs_for_common()

  for model_class in self.all_model_classes:
   lowerCAmelCase__     :   Dict     		=	model_class(a__    )
   lowerCAmelCase__     :   str     		=	inspect.signature(model.__call__    )
   # signature.parameters is an OrderedDict => so arg_names order is deterministic
   lowerCAmelCase__     :   List[Any]     		=	[*signature.parameters.keys()]

   lowerCAmelCase__     :   List[str]     		=	["pixel_values"]
   self.assertListEqual(arg_names[:1]			,							a__    )


 def    _A	(    self  : str    ):
  '''simple docstring'''

  lowerCAmelCase__		,     lowerCAmelCase__     :   int     		=	self.model_tester.prepare_config_and_inputs_for_common()

  for model_class in self.all_model_classes:
   with self.subTest(model_class.__name__    ):
    lowerCAmelCase__     :   List[Any]     		=	self._prepare_for_class(a__			,							a__    )
    lowerCAmelCase__     :   Optional[int]     		=	model_class(a__    )

    @jax.jit
    def model_jitted(a__  : Optional[int]			,							**a__  : Optional[Any]    ):
     return model(pixel_values=a__			,							**a__    )

    with self.subTest("JIT Enabled"    ):
     lowerCAmelCase__     :   Any     		=	model_jitted(**a__    ).to_tuple()

    with self.subTest("JIT Disabled"    ):
     with jax.disable_jit():
      lowerCAmelCase__     :   str     		=	model_jitted(**a__    ).to_tuple()

    self.assertEqual(len(a__    )			,							len(a__    )    )
    for jitted_output, output in zip(a__			,							a__    ):
     self.assertEqual(jitted_output.shape			,							output.shape    )


 @slow
 def    _A	(    self  : Any    ):
  '''simple docstring'''

  for model_class_name in self.all_model_classes:
   lowerCAmelCase__     :   Optional[Any]     		=	model_class_name.from_pretrained("google/vit-base-patch16-224"    )
   lowerCAmelCase__     :   Tuple     		=	model(np.ones((1, 3, 224, 224)    )    )
   self.assertIsNotNone(a__    )





