


import unittest

from transformers import MarkupLMConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device
from transformers.utils import cached_property

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
		import torch

		from transformers import (
		    MarkupLMForQuestionAnswering,
		    MarkupLMForSequenceClassification,
		    MarkupLMForTokenClassification,
		    MarkupLMModel,
		)

# TODO check dependencies
from transformers import MarkupLMFeatureExtractor, MarkupLMProcessor, MarkupLMTokenizer

class 	__a   :
		def __init__(    self    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE=13    ,					_SCREAMING_SNAKE_CASE=7    ,					_SCREAMING_SNAKE_CASE=True    ,					_SCREAMING_SNAKE_CASE=True    ,					_SCREAMING_SNAKE_CASE=True    ,					_SCREAMING_SNAKE_CASE=True    ,					_SCREAMING_SNAKE_CASE=99    ,					_SCREAMING_SNAKE_CASE=32    ,					_SCREAMING_SNAKE_CASE=5    ,					_SCREAMING_SNAKE_CASE=4    ,					_SCREAMING_SNAKE_CASE=37    ,					_SCREAMING_SNAKE_CASE="gelu"    ,					_SCREAMING_SNAKE_CASE=0.1    ,					_SCREAMING_SNAKE_CASE=0.1    ,					_SCREAMING_SNAKE_CASE=512    ,					_SCREAMING_SNAKE_CASE=16    ,					_SCREAMING_SNAKE_CASE=2    ,					_SCREAMING_SNAKE_CASE=0.02    ,					_SCREAMING_SNAKE_CASE=3    ,					_SCREAMING_SNAKE_CASE=None    ,					_SCREAMING_SNAKE_CASE=20    ,					_SCREAMING_SNAKE_CASE=30    ,					_SCREAMING_SNAKE_CASE=2    ,					_SCREAMING_SNAKE_CASE=2    ,					_SCREAMING_SNAKE_CASE=10    ,					)				-> str:




									"""simple docstring"""





									_UpperCAmelCase					=    parent
									_UpperCAmelCase					=    batch_size
									_UpperCAmelCase					=    seq_length
									_UpperCAmelCase					=    is_training
									_UpperCAmelCase					=    use_input_mask
									_UpperCAmelCase					=    use_token_type_ids
									_UpperCAmelCase					=    use_labels
									_UpperCAmelCase					=    vocab_size
									_UpperCAmelCase					=    hidden_size
									_UpperCAmelCase					=    num_hidden_layers
									_UpperCAmelCase					=    num_attention_heads
									_UpperCAmelCase					=    intermediate_size
									_UpperCAmelCase					=    hidden_act
									_UpperCAmelCase					=    hidden_dropout_prob
									_UpperCAmelCase					=    attention_probs_dropout_prob
									_UpperCAmelCase					=    max_position_embeddings
									_UpperCAmelCase					=    type_vocab_size
									_UpperCAmelCase					=    type_sequence_label_size
									_UpperCAmelCase					=    initializer_range
									_UpperCAmelCase					=    num_labels
									_UpperCAmelCase					=    scope
									_UpperCAmelCase					=    max_xpath_tag_unit_embeddings
									_UpperCAmelCase					=    max_xpath_subs_unit_embeddings
									_UpperCAmelCase					=    tag_pad_id
									_UpperCAmelCase					=    subs_pad_id
									_UpperCAmelCase					=    max_depth
		def 			UpperCAmelCase__       (    self		)				-> Optional[Any]:




									"""simple docstring"""





									_UpperCAmelCase					=    ids_tensor([self.batch_size, self.seq_length]    ,					self.vocab_size		)

									_UpperCAmelCase					=    ids_tensor(
									    [self.batch_size, self.seq_length, self.max_depth]    ,					self.max_xpath_tag_unit_embeddings		)

									_UpperCAmelCase					=    ids_tensor(
									    [self.batch_size, self.seq_length, self.max_depth]    ,					self.max_xpath_subs_unit_embeddings		)

									_UpperCAmelCase					=    None
									if self.use_input_mask:
																_UpperCAmelCase					=    ids_tensor([self.batch_size, self.seq_length]    ,					vocab_size=2		)

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

									_UpperCAmelCase					=    None
									_UpperCAmelCase					=    None
									if self.use_labels:
																_UpperCAmelCase					=    ids_tensor([self.batch_size]    ,					self.type_sequence_label_size		)
																_UpperCAmelCase					=    ids_tensor([self.batch_size, self.seq_length]    ,					self.num_labels		)

									_UpperCAmelCase					=    self.get_config()

									return (
									    config,
									    input_ids,
									    xpath_tags_seq,
									    xpath_subs_seq,
									    token_type_ids,
									    input_mask,
									    sequence_labels,
									    token_labels,
									)
		def 			UpperCAmelCase__       (    self		)				-> List[str]:




									"""simple docstring"""





									return MarkupLMConfig(
									    vocab_size=self.vocab_size    ,					hidden_size=self.hidden_size    ,					num_hidden_layers=self.num_hidden_layers    ,					num_attention_heads=self.num_attention_heads    ,					intermediate_size=self.intermediate_size    ,					hidden_act=self.hidden_act    ,					hidden_dropout_prob=self.hidden_dropout_prob    ,					attention_probs_dropout_prob=self.attention_probs_dropout_prob    ,					max_position_embeddings=self.max_position_embeddings    ,					type_vocab_size=self.type_vocab_size    ,					initializer_range=self.initializer_range    ,					max_xpath_tag_unit_embeddings=self.max_xpath_tag_unit_embeddings    ,					max_xpath_subs_unit_embeddings=self.max_xpath_subs_unit_embeddings    ,					tag_pad_id=self.tag_pad_id    ,					subs_pad_id=self.subs_pad_id    ,					max_depth=self.max_depth    ,					)
		def 			UpperCAmelCase__       (    self    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					)				-> int:




									"""simple docstring"""





									_UpperCAmelCase					=    MarkupLMModel(config=_SCREAMING_SNAKE_CASE		)
									model.to(_SCREAMING_SNAKE_CASE		)
									model.eval()
									print('Configs:'    ,					model.config.tag_pad_id    ,					model.config.subs_pad_id		)
									_UpperCAmelCase					=    model(_SCREAMING_SNAKE_CASE    ,					attention_mask=_SCREAMING_SNAKE_CASE    ,					token_type_ids=_SCREAMING_SNAKE_CASE		)
									_UpperCAmelCase					=    model(_SCREAMING_SNAKE_CASE    ,					token_type_ids=_SCREAMING_SNAKE_CASE		)
									_UpperCAmelCase					=    model(_SCREAMING_SNAKE_CASE		)
									self.parent.assertEqual(result.last_hidden_state.shape    ,					(self.batch_size, self.seq_length, self.hidden_size)		)
									self.parent.assertEqual(result.pooler_output.shape    ,					(self.batch_size, self.hidden_size)		)
		def 			UpperCAmelCase__       (    self    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					)				-> List[str]:




									"""simple docstring"""





									_UpperCAmelCase					=    self.num_labels
									_UpperCAmelCase					=    MarkupLMForSequenceClassification(_SCREAMING_SNAKE_CASE		)
									model.to(_SCREAMING_SNAKE_CASE		)
									model.eval()
									_UpperCAmelCase					=    model(
									    _SCREAMING_SNAKE_CASE    ,					xpath_tags_seq=_SCREAMING_SNAKE_CASE    ,					xpath_subs_seq=_SCREAMING_SNAKE_CASE    ,					attention_mask=_SCREAMING_SNAKE_CASE    ,					token_type_ids=_SCREAMING_SNAKE_CASE    ,					labels=_SCREAMING_SNAKE_CASE    ,					)
									self.parent.assertEqual(result.logits.shape    ,					(self.batch_size, self.num_labels)		)
		def 			UpperCAmelCase__       (    self    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					)				-> int:




									"""simple docstring"""





									_UpperCAmelCase					=    self.num_labels
									_UpperCAmelCase					=    MarkupLMForTokenClassification(config=_SCREAMING_SNAKE_CASE		)
									model.to(_SCREAMING_SNAKE_CASE		)
									model.eval()
									_UpperCAmelCase					=    model(
									    _SCREAMING_SNAKE_CASE    ,					xpath_tags_seq=_SCREAMING_SNAKE_CASE    ,					xpath_subs_seq=_SCREAMING_SNAKE_CASE    ,					attention_mask=_SCREAMING_SNAKE_CASE    ,					token_type_ids=_SCREAMING_SNAKE_CASE    ,					labels=_SCREAMING_SNAKE_CASE    ,					)
									self.parent.assertEqual(result.logits.shape    ,					(self.batch_size, self.seq_length, self.num_labels)		)
		def 			UpperCAmelCase__       (    self    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					)				-> int:




									"""simple docstring"""





									_UpperCAmelCase					=    MarkupLMForQuestionAnswering(config=_SCREAMING_SNAKE_CASE		)
									model.to(_SCREAMING_SNAKE_CASE		)
									model.eval()
									_UpperCAmelCase					=    model(
									    _SCREAMING_SNAKE_CASE    ,					xpath_tags_seq=_SCREAMING_SNAKE_CASE    ,					xpath_subs_seq=_SCREAMING_SNAKE_CASE    ,					attention_mask=_SCREAMING_SNAKE_CASE    ,					token_type_ids=_SCREAMING_SNAKE_CASE    ,					start_positions=_SCREAMING_SNAKE_CASE    ,					end_positions=_SCREAMING_SNAKE_CASE    ,					)
									self.parent.assertEqual(result.start_logits.shape    ,					(self.batch_size, self.seq_length)		)
									self.parent.assertEqual(result.end_logits.shape    ,					(self.batch_size, self.seq_length)		)






		def 			UpperCAmelCase__       (    self		)				-> int:




									"""simple docstring"""





									_UpperCAmelCase					=    self.prepare_config_and_inputs()
									(
									    (
									    _UpperCAmelCase
									)	, (
									    _UpperCAmelCase
									)	, (
									    _UpperCAmelCase
									)	, (
									    _UpperCAmelCase
									)	, (
									    _UpperCAmelCase
									)	, (
									    _UpperCAmelCase
									)	, (
									    _UpperCAmelCase
									)	, (
									    _UpperCAmelCase
									)	, 
									)					=    config_and_inputs
									_UpperCAmelCase					=    {
									    'input_ids': input_ids,
									    'xpath_tags_seq': xpath_tags_seq,
									    'xpath_subs_seq': xpath_subs_seq,
									    'token_type_ids': token_type_ids,
									    'attention_mask': input_mask,
									}
									return config, inputs_dict



