


# Lint as: python3
import itertools
import os
import re


_lowerCAmelCase:						Dict   				=       re.compile(R'([A-Z]+)([A-Z][a-z])')
_lowerCAmelCase:						Optional[int]   				=       re.compile(R'([a-z\d])([A-Z])')

_lowerCAmelCase:						str   				=       re.compile(R'(?<!_)_(?!_)')
_lowerCAmelCase:						Union[str, Any]   				=       re.compile(R'(_{2,})')

_lowerCAmelCase:						List[Any]   				=       R'''^\w+(\.\w+)*$'''

_lowerCAmelCase:						List[Any]   				=       R'''<>:/\|?*'''






def   _lowercase(					__a				:						Dict     ):
							a__      =_uppercase_uppercase_re.sub(r'\1_\2'    ,     UpperCAmelCase_     )
							a__      =_lowercase_uppercase_re.sub(r'\1_\2'    ,     UpperCAmelCase_     )
							return name.lower()






def   _lowercase(					__a				:						Union[str, Any]     ):
							a__      =_single_underscore_re.split(UpperCAmelCase_     )
							a__      =[_multiple_underscores_re.split(UpperCAmelCase_     ) for n in name]
							return "".join(n.capitalize() for n in itertools.chain.from_iterable(UpperCAmelCase_     ) if n != ''     )






def   _lowercase(					__a				:						Tuple     ):





							if os.path.basename(UpperCAmelCase_     ) != name:
														raise ValueError(f"""Should be a dataset name, not a path: {name}"""     )
							return camelcase_to_snakecase(UpperCAmelCase_     )






def   _lowercase(					__a				:						Optional[Any]    ,     __a				:						int     ):





							if os.path.basename(UpperCAmelCase_     ) != name:
														raise ValueError(f"""Should be a dataset name, not a path: {name}"""     )
							if not re.match(_split_re    ,     UpperCAmelCase_     ):
														raise ValueError(f"""Split name should match \'{_split_re}\'\' but got \'{split}\'."""     )
							return f"""{filename_prefix_for_name(UpperCAmelCase_     )}-{split}"""






def   _lowercase(					__a				:						List[Any]    ,     __a				:						Union[str, Any]    ,     __a				:						Dict    ,     __a				:						Optional[int]=None     ):
							a__      =filename_prefix_for_split(UpperCAmelCase_    ,     UpperCAmelCase_     )
							if filetype_suffix:
														prefix += f""".{filetype_suffix}"""
							a__      =os.path.join(UpperCAmelCase_    ,     UpperCAmelCase_     )
							return f"""{filepath}*"""







def   _lowercase(					__a				:						Optional[int]    ,     __a				:						List[str]    ,     __a				:						Optional[int]    ,     __a				:						Dict=None    ,     __a				:						List[Any]=None     ):
							a__      =filename_prefix_for_split(UpperCAmelCase_    ,     UpperCAmelCase_     )
							a__      =os.path.join(UpperCAmelCase_    ,     UpperCAmelCase_     )

							if shard_lengths:
														a__      =len(UpperCAmelCase_     )
														a__      =[f"""{prefix}-{shard_id:05d}-of-{num_shards:05d}""" for shard_id in range(UpperCAmelCase_     )]
														if filetype_suffix:
																					a__      =[filename + f""".{filetype_suffix}""" for filename in filenames]
														return filenames
							else:
														a__      =prefix
														if filetype_suffix:
																					filename += f""".{filetype_suffix}"""
														return [filename]





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


snake_case							:       List[Any]										=	logging.get_logger(__name__)

snake_case							:       Dict										=	{
    '''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 						_snake_case    ( _snake_case				):
 SCREAMING_SNAKE_CASE__ =			'visual_bert'




 def __init__(						self   ,    _lowerCamelCase=3_0522   ,    _lowerCamelCase=768   ,    _lowerCamelCase=512   ,    _lowerCamelCase=12   ,    _lowerCamelCase=12   ,    _lowerCamelCase=3072   ,    _lowerCamelCase="gelu"   ,    _lowerCamelCase=0.1   ,    _lowerCamelCase=0.1   ,    _lowerCamelCase=512   ,    _lowerCamelCase=2   ,    _lowerCamelCase=0.02   ,    _lowerCamelCase=1e-12   ,    _lowerCamelCase=False   ,    _lowerCamelCase=True   ,    _lowerCamelCase=1   ,    _lowerCamelCase=0   ,    _lowerCamelCase=2   ,    **_lowerCamelCase   ,    ):
       super().__init__(pad_token_id=_lowerCamelCase   ,    bos_token_id=_lowerCamelCase   ,    eos_token_id=_lowerCamelCase   ,    **_lowerCamelCase       )

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





