






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


lowerCamelCase_						: Tuple         =  logging.get_logger(__name__)

lowerCamelCase_						: Union[str, Any]         =  {
    """uclanlp/visualbert-vqa""": """https://huggingface.co/uclanlp/visualbert-vqa/resolve/main/config.json""",
    """uclanlp/visualbert-vqa-pre""": """https://huggingface.co/uclanlp/visualbert-vqa-pre/resolve/main/config.json""",
    """uclanlp/visualbert-vqa-coco-pre""": (
        """https://huggingface.co/uclanlp/visualbert-vqa-coco-pre/resolve/main/config.json"""
    ),
    """uclanlp/visualbert-vcr""": """https://huggingface.co/uclanlp/visualbert-vcr/resolve/main/config.json""",
    """uclanlp/visualbert-vcr-pre""": """https://huggingface.co/uclanlp/visualbert-vcr-pre/resolve/main/config.json""",
    """uclanlp/visualbert-vcr-coco-pre""": (
        """https://huggingface.co/uclanlp/visualbert-vcr-coco-pre/resolve/main/config.json"""
    ),
    """uclanlp/visualbert-nlvr2""": """https://huggingface.co/uclanlp/visualbert-nlvr2/resolve/main/config.json""",
    """uclanlp/visualbert-nlvr2-pre""": """https://huggingface.co/uclanlp/visualbert-nlvr2-pre/resolve/main/config.json""",
    """uclanlp/visualbert-nlvr2-coco-pre""": (
        """https://huggingface.co/uclanlp/visualbert-nlvr2-coco-pre/resolve/main/config.json"""
    )
    # See all VisualBERT models at https://huggingface.co/models?filter=visual_bert
}

class        _UpperCamelCase				(					_A  ):






			'''simple docstring'''

			__UpperCamelCase      :						Dict					      = """visual_bert"""

			def __init__(       self :       Any						,	snake_case_ :       List[Any]=3_0522						,	snake_case_ :       int=768						,	snake_case_ :       List[Any]=512						,	snake_case_ :       int=12						,	snake_case_ :       Tuple=12						,	snake_case_ :       Optional[Any]=3072						,	snake_case_ :       Union[str, Any]="gelu"						,	snake_case_ :       Optional[Any]=0.1						,	snake_case_ :       Any=0.1						,	snake_case_ :       Optional[Any]=512						,	snake_case_ :       Tuple=2						,	snake_case_ :       Union[str, Any]=0.02						,	snake_case_ :       Optional[int]=1e-12						,	snake_case_ :       Any=False						,	snake_case_ :       Any=True						,	snake_case_ :       Union[str, Any]=1						,	snake_case_ :       int=0						,	snake_case_ :       str=2						,	**snake_case_ :       Optional[int]						,	):
							super().__init__(pad_token_id=snake_case_						,	bos_token_id=snake_case_						,	eos_token_id=snake_case_						,	**snake_case_      )

							UpperCamelCase_:							List[str]	=						vocab_size
							UpperCamelCase_:							List[str]	=						max_position_embeddings
							UpperCamelCase_:							List[str]	=						hidden_size
							UpperCamelCase_:							List[str]	=						visual_embedding_dim
							UpperCamelCase_:							str	=						num_hidden_layers
							UpperCamelCase_:							Tuple	=						num_attention_heads
							UpperCamelCase_:							List[str]	=						intermediate_size
							UpperCamelCase_:							str	=						hidden_act
							UpperCamelCase_:							int	=						hidden_dropout_prob
							UpperCamelCase_:							Optional[int]	=						attention_probs_dropout_prob
							UpperCamelCase_:							Tuple	=						initializer_range
							UpperCamelCase_:							List[Any]	=						type_vocab_size
							UpperCamelCase_:							int	=						layer_norm_eps
							UpperCamelCase_:							Union[str, Any]	=						bypass_transformer
							UpperCamelCase_:							Optional[int]	=						special_visual_initialize








import inspect
import os
import sys
import unittest

import accelerate
from accelerate.test_utils import execute_subprocess_async, require_tpu

class        _UpperCamelCase				(					unittest.TestCase  ):






			'''simple docstring'''

			def       lowerCAmelCase__	(       self :       Optional[int]      ):
							UpperCamelCase_:							List[Any]	=						inspect.getfile(accelerate.test_utils      )
							UpperCamelCase_:							List[str]	=						os.path.sep.join(mod_file.split(os.path.sep      )[:-1] + ["""scripts""", """test_script.py"""]      )
							UpperCamelCase_:							str	=						os.path.sep.join(inspect.getfile(self.__class__      ).split(os.path.sep      )[:-1]      )




			@require_tpu
			def       lowerCAmelCase__	(       self :       Optional[int]      ):
							UpperCamelCase_:							Any	=						f'''
            {self.test_dir}/xla_spawn.py
            --num_cores 8
            {self.test_file_path}
        '''.split()
							UpperCamelCase_:							Dict	=						[sys.executable] + distributed_args
							execute_subprocess_async(snake_case_						,	env=os.environ.copy()      )