@require_torch
class 	__a   (       UpperCAmelCase					,   UpperCAmelCase					,   unittest.TestCase    ):
		_a			:						Tuple    			=			(
		    (
		        MarkupLMModel,
		        MarkupLMForSequenceClassification,
		        MarkupLMForTokenClassification,
		        MarkupLMForQuestionAnswering,
		    )
		    if is_torch_available()
		    else None
		)
		_a			:						Optional[Any]    			=			(
		    {
		        'feature-extraction': MarkupLMModel,
		        'question-answering': MarkupLMForQuestionAnswering,
		        'text-classification': MarkupLMForSequenceClassification,
		        'token-classification': MarkupLMForTokenClassification,
		        'zero-shot': MarkupLMForSequenceClassification,
		    }
		    if is_torch_available()
		    else {}
		)
		def 			UpperCAmelCase__       (    self    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE		)				-> int:




									"""simple docstring"""





									return True
		def 			UpperCAmelCase__       (    self		)				-> List[str]:




									"""simple docstring"""





									_UpperCAmelCase					=    MarkupLMModelTester(self		)
									_UpperCAmelCase					=    ConfigTester(self    ,					config_class=_SCREAMING_SNAKE_CASE    ,					hidden_size=37		)
		def 			UpperCAmelCase__       (    self		)				-> Dict:




									"""simple docstring"""





									self.config_tester.run_common_tests()
		def 			UpperCAmelCase__       (    self		)				-> int:




									"""simple docstring"""





									_UpperCAmelCase					=    self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_model(*_SCREAMING_SNAKE_CASE		)
		def 			UpperCAmelCase__       (    self		)				-> Dict:




									"""simple docstring"""





									_UpperCAmelCase					=    self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_sequence_classification(*_SCREAMING_SNAKE_CASE		)
		def 			UpperCAmelCase__       (    self		)				-> int:




									"""simple docstring"""





									_UpperCAmelCase					=    self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_token_classification(*_SCREAMING_SNAKE_CASE		)






		def 			UpperCAmelCase__       (    self		)				-> List[Any]:




									"""simple docstring"""





									_UpperCAmelCase					=    self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_for_question_answering(*_SCREAMING_SNAKE_CASE		)



