



'''simple docstring'''

import unittest

from transformers import (
    MODEL_FOR_OBJECT_DETECTION_MAPPING,
    AutoFeatureExtractor,
    AutoModelForObjectDetection,
    ObjectDetectionPipeline,
    is_vision_available,
    pipeline,
)
from transformers.testing_utils import (
    is_pipeline_test,
    nested_simplify,
    require_pytesseract,
    require_tf,
    require_timm,
    require_torch,
    require_vision,
    slow,
)

from .test_pipelines_common import ANY


if is_vision_available():
  from PIL import Image
else:



  class 		lowerCamelCase__      :




       '''simple docstring'''



       @staticmethod
       def 						__UpperCAmelCase     (  *UpperCamelCase_				:	Union[str, Any]     ,  **UpperCamelCase_				:	Optional[int]					)  ->       Tuple:



        '''simple docstring'''





        pass



@is_pipeline_test
@require_vision
@require_timm
@require_torch
class 		lowerCamelCase__      (						unittest.TestCase     ):




     '''simple docstring'''



     A_						    =						MODEL_FOR_OBJECT_DETECTION_MAPPING




     def 						__UpperCAmelCase     (  self				:	Optional[int]     ,  UpperCamelCase_				:	Optional[int]     ,  UpperCamelCase_				:	Any     ,  UpperCamelCase_				:	Union[str, Any]					)  ->       Union[str, Any]:



      '''simple docstring'''





      _lowercase					:       Tuple       =		ObjectDetectionPipeline(model=_SCREAMING_SNAKE_CASE     ,  image_processor=_SCREAMING_SNAKE_CASE					)
      return object_detector, ["./tests/fixtures/tests_samples/COCO/000000039769.png"]




     def 						__UpperCAmelCase     (  self				:	Any     ,  UpperCamelCase_				:	List[Any]     ,  UpperCamelCase_				:	List[str]					)  ->       Any:



      '''simple docstring'''





      _lowercase					:       int       =		object_detector('./tests/fixtures/tests_samples/COCO/000000039769.png'     ,  threshold=0.0					)

      self.assertGreater(len(_SCREAMING_SNAKE_CASE					)     ,  0					)
      for detected_object in outputs:
       self.assertEqual(
           _SCREAMING_SNAKE_CASE     ,  {
               'score': ANY(_SCREAMING_SNAKE_CASE					),
               'label': ANY(_SCREAMING_SNAKE_CASE					),
               'box': {'xmin': ANY(_SCREAMING_SNAKE_CASE					), 'ymin': ANY(_SCREAMING_SNAKE_CASE					), 'xmax': ANY(_SCREAMING_SNAKE_CASE					), 'ymax': ANY(_SCREAMING_SNAKE_CASE					)},
           }     ,  )

      import datasets

      _lowercase					:       str       =		datasets.load_dataset('hf-internal-testing/fixtures_image_utils'     ,  'image'     ,  split='test'					)

      _lowercase					:       Any       =		[
          Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png'					),
          'http://images.cocodataset.org/val2017/000000039769.jpg',
          # RGBA
          dataset[0]['file'],
          # LA
          dataset[1]['file'],
          # L
          dataset[2]['file'],
      ]
      _lowercase					:       Any       =		object_detector(_SCREAMING_SNAKE_CASE     ,  threshold=0.0					)

      self.assertEqual(len(_SCREAMING_SNAKE_CASE					)     ,  len(_SCREAMING_SNAKE_CASE					)					)
      for outputs in batch_outputs:
       self.assertGreater(len(_SCREAMING_SNAKE_CASE					)     ,  0					)
       for detected_object in outputs:
        self.assertEqual(
            _SCREAMING_SNAKE_CASE     ,  {
                'score': ANY(_SCREAMING_SNAKE_CASE					),
                'label': ANY(_SCREAMING_SNAKE_CASE					),
                'box': {'xmin': ANY(_SCREAMING_SNAKE_CASE					), 'ymin': ANY(_SCREAMING_SNAKE_CASE					), 'xmax': ANY(_SCREAMING_SNAKE_CASE					), 'ymax': ANY(_SCREAMING_SNAKE_CASE					)},
            }     ,  )




     @require_tf
     @unittest.skip('Object detection not implemented in TF'					)
     def 						__UpperCAmelCase     (  self				:	int					)  ->       int:



      '''simple docstring'''





      pass




     @require_torch
     def 						__UpperCAmelCase     (  self				:	str					)  ->       List[str]:



      '''simple docstring'''





      _lowercase					:       List[str]       =		'hf-internal-testing/tiny-detr-mobilenetsv3'

      _lowercase					:       Dict       =		AutoModelForObjectDetection.from_pretrained(_SCREAMING_SNAKE_CASE					)
      _lowercase					:       Tuple       =		AutoFeatureExtractor.from_pretrained(_SCREAMING_SNAKE_CASE					)
      _lowercase					:       Any       =		ObjectDetectionPipeline(model=_SCREAMING_SNAKE_CASE     ,  feature_extractor=_SCREAMING_SNAKE_CASE					)

      _lowercase					:       List[str]       =		object_detector('http://images.cocodataset.org/val2017/000000039769.jpg'     ,  threshold=0.0					)

      self.assertEqual(
          nested_simplify(_SCREAMING_SNAKE_CASE     ,  decimals=4					)     ,  [
              {'score': 0.33_76, 'label': 'LABEL_0', 'box': {'xmin': 159, 'ymin': 120, 'xmax': 480, 'ymax': 359}},
              {'score': 0.33_76, 'label': 'LABEL_0', 'box': {'xmin': 159, 'ymin': 120, 'xmax': 480, 'ymax': 359}},
          ]     ,  )

      _lowercase					:       int       =		object_detector(
          [
              'http://images.cocodataset.org/val2017/000000039769.jpg',
              'http://images.cocodataset.org/val2017/000000039769.jpg',
          ]     ,  threshold=0.0     ,  )

      self.assertEqual(
          nested_simplify(_SCREAMING_SNAKE_CASE     ,  decimals=4					)     ,  [
              [
                  {'score': 0.33_76, 'label': 'LABEL_0', 'box': {'xmin': 159, 'ymin': 120, 'xmax': 480, 'ymax': 359}},
                  {'score': 0.33_76, 'label': 'LABEL_0', 'box': {'xmin': 159, 'ymin': 120, 'xmax': 480, 'ymax': 359}},
              ],
              [
                  {'score': 0.33_76, 'label': 'LABEL_0', 'box': {'xmin': 159, 'ymin': 120, 'xmax': 480, 'ymax': 359}},
                  {'score': 0.33_76, 'label': 'LABEL_0', 'box': {'xmin': 159, 'ymin': 120, 'xmax': 480, 'ymax': 359}},
              ],
          ]     ,  )




     @require_torch
     @slow
     def 						__UpperCAmelCase     (  self				:	int					)  ->       List[str]:



      '''simple docstring'''





      _lowercase					:       Union[str, Any]       =		'facebook/detr-resnet-50'

      _lowercase					:       Optional[int]       =		AutoModelForObjectDetection.from_pretrained(_SCREAMING_SNAKE_CASE					)
      _lowercase					:       Optional[Any]       =		AutoFeatureExtractor.from_pretrained(_SCREAMING_SNAKE_CASE					)
      _lowercase					:       Union[str, Any]       =		ObjectDetectionPipeline(model=_SCREAMING_SNAKE_CASE     ,  feature_extractor=_SCREAMING_SNAKE_CASE					)

      _lowercase					:       str       =		object_detector('http://images.cocodataset.org/val2017/000000039769.jpg'					)
      self.assertEqual(
          nested_simplify(_SCREAMING_SNAKE_CASE     ,  decimals=4					)     ,  [
              {'score': 0.99_82, 'label': 'remote', 'box': {'xmin': 40, 'ymin': 70, 'xmax': 175, 'ymax': 117}},
              {'score': 0.99_60, 'label': 'remote', 'box': {'xmin': 333, 'ymin': 72, 'xmax': 368, 'ymax': 187}},
              {'score': 0.99_55, 'label': 'couch', 'box': {'xmin': 0, 'ymin': 1, 'xmax': 639, 'ymax': 473}},
              {'score': 0.99_88, 'label': 'cat', 'box': {'xmin': 13, 'ymin': 52, 'xmax': 314, 'ymax': 470}},
              {'score': 0.99_87, 'label': 'cat', 'box': {'xmin': 345, 'ymin': 23, 'xmax': 640, 'ymax': 368}},
          ]     ,  )

      _lowercase					:       str       =		object_detector(
          [
              'http://images.cocodataset.org/val2017/000000039769.jpg',
              'http://images.cocodataset.org/val2017/000000039769.jpg',
          ]					)
      self.assertEqual(
          nested_simplify(_SCREAMING_SNAKE_CASE     ,  decimals=4					)     ,  [
              [
                  {'score': 0.99_82, 'label': 'remote', 'box': {'xmin': 40, 'ymin': 70, 'xmax': 175, 'ymax': 117}},
                  {'score': 0.99_60, 'label': 'remote', 'box': {'xmin': 333, 'ymin': 72, 'xmax': 368, 'ymax': 187}},
                  {'score': 0.99_55, 'label': 'couch', 'box': {'xmin': 0, 'ymin': 1, 'xmax': 639, 'ymax': 473}},
                  {'score': 0.99_88, 'label': 'cat', 'box': {'xmin': 13, 'ymin': 52, 'xmax': 314, 'ymax': 470}},
                  {'score': 0.99_87, 'label': 'cat', 'box': {'xmin': 345, 'ymin': 23, 'xmax': 640, 'ymax': 368}},
              ],
              [
                  {'score': 0.99_82, 'label': 'remote', 'box': {'xmin': 40, 'ymin': 70, 'xmax': 175, 'ymax': 117}},
                  {'score': 0.99_60, 'label': 'remote', 'box': {'xmin': 333, 'ymin': 72, 'xmax': 368, 'ymax': 187}},
                  {'score': 0.99_55, 'label': 'couch', 'box': {'xmin': 0, 'ymin': 1, 'xmax': 639, 'ymax': 473}},
                  {'score': 0.99_88, 'label': 'cat', 'box': {'xmin': 13, 'ymin': 52, 'xmax': 314, 'ymax': 470}},
                  {'score': 0.99_87, 'label': 'cat', 'box': {'xmin': 345, 'ymin': 23, 'xmax': 640, 'ymax': 368}},
              ],
          ]     ,  )




     @require_torch
     @slow
     def 						__UpperCAmelCase     (  self				:	Union[str, Any]					)  ->       Optional[Any]:



      '''simple docstring'''





      _lowercase					:       Dict       =		'facebook/detr-resnet-50'

      _lowercase					:       List[str]       =		pipeline('object-detection'     ,  model=_SCREAMING_SNAKE_CASE					)

      _lowercase					:       Dict       =		object_detector('http://images.cocodataset.org/val2017/000000039769.jpg'					)
      self.assertEqual(
          nested_simplify(_SCREAMING_SNAKE_CASE     ,  decimals=4					)     ,  [
              {'score': 0.99_82, 'label': 'remote', 'box': {'xmin': 40, 'ymin': 70, 'xmax': 175, 'ymax': 117}},
              {'score': 0.99_60, 'label': 'remote', 'box': {'xmin': 333, 'ymin': 72, 'xmax': 368, 'ymax': 187}},
              {'score': 0.99_55, 'label': 'couch', 'box': {'xmin': 0, 'ymin': 1, 'xmax': 639, 'ymax': 473}},
              {'score': 0.99_88, 'label': 'cat', 'box': {'xmin': 13, 'ymin': 52, 'xmax': 314, 'ymax': 470}},
              {'score': 0.99_87, 'label': 'cat', 'box': {'xmin': 345, 'ymin': 23, 'xmax': 640, 'ymax': 368}},
          ]     ,  )

      _lowercase					:       List[Any]       =		object_detector(
          [
              'http://images.cocodataset.org/val2017/000000039769.jpg',
              'http://images.cocodataset.org/val2017/000000039769.jpg',
          ]					)
      self.assertEqual(
          nested_simplify(_SCREAMING_SNAKE_CASE     ,  decimals=4					)     ,  [
              [
                  {'score': 0.99_82, 'label': 'remote', 'box': {'xmin': 40, 'ymin': 70, 'xmax': 175, 'ymax': 117}},
                  {'score': 0.99_60, 'label': 'remote', 'box': {'xmin': 333, 'ymin': 72, 'xmax': 368, 'ymax': 187}},
                  {'score': 0.99_55, 'label': 'couch', 'box': {'xmin': 0, 'ymin': 1, 'xmax': 639, 'ymax': 473}},
                  {'score': 0.99_88, 'label': 'cat', 'box': {'xmin': 13, 'ymin': 52, 'xmax': 314, 'ymax': 470}},
                  {'score': 0.99_87, 'label': 'cat', 'box': {'xmin': 345, 'ymin': 23, 'xmax': 640, 'ymax': 368}},
              ],
              [
                  {'score': 0.99_82, 'label': 'remote', 'box': {'xmin': 40, 'ymin': 70, 'xmax': 175, 'ymax': 117}},
                  {'score': 0.99_60, 'label': 'remote', 'box': {'xmin': 333, 'ymin': 72, 'xmax': 368, 'ymax': 187}},
                  {'score': 0.99_55, 'label': 'couch', 'box': {'xmin': 0, 'ymin': 1, 'xmax': 639, 'ymax': 473}},
                  {'score': 0.99_88, 'label': 'cat', 'box': {'xmin': 13, 'ymin': 52, 'xmax': 314, 'ymax': 470}},
                  {'score': 0.99_87, 'label': 'cat', 'box': {'xmin': 345, 'ymin': 23, 'xmax': 640, 'ymax': 368}},
              ],
          ]     ,  )




     @require_torch
     @slow
     def 						__UpperCAmelCase     (  self				:	Union[str, Any]					)  ->       int:



      '''simple docstring'''





      _lowercase					:       str       =		0.99_85
      _lowercase					:       List[str]       =		'facebook/detr-resnet-50'

      _lowercase					:       List[str]       =		pipeline('object-detection'     ,  model=_SCREAMING_SNAKE_CASE					)

      _lowercase					:       List[Any]       =		object_detector('http://images.cocodataset.org/val2017/000000039769.jpg'     ,  threshold=_SCREAMING_SNAKE_CASE					)
      self.assertEqual(
          nested_simplify(_SCREAMING_SNAKE_CASE     ,  decimals=4					)     ,  [
              {'score': 0.99_88, 'label': 'cat', 'box': {'xmin': 13, 'ymin': 52, 'xmax': 314, 'ymax': 470}},
              {'score': 0.99_87, 'label': 'cat', 'box': {'xmin': 345, 'ymin': 23, 'xmax': 640, 'ymax': 368}},
          ]     ,  )




     @require_torch
     @require_pytesseract
     @slow
     def 						__UpperCAmelCase     (  self				:	Any					)  ->       Optional[int]:



      '''simple docstring'''





      _lowercase					:       int       =		'Narsil/layoutlmv3-finetuned-funsd'
      _lowercase					:       List[Any]       =		0.99_93

      _lowercase					:       Union[str, Any]       =		pipeline('object-detection'     ,  model=_SCREAMING_SNAKE_CASE     ,  threshold=_SCREAMING_SNAKE_CASE					)

      _lowercase					:       Optional[int]       =		object_detector(
          'https://huggingface.co/spaces/impira/docquery/resolve/2359223c1837a7587402bda0f2643382a6eefeab/invoice.png'					)
      self.assertEqual(
          nested_simplify(_SCREAMING_SNAKE_CASE     ,  decimals=4					)     ,  [
              {'score': 0.99_93, 'label': 'I-ANSWER', 'box': {'xmin': 294, 'ymin': 254, 'xmax': 343, 'ymax': 264}},
              {'score': 0.99_93, 'label': 'I-ANSWER', 'box': {'xmin': 294, 'ymin': 254, 'xmax': 343, 'ymax': 264}},
          ]     ,  )





