






'''simple docstring'''







import collections
import inspect
import unittest

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

from ...test_backbone_common import BackboneTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, _config_zero_init, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
			import torch
			from torch import nn

			from transformers import (
			    FocalNetBackbone,
			    FocalNetForImageClassification,
			    FocalNetForMaskedImageModeling,
			    FocalNetModel,
			)
			from transformers.models.focalnet.modeling_focalnet import FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST

if is_vision_available():
			from PIL import Image

			from transformers import AutoImageProcessor

class _lowercase			:




							def __init__(							self:       str    ,							UpperCamelCase__:       Tuple    ,							UpperCamelCase__:       List[str]=13    ,							UpperCamelCase__:       Optional[int]=32    ,							UpperCamelCase__:       Optional[int]=2    ,							UpperCamelCase__:       Dict=3    ,							UpperCamelCase__:       Optional[int]=16    ,							UpperCamelCase__:       List[Any]=[32, 64, 128]    ,							UpperCamelCase__:       str=[1, 2, 1]    ,							UpperCamelCase__:       List[Any]=[2, 2, 4]    ,							UpperCamelCase__:       List[Any]=2    ,							UpperCamelCase__:       Tuple=2.0    ,							UpperCamelCase__:       List[Any]=True    ,							UpperCamelCase__:       Union[str, Any]=0.0    ,							UpperCamelCase__:       List[Any]=0.0    ,							UpperCamelCase__:       Union[str, Any]=0.1    ,							UpperCamelCase__:       List[str]="gelu"    ,							UpperCamelCase__:       Dict=False    ,							UpperCamelCase__:       Optional[int]=True    ,							UpperCamelCase__:       List[Any]=0.02    ,							UpperCamelCase__:       str=1e-5    ,							UpperCamelCase__:       Any=True    ,							UpperCamelCase__:       List[str]=None    ,							UpperCamelCase__:       Union[str, Any]=True    ,							UpperCamelCase__:       List[str]=10    ,							UpperCamelCase__:       Union[str, Any]=8    ,							UpperCamelCase__:       List[str]=["stage1", "stage2"]    ,							UpperCamelCase__:       Union[str, Any]=[1, 2]    ,							):
														lowerCamelCase__      :			Tuple 						= parent
														lowerCamelCase__      :			Optional[int] 						= batch_size
														lowerCamelCase__      :			Dict 						= image_size
														lowerCamelCase__      :			Any 						= patch_size
														lowerCamelCase__      :			Dict 						= num_channels
														lowerCamelCase__      :			List[Any] 						= embed_dim
														lowerCamelCase__      :			List[str] 						= hidden_sizes
														lowerCamelCase__      :			Optional[Any] 						= depths
														lowerCamelCase__      :			Dict 						= num_heads
														lowerCamelCase__      :			Optional[Any] 						= window_size
														lowerCamelCase__      :			str 						= mlp_ratio
														lowerCamelCase__      :			Optional[Any] 						= qkv_bias
														lowerCamelCase__      :			Optional[int] 						= hidden_dropout_prob
														lowerCamelCase__      :			int 						= attention_probs_dropout_prob
														lowerCamelCase__      :			Union[str, Any] 						= drop_path_rate
														lowerCamelCase__      :			List[Any] 						= hidden_act
														lowerCamelCase__      :			List[Any] 						= use_absolute_embeddings
														lowerCamelCase__      :			Dict 						= patch_norm
														lowerCamelCase__      :			Union[str, Any] 						= layer_norm_eps
														lowerCamelCase__      :			Union[str, Any] 						= initializer_range
														lowerCamelCase__      :			List[str] 						= is_training
														lowerCamelCase__      :			Dict 						= scope
														lowerCamelCase__      :			List[Any] 						= use_labels
														lowerCamelCase__      :			List[str] 						= type_sequence_label_size
														lowerCamelCase__      :			List[Any] 						= encoder_stride
														lowerCamelCase__      :			Optional[int] 						= out_features
														lowerCamelCase__      :			Optional[int] 						= out_indices




							def 	lowerCamelCase_       (							self:       List[str]  ):
														lowerCamelCase__      :			Union[str, Any] 						= floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]  )

														lowerCamelCase__      :			Tuple 						= None
														if self.use_labels:
																					lowerCamelCase__      :			str 						= ids_tensor([self.batch_size]    ,							self.type_sequence_label_size  )

														lowerCamelCase__      :			str 						= self.get_config()

														return config, pixel_values, labels




							def 	lowerCamelCase_       (							self:       Any  ):
														return FocalNetConfig(
														    image_size=self.image_size    ,							patch_size=self.patch_size    ,							num_channels=self.num_channels    ,							embed_dim=self.embed_dim    ,							hidden_sizes=self.hidden_sizes    ,							depths=self.depths    ,							num_heads=self.num_heads    ,							window_size=self.window_size    ,							mlp_ratio=self.mlp_ratio    ,							qkv_bias=self.qkv_bias    ,							hidden_dropout_prob=self.hidden_dropout_prob    ,							attention_probs_dropout_prob=self.attention_probs_dropout_prob    ,							drop_path_rate=self.drop_path_rate    ,							hidden_act=self.hidden_act    ,							use_absolute_embeddings=self.use_absolute_embeddings    ,							path_norm=self.patch_norm    ,							layer_norm_eps=self.layer_norm_eps    ,							initializer_range=self.initializer_range    ,							encoder_stride=self.encoder_stride    ,							out_features=self.out_features    ,							out_indices=self.out_indices    ,							)




							def 	lowerCamelCase_       (							self:       List[str]    ,							UpperCamelCase__:       Optional[Any]    ,							UpperCamelCase__:       Dict    ,							UpperCamelCase__:       str  ):
														lowerCamelCase__      :			Any 						= FocalNetModel(config=UpperCamelCase__  )
														model.to(UpperCamelCase__  )
														model.eval()
														lowerCamelCase__      :			Optional[Any] 						= model(UpperCamelCase__  )

														lowerCamelCase__      :			int 						= ((config.image_size // config.patch_size) ** 2) // (4 ** (len(config.depths  ) - 1))
														lowerCamelCase__      :			Any 						= int(config.embed_dim * 2 ** (len(config.depths  ) - 1)  )

														self.parent.assertEqual(result.last_hidden_state.shape    ,							(self.batch_size, expected_seq_len, expected_dim)  )




							def 	lowerCamelCase_       (							self:       int    ,							UpperCamelCase__:       Optional[Any]    ,							UpperCamelCase__:       List[Any]    ,							UpperCamelCase__:       Tuple  ):
														lowerCamelCase__      :			int 						= FocalNetBackbone(config=UpperCamelCase__  )
														model.to(UpperCamelCase__  )
														model.eval()
														lowerCamelCase__      :			Tuple 						= model(UpperCamelCase__  )

														# verify feature maps
														self.parent.assertEqual(len(result.feature_maps  )    ,							len(config.out_features  )  )
														self.parent.assertListEqual(list(result.feature_maps[0].shape  )    ,							[self.batch_size, self.image_size, 8, 8]  )

														# verify channels
														self.parent.assertEqual(len(model.channels  )    ,							len(config.out_features  )  )
														self.parent.assertListEqual(model.channels    ,							config.hidden_sizes[:-1]  )

														# verify backbone works with out_features=None
														lowerCamelCase__      :			Union[str, Any] 						= None
														lowerCamelCase__      :			List[str] 						= FocalNetBackbone(config=UpperCamelCase__  )
														model.to(UpperCamelCase__  )
														model.eval()
														lowerCamelCase__      :			Tuple 						= model(UpperCamelCase__  )

														# verify feature maps
														self.parent.assertEqual(len(result.feature_maps  )    ,							1  )
														self.parent.assertListEqual(list(result.feature_maps[0].shape  )    ,							[self.batch_size, self.image_size * 2, 4, 4]  )

														# verify channels
														self.parent.assertEqual(len(model.channels  )    ,							1  )
														self.parent.assertListEqual(model.channels    ,							[config.hidden_sizes[-1]]  )




							def 	lowerCamelCase_       (							self:       Optional[Any]    ,							UpperCamelCase__:       List[str]    ,							UpperCamelCase__:       Tuple    ,							UpperCamelCase__:       Any  ):
														lowerCamelCase__      :			List[Any] 						= FocalNetForMaskedImageModeling(config=UpperCamelCase__  )
														model.to(UpperCamelCase__  )
														model.eval()
														lowerCamelCase__      :			Union[str, Any] 						= model(UpperCamelCase__  )
														self.parent.assertEqual(
														    result.reconstruction.shape    ,							(self.batch_size, self.num_channels, self.image_size, self.image_size)  )

														# test greyscale images
														lowerCamelCase__      :			Dict 						= 1
														lowerCamelCase__      :			Dict 						= FocalNetForMaskedImageModeling(UpperCamelCase__  )
														model.to(UpperCamelCase__  )
														model.eval()

														lowerCamelCase__      :			Optional[int] 						= floats_tensor([self.batch_size, 1, self.image_size, self.image_size]  )
														lowerCamelCase__      :			Any 						= model(UpperCamelCase__  )
														self.parent.assertEqual(result.reconstruction.shape    ,							(self.batch_size, 1, self.image_size, self.image_size)  )




							def 	lowerCamelCase_       (							self:       List[Any]    ,							UpperCamelCase__:       List[str]    ,							UpperCamelCase__:       Dict    ,							UpperCamelCase__:       Dict  ):
														lowerCamelCase__      :			List[str] 						= self.type_sequence_label_size
														lowerCamelCase__      :			int 						= FocalNetForImageClassification(UpperCamelCase__  )
														model.to(UpperCamelCase__  )
														model.eval()
														lowerCamelCase__      :			Union[str, Any] 						= model(UpperCamelCase__    ,							labels=UpperCamelCase__  )
														self.parent.assertEqual(result.logits.shape    ,							(self.batch_size, self.type_sequence_label_size)  )

														# test greyscale images
														lowerCamelCase__      :			Optional[Any] 						= 1
														lowerCamelCase__      :			Tuple 						= FocalNetForImageClassification(UpperCamelCase__  )
														model.to(UpperCamelCase__  )
														model.eval()

														lowerCamelCase__      :			Any 						= floats_tensor([self.batch_size, 1, self.image_size, self.image_size]  )
														lowerCamelCase__      :			List[str] 						= model(UpperCamelCase__  )
														self.parent.assertEqual(result.logits.shape    ,							(self.batch_size, self.type_sequence_label_size)  )




							def 	lowerCamelCase_       (							self:       Optional[int]  ):
														lowerCamelCase__      :			List[Any] 						= self.prepare_config_and_inputs()

														lowerCamelCase__						,	lowerCamelCase__						,	lowerCamelCase__      :			Optional[Any] 						= config_and_inputs
														lowerCamelCase__      :			Optional[int] 						= {"""pixel_values""": pixel_values}
														return config, inputs_dict



@require_torch
class _lowercase			(       _lowercase       ,   _lowercase       ,   unittest.TestCase	):
							a          = (
							    (
							        FocalNetModel,
							        FocalNetForImageClassification,
							        FocalNetForMaskedImageModeling,
							        FocalNetBackbone,
							    )
							    if is_torch_available()
							    else ()
							)
							a          = (
							    {"""feature-extraction""": FocalNetModel, """image-classification""": FocalNetForImageClassification}
							    if is_torch_available()
							    else {}
							)
							a          = False

							a          = False
							a          = False
							a          = False
							a          = False




							def 	lowerCamelCase_       (							self:       Tuple  ):
														lowerCamelCase__      :			Optional[Any] 						= FocalNetModelTester(self  )
														lowerCamelCase__      :			Union[str, Any] 						= ConfigTester(self    ,							config_class=UpperCamelCase__    ,							embed_dim=37    ,							has_text_modality=UpperCamelCase__  )




							def 	lowerCamelCase_       (							self:       Optional[int]  ):
														self.create_and_test_config_common_properties()
														self.config_tester.create_and_test_config_to_json_string()
														self.config_tester.create_and_test_config_to_json_file()
														self.config_tester.create_and_test_config_from_and_save_pretrained()
														self.config_tester.create_and_test_config_with_num_labels()
														self.config_tester.check_config_can_be_init_without_params()
														self.config_tester.check_config_arguments_init()




							def 	lowerCamelCase_       (							self:       str  ):
														return




							def 	lowerCamelCase_       (							self:       Dict  ):
														lowerCamelCase__      :			Union[str, Any] 						= self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_model(*UpperCamelCase__  )




							def 	lowerCamelCase_       (							self:       Union[str, Any]  ):
														lowerCamelCase__      :			Dict 						= self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_backbone(*UpperCamelCase__  )




							def 	lowerCamelCase_       (							self:       Tuple  ):
														lowerCamelCase__      :			str 						= self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_for_masked_image_modeling(*UpperCamelCase__  )




							def 	lowerCamelCase_       (							self:       Any  ):
														lowerCamelCase__      :			Any 						= self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_for_image_classification(*UpperCamelCase__  )




							@unittest.skip(reason="""FocalNet does not use inputs_embeds"""  )
							def 	lowerCamelCase_       (							self:       List[Any]  ):
														pass




							@unittest.skip(reason="""FocalNet does not use feedforward chunking"""  )
							def 	lowerCamelCase_       (							self:       List[str]  ):
														pass




							def 	lowerCamelCase_       (							self:       str  ):
														lowerCamelCase__						,	lowerCamelCase__      :			str 						= self.model_tester.prepare_config_and_inputs_for_common()

														for model_class in self.all_model_classes[:-1]:
																					lowerCamelCase__      :			Optional[Any] 						= model_class(UpperCamelCase__  )
																					self.assertIsInstance(model.get_input_embeddings()    ,							(nn.Module)  )
																					lowerCamelCase__      :			List[str] 						= model.get_output_embeddings()
																					self.assertTrue(x is None or isinstance(UpperCamelCase__    ,							nn.Linear  )  )




							def 	lowerCamelCase_       (							self:       Tuple  ):
														lowerCamelCase__						,	lowerCamelCase__      :			Optional[Any] 						= self.model_tester.prepare_config_and_inputs_for_common()

														for model_class in self.all_model_classes[:-1]:
																					lowerCamelCase__      :			List[str] 						= model_class(UpperCamelCase__  )
																					lowerCamelCase__      :			Union[str, Any] 						= inspect.signature(model.forward  )
																					# signature.parameters is an OrderedDict => so arg_names order is deterministic
																					lowerCamelCase__      :			List[str] 						= [*signature.parameters.keys()]

																					lowerCamelCase__      :			Optional[int] 						= ["""pixel_values"""]
																					self.assertListEqual(arg_names[:1]    ,							UpperCamelCase__  )




							def 	lowerCamelCase_       (							self:       Any    ,							UpperCamelCase__:       Dict    ,							UpperCamelCase__:       List[str]    ,							UpperCamelCase__:       Union[str, Any]    ,							UpperCamelCase__:       Any  ):
														lowerCamelCase__      :			Any 						= model_class(UpperCamelCase__  )
														model.to(UpperCamelCase__  )
														model.eval()

														with torch.no_grad():
																					lowerCamelCase__      :			Any 						= model(**self._prepare_for_class(UpperCamelCase__    ,							UpperCamelCase__  )  )

														lowerCamelCase__      :			str 						= outputs.hidden_states

														lowerCamelCase__      :			int 						= getattr(
														    self.model_tester    ,							"""expected_num_hidden_layers"""    ,							len(self.model_tester.depths  ) + 1  )
														self.assertEqual(len(UpperCamelCase__  )    ,							UpperCamelCase__  )

														# FocalNet has a different seq_length
														lowerCamelCase__      :			int 						= (
														    config.patch_size
														    if isinstance(config.patch_size    ,							collections.abc.Iterable  )
														    else (config.patch_size, config.patch_size)
														)

														lowerCamelCase__      :			List[Any] 						= (image_size[1] // patch_size[1]) * (image_size[0] // patch_size[0])

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

														lowerCamelCase__      :			List[str] 						= outputs.reshaped_hidden_states
														self.assertEqual(len(UpperCamelCase__  )    ,							UpperCamelCase__  )

														lowerCamelCase__						,	lowerCamelCase__						,	lowerCamelCase__						,	lowerCamelCase__      :			Tuple 						= reshaped_hidden_states[0].shape
														lowerCamelCase__      :			str 						= (
														    reshaped_hidden_states[0].view(UpperCamelCase__    ,							UpperCamelCase__    ,							height * width  ).permute(0    ,							2    ,							1  )
														)
														self.assertListEqual(
														    list(reshaped_hidden_states.shape[-2:]  )    ,							[num_patches, self.model_tester.embed_dim]    ,							)




							def 	lowerCamelCase_       (							self:       List[Any]  ):
														lowerCamelCase__						,	lowerCamelCase__      :			Optional[int] 						= self.model_tester.prepare_config_and_inputs_for_common()

														lowerCamelCase__      :			Optional[int] 						= (
														    self.model_tester.image_size
														    if isinstance(self.model_tester.image_size    ,							collections.abc.Iterable  )
														    else (self.model_tester.image_size, self.model_tester.image_size)
														)

														for model_class in self.all_model_classes[:-1]:
																					lowerCamelCase__      :			Any 						= True
																					self.check_hidden_states_output(UpperCamelCase__    ,							UpperCamelCase__    ,							UpperCamelCase__    ,							UpperCamelCase__  )

																					# check that output_hidden_states also work using config
																					del inputs_dict["output_hidden_states"]
																					lowerCamelCase__      :			Dict 						= True

																					self.check_hidden_states_output(UpperCamelCase__    ,							UpperCamelCase__    ,							UpperCamelCase__    ,							UpperCamelCase__  )




							def 	lowerCamelCase_       (							self:       Union[str, Any]  ):
														lowerCamelCase__						,	lowerCamelCase__      :			Dict 						= self.model_tester.prepare_config_and_inputs_for_common()
														lowerCamelCase__      :			Tuple 						= 3

														lowerCamelCase__      :			List[str] 						= (
														    self.model_tester.image_size
														    if isinstance(self.model_tester.image_size    ,							collections.abc.Iterable  )
														    else (self.model_tester.image_size, self.model_tester.image_size)
														)
														lowerCamelCase__      :			Tuple 						= (
														    config.patch_size
														    if isinstance(config.patch_size    ,							collections.abc.Iterable  )
														    else (config.patch_size, config.patch_size)
														)

														lowerCamelCase__      :			List[str] 						= image_size[0] + patch_size[0] - (image_size[0] % patch_size[0])
														lowerCamelCase__      :			Dict 						= image_size[1] + patch_size[1] - (image_size[1] % patch_size[1])

														for model_class in self.all_model_classes[:-1]:
																					lowerCamelCase__      :			Dict 						= True
																					self.check_hidden_states_output(UpperCamelCase__    ,							UpperCamelCase__    ,							UpperCamelCase__    ,							(padded_height, padded_width)  )

																					# check that output_hidden_states also work using config
																					del inputs_dict["output_hidden_states"]
																					lowerCamelCase__      :			List[str] 						= True
																					self.check_hidden_states_output(UpperCamelCase__    ,							UpperCamelCase__    ,							UpperCamelCase__    ,							(padded_height, padded_width)  )




							@slow
							def 	lowerCamelCase_       (							self:       Optional[Any]  ):
														for model_name in FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																					lowerCamelCase__      :			Any 						= FocalNetModel.from_pretrained(UpperCamelCase__  )
																					self.assertIsNotNone(UpperCamelCase__  )




							def 	lowerCamelCase_       (							self:       str  ):
														lowerCamelCase__						,	lowerCamelCase__      :			Optional[Any] 						= self.model_tester.prepare_config_and_inputs_for_common()

														lowerCamelCase__      :			List[Any] 						= _config_zero_init(UpperCamelCase__  )
														for model_class in self.all_model_classes:
																					lowerCamelCase__      :			List[str] 						= model_class(config=UpperCamelCase__  )
																					for name, param in model.named_parameters():
																												if "embeddings" not in name and param.requires_grad:
																																			self.assertIn(
																																			    ((param.data.mean() * 1e9).round() / 1e9).item()    ,							[0.0, 1.0]    ,							msg=F'''Parameter {name} of model {model_class} seems not properly initialized'''    ,							)



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




							@cached_property
							def 	lowerCamelCase_       (							self:       Any  ):
														# TODO update organization
														return AutoImageProcessor.from_pretrained("""microsoft/focalnet-tiny"""  ) if is_vision_available() else None




							@slow
							def 	lowerCamelCase_       (							self:       int  ):
														lowerCamelCase__      :			Tuple 						= FocalNetForImageClassification.from_pretrained("""microsoft/focalnet-tiny"""  ).to(UpperCamelCase__  )
														lowerCamelCase__      :			List[str] 						= self.default_image_processor

														lowerCamelCase__      :			List[Any] 						= Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png"""  )
														lowerCamelCase__      :			int 						= image_processor(images=UpperCamelCase__    ,							return_tensors="""pt"""  ).to(UpperCamelCase__  )

														# forward pass
														with torch.no_grad():
																					lowerCamelCase__      :			str 						= model(**UpperCamelCase__  )

														# verify the logits
														lowerCamelCase__      :			Optional[int] 						= torch.Size((1, 1_000)  )
														self.assertEqual(outputs.logits.shape    ,							UpperCamelCase__  )
														lowerCamelCase__      :			List[Any] 						= torch.tensor([0.2_166, -0.4_368, 0.2_191]  ).to(UpperCamelCase__  )
														self.assertTrue(torch.allclose(outputs.logits[0, :3]    ,							UpperCamelCase__    ,							atol=1e-4  )  )
														self.assertTrue(outputs.logits.argmax(dim=-1  ).item()    ,							281  )



@require_torch
class _lowercase			(       _lowercase       ,   unittest.TestCase	):
							a          = (FocalNetBackbone,) if is_torch_available() else ()
							a          = FocalNetConfig

							a          = False




							def 	lowerCamelCase_       (							self:       Tuple  ):
														lowerCamelCase__      :			Any 						= FocalNetModelTester(self  )









'''simple docstring'''







from ...configuration_utils import PretrainedConfig
from ...utils import logging


_A			:    Any					  =logging.get_logger(__name__)

_A			:    Dict					  ={
    '''microsoft/trocr-base-handwritten''': (
        '''https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json'''
    ),
    # See all TrOCR models at https://huggingface.co/models?filter=trocr
}

class _lowercase			(       _lowercase	):
							a          = """trocr"""
							a          = ["""past_key_values"""]
							a          = {
							    """num_attention_heads""": """decoder_attention_heads""",
							    """hidden_size""": """d_model""",
							    """num_hidden_layers""": """decoder_layers""",
							}




							def __init__(							self:       Optional[Any]    ,							UpperCamelCase__:       int=50_265    ,							UpperCamelCase__:       int=1_024    ,							UpperCamelCase__:       Optional[Any]=12    ,							UpperCamelCase__:       Dict=16    ,							UpperCamelCase__:       int=4_096    ,							UpperCamelCase__:       Tuple="gelu"    ,							UpperCamelCase__:       int=512    ,							UpperCamelCase__:       Dict=0.1    ,							UpperCamelCase__:       Tuple=0.0    ,							UpperCamelCase__:       str=0.0    ,							UpperCamelCase__:       Any=2    ,							UpperCamelCase__:       Dict=0.02    ,							UpperCamelCase__:       Optional[Any]=0.0    ,							UpperCamelCase__:       str=True    ,							UpperCamelCase__:       Tuple=False    ,							UpperCamelCase__:       Union[str, Any]=True    ,							UpperCamelCase__:       Tuple=True    ,							UpperCamelCase__:       Dict=1    ,							UpperCamelCase__:       List[str]=0    ,							UpperCamelCase__:       Union[str, Any]=2    ,							**UpperCamelCase__:       str    ,							):
														lowerCamelCase__      :			Any 						= vocab_size
														lowerCamelCase__      :			Tuple 						= d_model
														lowerCamelCase__      :			Any 						= decoder_layers
														lowerCamelCase__      :			Dict 						= decoder_attention_heads
														lowerCamelCase__      :			str 						= decoder_ffn_dim
														lowerCamelCase__      :			Tuple 						= activation_function
														lowerCamelCase__      :			Dict 						= max_position_embeddings
														lowerCamelCase__      :			int 						= dropout
														lowerCamelCase__      :			int 						= attention_dropout
														lowerCamelCase__      :			List[Any] 						= activation_dropout
														lowerCamelCase__      :			Union[str, Any] 						= init_std
														lowerCamelCase__      :			Optional[int] 						= decoder_layerdrop
														lowerCamelCase__      :			Dict 						= use_cache
														lowerCamelCase__      :			Any 						= scale_embedding
														lowerCamelCase__      :			Optional[int] 						= use_learned_position_embeddings
														lowerCamelCase__      :			List[str] 						= layernorm_embedding

														super().__init__(
														    pad_token_id=UpperCamelCase__    ,							bos_token_id=UpperCamelCase__    ,							eos_token_id=UpperCamelCase__    ,							decoder_start_token_id=UpperCamelCase__    ,							**UpperCamelCase__    ,							)