def  lowerCAmelCase__				(    )						->	Any:


							'''simple docstring'''





							_UpperCAmelCase					=    '\n    <!DOCTYPE html>\n    <html>\n    <head>\n    <title>Page Title</title>\n    </head>\n    <body>\n\n    <h1>This is a Heading</h1>\n    <p>This is a paragraph.</p>\n\n    </body>\n    </html>\n    '

							return html_string







@require_torch
class 	__a   (       unittest.TestCase    ):
		@cached_property
		def 			UpperCAmelCase__       (    self		)				-> Dict:




									"""simple docstring"""





									_UpperCAmelCase					=    MarkupLMFeatureExtractor()
									_UpperCAmelCase					=    MarkupLMTokenizer.from_pretrained('microsoft/markuplm-base'		)

									return MarkupLMProcessor(_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE		)






		@slow
		def 			UpperCAmelCase__       (    self		)				-> List[str]:




									"""simple docstring"""





									_UpperCAmelCase					=    MarkupLMModel.from_pretrained('microsoft/markuplm-base'		).to(_SCREAMING_SNAKE_CASE		)

									_UpperCAmelCase					=    self.default_processor

									_UpperCAmelCase					=    processor(prepare_html_string()    ,					return_tensors='pt'		)
									_UpperCAmelCase					=    inputs.to(_SCREAMING_SNAKE_CASE		)

									# forward pass
									with torch.no_grad():
																_UpperCAmelCase					=    model(**_SCREAMING_SNAKE_CASE		)

									# verify the last hidden states
									_UpperCAmelCase					=    torch.Size([1, 14, 768]		)
									self.assertEqual(outputs.last_hidden_state.shape    ,					_SCREAMING_SNAKE_CASE		)

									_UpperCAmelCase					=    torch.tensor(
									    [[0.0675, -0.0052, 0.5001], [-0.2281, 0.0802, 0.2192], [-0.0583, -0.3311, 0.1185]]		).to(_SCREAMING_SNAKE_CASE		)

									self.assertTrue(torch.allclose(outputs.last_hidden_state[0, :3, :3]    ,					_SCREAMING_SNAKE_CASE    ,					atol=1e-4		)		)