'''simple docstring'''

import copy
import os
from typing import Union

from ...configuration_utils import PretrainedConfig
from ...models.auto.modeling_auto import MODEL_FOR_CAUSAL_LM_MAPPING_NAMES
from ...utils import logging
from ..auto import CONFIG_MAPPING


_A				:    int     						=logging.get_logger(__name__)

_A				:    Union[str, Any]     						={
    '''Salesforce/instruct-blip-flan-t5''': '''https://huggingface.co/Salesforce/instruct-blip-flan-t5/resolve/main/config.json''',
}



class 		lowerCamelCase__      (						A     ):




					'''simple docstring'''



					A_						    =						"""instructblip_vision_model"""




					def __init__(  self				:	Union[str, Any]     ,  UpperCamelCase_				:	str=1408     ,  UpperCamelCase_				:	Tuple=6144     ,  UpperCamelCase_				:	Union[str, Any]=39     ,  UpperCamelCase_				:	Optional[Any]=16     ,  UpperCamelCase_				:	str=224     ,  UpperCamelCase_				:	Dict=14     ,  UpperCamelCase_				:	Dict="gelu"     ,  UpperCamelCase_				:	int=1E-6     ,  UpperCamelCase_				:	int=0.0     ,  UpperCamelCase_				:	List[str]=1E-10     ,  UpperCamelCase_				:	str=True     ,  **UpperCamelCase_				:	Dict     ,  )  ->       Any:



						'''simple docstring'''





						super().__init__(**UpperCamelCase_					)

						_lowercase					:       Optional[Any]       =		hidden_size
						_lowercase					:       Optional[Any]       =		intermediate_size
						_lowercase					:       Optional[int]       =		num_hidden_layers
						_lowercase					:       str       =		num_attention_heads
						_lowercase					:       Tuple       =		patch_size
						_lowercase					:       Dict       =		image_size
						_lowercase					:       Optional[int]       =		initializer_range
						_lowercase					:       List[Any]       =		attention_dropout
						_lowercase					:       int       =		layer_norm_eps
						_lowercase					:       Optional[int]       =		hidden_act
						_lowercase					:       str       =		qkv_bias




					@classmethod
					def 						__UpperCAmelCase     (  cls				:	List[Any]     ,  UpperCamelCase_				:	Union[str, os.PathLike]     ,  **UpperCamelCase_				:	List[str]					)  ->       "PretrainedConfig":



						'''simple docstring'''





						cls._set_token_in_kwargs(UpperCamelCase_					)

						_lowercase  ,    _lowercase					:       Tuple       =		cls.get_config_dict(UpperCamelCase_     ,  **UpperCamelCase_					)

						# get the vision config dict if we are loading from InstructBlipConfig
						if config_dict.get('model_type'					) == "instructblip":
							_lowercase					:       Any       =		config_dict['vision_config']

						if "model_type" in config_dict and hasattr(cls     ,  'model_type'					) and config_dict["model_type"] != cls.model_type:
							logger.warning(
							    F'''You are using a model of type {config_dict["model_type"]} to instantiate a model of type '''
							    F'''{cls.model_type}. This is not supported for all configurations of models and can yield errors.'''					)

						return cls.from_dict(UpperCamelCase_     ,  **UpperCamelCase_					)






