
from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


__SCREAMING_SNAKE_CASE	:      Optional[Any]			   =   {
    'configuration_dpr': ['DPR_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DPRConfig'],
    'tokenization_dpr': [
        'DPRContextEncoderTokenizer',
        'DPRQuestionEncoderTokenizer',
        'DPRReaderOutput',
        'DPRReaderTokenizer',
    ],
}


try:
		if not is_tokenizers_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__SCREAMING_SNAKE_CASE	:      Dict			   =   [
		    'DPRContextEncoderTokenizerFast',
		    'DPRQuestionEncoderTokenizerFast',
		    'DPRReaderTokenizerFast',
		]

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__SCREAMING_SNAKE_CASE	:      Dict			   =   [
		    'DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'DPRContextEncoder',
		    'DPRPretrainedContextEncoder',
		    'DPRPreTrainedModel',
		    'DPRPretrainedQuestionEncoder',
		    'DPRPretrainedReader',
		    'DPRQuestionEncoder',
		    'DPRReader',
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__SCREAMING_SNAKE_CASE	:      List[Any]			   =   [
		    'TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'TFDPRContextEncoder',
		    'TFDPRPretrainedContextEncoder',
		    'TFDPRPretrainedQuestionEncoder',
		    'TFDPRPretrainedReader',
		    'TFDPRQuestionEncoder',
		    'TFDPRReader',
		]


if TYPE_CHECKING:
		from .configuration_dpr import DPR_PRETRAINED_CONFIG_ARCHIVE_MAP, DPRConfig
		from .tokenization_dpr import (
		    DPRContextEncoderTokenizer,
		    DPRQuestionEncoderTokenizer,
		    DPRReaderOutput,
		    DPRReaderTokenizer,
		)

		try:
				if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_dpr_fast import (
				    DPRContextEncoderTokenizerFast,
				    DPRQuestionEncoderTokenizerFast,
				    DPRReaderTokenizerFast,
				)

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_dpr import (
				    DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    DPRContextEncoder,
				    DPRPretrainedContextEncoder,
				    DPRPreTrainedModel,
				    DPRPretrainedQuestionEncoder,
				    DPRPretrainedReader,
				    DPRQuestionEncoder,
				    DPRReader,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_dpr import (
				    TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFDPRContextEncoder,
				    TFDPRPretrainedContextEncoder,
				    TFDPRPretrainedQuestionEncoder,
				    TFDPRPretrainedReader,
				    TFDPRQuestionEncoder,
				    TFDPRReader,
				)

else:
		import sys

		__SCREAMING_SNAKE_CASE	:      Optional[Any]			   =   _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

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


lowerCAmelCase__							= logging.get_logger(__name__)

lowerCAmelCase__							= {
    'dandelin/vilt-b32-mlm': 'https://huggingface.co/dandelin/vilt-b32-mlm/blob/main/config.json'
}
class 				a_ (						SCREAMING_SNAKE_CASE						):






 '''simple docstring'''






 UpperCAmelCase_	 =					'vilt'




 def __init__(			self					:  Optional[Any]			,    lowercase__					:  Dict=30_522			,    lowercase__					:  Tuple=2			,    lowercase__					:  int=2			,    lowercase__					:  Optional[int]=40			,    lowercase__					:  Optional[int]=768			,    lowercase__					:  Tuple=12			,    lowercase__					:  Tuple=12			,    lowercase__					:  Union[str, Any]=3_072			,    lowercase__					:  int="gelu"			,    lowercase__					:  Tuple=0.0			,    lowercase__					:  Dict=0.0			,    lowercase__					:  Optional[int]=0.02			,    lowercase__					:  Tuple=1e-12			,    lowercase__					:  Dict=384			,    lowercase__					:  int=32			,    lowercase__					:  List[str]=3			,    lowercase__					:  int=True			,    lowercase__					:  List[str]=-1			,    lowercase__					:  Union[str, Any]=False			,    lowercase__					:  List[str]=-1			,    **lowercase__					:  int			,    ):







        '''simple docstring'''



        super().__init__(tie_word_embeddings=lowercase__			,    **lowercase__)

        lowerCAmelCase__     	=					vocab_size
        lowerCAmelCase__     	=					type_vocab_size
        lowerCAmelCase__     	=					modality_type_vocab_size
        lowerCAmelCase__     	=					max_position_embeddings

        lowerCAmelCase__     	=					hidden_size
        lowerCAmelCase__     	=					num_hidden_layers
        lowerCAmelCase__     	=					num_attention_heads
        lowerCAmelCase__     	=					intermediate_size
        lowerCAmelCase__     	=					hidden_act
        lowerCAmelCase__     	=					hidden_dropout_prob
        lowerCAmelCase__     	=					attention_probs_dropout_prob
        lowerCAmelCase__     	=					initializer_range
        lowerCAmelCase__     	=					layer_norm_eps

        lowerCAmelCase__     	=					image_size
        lowerCAmelCase__     	=					patch_size
        lowerCAmelCase__     	=					num_channels
        lowerCAmelCase__     	=					qkv_bias
        lowerCAmelCase__     	=					max_image_length
        lowerCAmelCase__     	=					num_images