import copy

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


lowerCAmelCase__						:int         =							logging.get_logger(__name__)

lowerCAmelCase__						:Optional[int]         =							{
    '''facebook/sam-vit-huge''': '''https://huggingface.co/facebook/sam-vit-huge/resolve/main/config.json''',
    '''facebook/sam-vit-large''': '''https://huggingface.co/facebook/sam-vit-large/resolve/main/config.json''',
    '''facebook/sam-vit-base''': '''https://huggingface.co/facebook/sam-vit-base/resolve/main/config.json''',
}

class 	__a   (       UpperCAmelCase    ):
		def __init__(    self    ,					_SCREAMING_SNAKE_CASE=256    ,					_SCREAMING_SNAKE_CASE=1024    ,					_SCREAMING_SNAKE_CASE=16    ,					_SCREAMING_SNAKE_CASE=16    ,					_SCREAMING_SNAKE_CASE=4    ,					_SCREAMING_SNAKE_CASE="gelu"    ,					_SCREAMING_SNAKE_CASE=1e-6    ,					**_SCREAMING_SNAKE_CASE    ,					)				-> Tuple:




									"""simple docstring"""





									super().__init__(**_SCREAMING_SNAKE_CASE		)
									_UpperCAmelCase					=    hidden_size
									_UpperCAmelCase					=    image_size
									_UpperCAmelCase					=    patch_size
									_UpperCAmelCase					=    image_size // patch_size
									_UpperCAmelCase					=    mask_input_channels
									_UpperCAmelCase					=    num_point_embeddings
									_UpperCAmelCase					=    hidden_act
									_UpperCAmelCase					=    layer_norm_eps



class 	__a   (       UpperCAmelCase    ):
		def __init__(    self    ,					_SCREAMING_SNAKE_CASE=256    ,					_SCREAMING_SNAKE_CASE="relu"    ,					_SCREAMING_SNAKE_CASE=2048    ,					_SCREAMING_SNAKE_CASE=2    ,					_SCREAMING_SNAKE_CASE=8    ,					_SCREAMING_SNAKE_CASE=2    ,					_SCREAMING_SNAKE_CASE=3    ,					_SCREAMING_SNAKE_CASE=3    ,					_SCREAMING_SNAKE_CASE=256    ,					_SCREAMING_SNAKE_CASE=1e-6    ,					**_SCREAMING_SNAKE_CASE    ,					)				-> List[Any]:




									"""simple docstring"""





									super().__init__(**_SCREAMING_SNAKE_CASE		)
									_UpperCAmelCase					=    hidden_size
									_UpperCAmelCase					=    hidden_act
									_UpperCAmelCase					=    mlp_dim
									_UpperCAmelCase					=    num_hidden_layers
									_UpperCAmelCase					=    num_attention_heads
									_UpperCAmelCase					=    attention_downsample_rate
									_UpperCAmelCase					=    num_multimask_outputs
									_UpperCAmelCase					=    iou_head_depth
									_UpperCAmelCase					=    iou_head_hidden_dim
									_UpperCAmelCase					=    layer_norm_eps