class 		lowerCamelCase__      (						A     ):




					'''simple docstring'''



					A_						    =						"""instructblip_qformer"""




					def __init__(  self				:	Tuple     ,  UpperCamelCase_				:	Union[str, Any]=3_0522     ,  UpperCamelCase_				:	Union[str, Any]=768     ,  UpperCamelCase_				:	Tuple=12     ,  UpperCamelCase_				:	Optional[Any]=12     ,  UpperCamelCase_				:	List[str]=3072     ,  UpperCamelCase_				:	List[str]="gelu"     ,  UpperCamelCase_				:	Union[str, Any]=0.1     ,  UpperCamelCase_				:	List[str]=0.1     ,  UpperCamelCase_				:	Any=512     ,  UpperCamelCase_				:	Union[str, Any]=0.02     ,  UpperCamelCase_				:	List[Any]=1E-12     ,  UpperCamelCase_				:	Optional[Any]=0     ,  UpperCamelCase_				:	str="absolute"     ,  UpperCamelCase_				:	List[Any]=2     ,  UpperCamelCase_				:	Any=1408     ,  **UpperCamelCase_				:	Dict     ,  )  ->       Any:



						'''simple docstring'''





						super().__init__(pad_token_id=UpperCamelCase_     ,  **UpperCamelCase_					)

						_lowercase					:       Dict       =		vocab_size
						_lowercase					:       Optional[Any]       =		hidden_size
						_lowercase					:       Any       =		num_hidden_layers
						_lowercase					:       List[Any]       =		num_attention_heads
						_lowercase					:       Optional[int]       =		hidden_act
						_lowercase					:       Union[str, Any]       =		intermediate_size
						_lowercase					:       List[Any]       =		hidden_dropout_prob
						_lowercase					:       Dict       =		attention_probs_dropout_prob
						_lowercase					:       Any       =		max_position_embeddings
						_lowercase					:       Optional[int]       =		initializer_range
						_lowercase					:       Tuple       =		layer_norm_eps
						_lowercase					:       List[str]       =		position_embedding_type
						_lowercase					:       str       =		cross_attention_frequency
						_lowercase					:       int       =		encoder_hidden_size




					@classmethod
					def 						__UpperCAmelCase     (  cls				:	List[Any]     ,  UpperCamelCase_				:	Union[str, os.PathLike]     ,  **UpperCamelCase_				:	List[str]					)  ->       "PretrainedConfig":



						'''simple docstring'''





						cls._set_token_in_kwargs(UpperCamelCase_					)

						_lowercase  ,    _lowercase					:       List[str]       =		cls.get_config_dict(UpperCamelCase_     ,  **UpperCamelCase_					)

						# get the qformer config dict if we are loading from InstructBlipConfig
						if config_dict.get('model_type'					) == "instructblip":
							_lowercase					:       Optional[int]       =		config_dict['qformer_config']

						if "model_type" in config_dict and hasattr(cls     ,  'model_type'					) and config_dict["model_type"] != cls.model_type:
							logger.warning(
							    F'''You are using a model of type {config_dict["model_type"]} to instantiate a model of type '''
							    F'''{cls.model_type}. This is not supported for all configurations of models and can yield errors.'''					)

						return cls.from_dict(UpperCamelCase_     ,  **UpperCamelCase_					)