class 	__a   (       UpperCAmelCase    ):
		def __init__(    self    ,					_SCREAMING_SNAKE_CASE=768    ,					_SCREAMING_SNAKE_CASE=256    ,					_SCREAMING_SNAKE_CASE=12    ,					_SCREAMING_SNAKE_CASE=12    ,					_SCREAMING_SNAKE_CASE=3    ,					_SCREAMING_SNAKE_CASE=1024    ,					_SCREAMING_SNAKE_CASE=16    ,					_SCREAMING_SNAKE_CASE="gelu"    ,					_SCREAMING_SNAKE_CASE=1e-0_6    ,					_SCREAMING_SNAKE_CASE=0.0    ,					_SCREAMING_SNAKE_CASE=1e-1_0    ,					_SCREAMING_SNAKE_CASE=True    ,					_SCREAMING_SNAKE_CASE=4.0    ,					_SCREAMING_SNAKE_CASE=True    ,					_SCREAMING_SNAKE_CASE=True    ,					_SCREAMING_SNAKE_CASE=14    ,					_SCREAMING_SNAKE_CASE=[2, 5, 8, 11]    ,					_SCREAMING_SNAKE_CASE=128    ,					_SCREAMING_SNAKE_CASE=None    ,					**_SCREAMING_SNAKE_CASE    ,					)				-> List[str]:




									"""simple docstring"""





									super().__init__(**_SCREAMING_SNAKE_CASE		)

									_UpperCAmelCase					=    hidden_size
									_UpperCAmelCase					=    output_channels
									_UpperCAmelCase					=    num_hidden_layers
									_UpperCAmelCase					=    num_attention_heads
									_UpperCAmelCase					=    num_channels
									_UpperCAmelCase					=    image_size
									_UpperCAmelCase					=    patch_size
									_UpperCAmelCase					=    hidden_act
									_UpperCAmelCase					=    layer_norm_eps
									_UpperCAmelCase					=    attention_dropout
									_UpperCAmelCase					=    initializer_range
									_UpperCAmelCase					=    qkv_bias
									_UpperCAmelCase					=    mlp_ratio
									_UpperCAmelCase					=    use_abs_pos
									_UpperCAmelCase					=    use_rel_pos
									_UpperCAmelCase					=    window_size
									_UpperCAmelCase					=    global_attn_indexes
									_UpperCAmelCase					=    num_pos_feats
									_UpperCAmelCase					=    int(hidden_size * mlp_ratio		) if mlp_dim is None else mlp_dim



class 	__a   (       UpperCAmelCase    ):
		_a			:						Any    			=			'sam'
		_a			:						Any    			=			True
		def __init__(    self    ,					_SCREAMING_SNAKE_CASE=None    ,					_SCREAMING_SNAKE_CASE=None    ,					_SCREAMING_SNAKE_CASE=None    ,					_SCREAMING_SNAKE_CASE=0.02    ,					**_SCREAMING_SNAKE_CASE    ,					)				-> Tuple:




									"""simple docstring"""





									super().__init__(**_SCREAMING_SNAKE_CASE		)
									_UpperCAmelCase					=    vision_config if vision_config is not None else {}
									_UpperCAmelCase					=    prompt_encoder_config if prompt_encoder_config is not None else {}
									_UpperCAmelCase					=    mask_decoder_config if mask_decoder_config is not None else {}

									if isinstance(_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE		):
																_UpperCAmelCase					=    vision_config.to_dict()
									if isinstance(_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE		):
																_UpperCAmelCase					=    prompt_encoder_config.to_dict()
									if isinstance(_SCREAMING_SNAKE_CASE    ,					_SCREAMING_SNAKE_CASE		):
																_UpperCAmelCase					=    mask_decoder_config.to_dict()

									_UpperCAmelCase					=    SamVisionConfig(**_SCREAMING_SNAKE_CASE		)
									_UpperCAmelCase					=    SamPromptEncoderConfig(**_SCREAMING_SNAKE_CASE		)
									_UpperCAmelCase					=    SamMaskDecoderConfig(**_SCREAMING_SNAKE_CASE		)
									_UpperCAmelCase					=    initializer_range






		def 			UpperCAmelCase__       (    self		)				-> str:




									"""simple docstring"""





									_UpperCAmelCase					=    copy.deepcopy(self.__dict__		)
									_UpperCAmelCase					=    self.vision_config.to_dict()
									_UpperCAmelCase					=    self.prompt_encoder_config.to_dict()
									_UpperCAmelCase					=    self.mask_decoder_config.to_dict()
									_UpperCAmelCase					=    self.__class__.model_type
									return output