class 		lowerCamelCase__      (						A     ):




					'''simple docstring'''



					A_						    =						"""instructblip"""
					A_						    =						True




					def __init__(  self				:	Any     ,  UpperCamelCase_				:	List[Any]=None     ,  UpperCamelCase_				:	Tuple=None     ,  UpperCamelCase_				:	Dict=None     ,  UpperCamelCase_				:	Union[str, Any]=32     ,  **UpperCamelCase_				:	int					)  ->       List[str]:



						'''simple docstring'''





						super().__init__(**UpperCamelCase_					)

						if vision_config is None:
							_lowercase					:       Any       =		{}
							logger.info('vision_config is None. initializing the InstructBlipVisionConfig with default values.'					)

						if qformer_config is None:
							_lowercase					:       List[Any]       =		{}
							logger.info('qformer_config is None. Initializing the InstructBlipQFormerConfig with default values.'					)

						if text_config is None:
							_lowercase					:       List[Any]       =		{}
							logger.info('text_config is None. Initializing the text config with default values (`OPTConfig`).'					)

						_lowercase					:       List[Any]       =		InstructBlipVisionConfig(**UpperCamelCase_					)
						_lowercase					:       Union[str, Any]       =		InstructBlipQFormerConfig(**UpperCamelCase_					)
						_lowercase					:       Union[str, Any]       =		text_config['model_type'] if 'model_type' in text_config else 'opt'
						_lowercase					:       int       =		CONFIG_MAPPING[text_model_type](**UpperCamelCase_					)

						_lowercase					:       str       =		self.text_config.tie_word_embeddings
						_lowercase					:       int       =		self.text_config.is_encoder_decoder

						_lowercase					:       Tuple       =		num_query_tokens
						_lowercase					:       str       =		self.vision_config.hidden_size
						_lowercase					:       Union[str, Any]       =		self.text_config.model_type in MODEL_FOR_CAUSAL_LM_MAPPING_NAMES
						_lowercase					:       List[Any]       =		1.0
						_lowercase					:       int       =		0.02




					@classmethod
					def 						__UpperCAmelCase     (  cls				:	Tuple     ,  UpperCamelCase_				:	InstructBlipVisionConfig     ,  UpperCamelCase_				:	InstructBlipQFormerConfig     ,  UpperCamelCase_				:	PretrainedConfig     ,  **UpperCamelCase_				:	Dict     ,  )  ->       List[str]:



						'''simple docstring'''





						return cls(
						    vision_config=vision_config.to_dict()     ,  qformer_config=qformer_config.to_dict()     ,  text_config=text_config.to_dict()     ,  **UpperCamelCase_     ,  )




					def 						__UpperCAmelCase     (  self				:	Dict					)  ->       List[str]:



						'''simple docstring'''





						_lowercase					:       List[Any]       =		copy.deepcopy(self.__dict__					)
						_lowercase					:       Optional[int]       =		self.vision_config.to_dict()
						_lowercase					:       Optional[Any]       =		self.qformer_config.to_dict()
						_lowercase					:       Tuple       =		self.text_config.to_dict()
						_lowercase					:       Dict       =		self.__class__.model_type
						return output
