

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


_UpperCAmelCase		:       str						    =	logging.get_logger(__name__)

_UpperCAmelCase		:       str						    =	{
    """facebook/dpr-ctx_encoder-single-nq-base""": (
        """https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base/resolve/main/config.json"""
    ),
    """facebook/dpr-question_encoder-single-nq-base""": (
        """https://huggingface.co/facebook/dpr-question_encoder-single-nq-base/resolve/main/config.json"""
    ),
    """facebook/dpr-reader-single-nq-base""": (
        """https://huggingface.co/facebook/dpr-reader-single-nq-base/resolve/main/config.json"""
    ),
    """facebook/dpr-ctx_encoder-multiset-base""": (
        """https://huggingface.co/facebook/dpr-ctx_encoder-multiset-base/resolve/main/config.json"""
    ),
    """facebook/dpr-question_encoder-multiset-base""": (
        """https://huggingface.co/facebook/dpr-question_encoder-multiset-base/resolve/main/config.json"""
    ),
    """facebook/dpr-reader-multiset-base""": (
        """https://huggingface.co/facebook/dpr-reader-multiset-base/resolve/main/config.json"""
    ),
}







class 			lowercase    (	A_      ):
				__SCREAMING_SNAKE_CASE :			Union[str, Any]	      =      '''dpr'''




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

											snake_case_          =   vocab_size
											snake_case_          =   hidden_size
											snake_case_          =   num_hidden_layers
											snake_case_          =   num_attention_heads
											snake_case_          =   hidden_act
											snake_case_          =   intermediate_size
											snake_case_          =   hidden_dropout_prob
											snake_case_          =   attention_probs_dropout_prob
											snake_case_          =   max_position_embeddings
											snake_case_          =   type_vocab_size
											snake_case_          =   initializer_range
											snake_case_          =   layer_norm_eps
											snake_case_          =   projection_dim
											snake_case_          =   position_embedding_type







# Lint as: python3
import itertools
import os
import re


_UpperCAmelCase		:       str						    =	re.compile(R"""([A-Z]+)([A-Z][a-z])""")
_UpperCAmelCase		:       Dict						    =	re.compile(R"""([a-z\d])([A-Z])""")

_UpperCAmelCase		:       Dict						    =	re.compile(R"""(?<!_)_(?!_)""")
_UpperCAmelCase		:       Tuple						    =	re.compile(R"""(_{2,})""")

_UpperCAmelCase		:       Any						    =	R"""^\w+(\.\w+)*$"""

_UpperCAmelCase		:       List[str]						    =	R"""<>:/\|?*"""





def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






							snake_case_          =   _uppercase_uppercase_re.sub(r'\1_\2'       ,							UpperCamelCase__				)
							snake_case_          =   _lowercase_uppercase_re.sub(r'\1_\2'       ,							UpperCamelCase__				)
							return name.lower()





def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






							snake_case_          =   _single_underscore_re.split(UpperCamelCase__				)
							snake_case_          =   [_multiple_underscores_re.split(UpperCamelCase__				) for n in name]
							return "".join(n.capitalize() for n in itertools.chain.from_iterable(UpperCamelCase__				) if n != ''				)





def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






							if os.path.basename(UpperCamelCase__				) != name:
														raise ValueError(F'''Should be a dataset name, not a path: {name}'''				)
							return camelcase_to_snakecase(UpperCamelCase__				)





def  __lowerCamelCase     (			UpperCamelCase__       ,							UpperCamelCase__				):







							'''simple docstring'''






							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  __lowerCamelCase     (			UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__=None				):







							'''simple docstring'''






							snake_case_          =   filename_prefix_for_split(UpperCamelCase__       ,							UpperCamelCase__				)
							if filetype_suffix:
														prefix += F'''.{filetype_suffix}'''
							snake_case_          =   os.path.join(UpperCamelCase__       ,							UpperCamelCase__				)
							return F'''{filepath}*'''





def  __lowerCamelCase     (			UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__=None       ,							UpperCamelCase__=None				):







							'''simple docstring'''






							snake_case_          =   filename_prefix_for_split(UpperCamelCase__       ,							UpperCamelCase__				)
							snake_case_          =   os.path.join(UpperCamelCase__       ,							UpperCamelCase__				)

							if shard_lengths:
														snake_case_          =   len(UpperCamelCase__				)
														snake_case_          =   [F'''{prefix}-{shard_id:05d}-of-{num_shards:05d}''' for shard_id in range(UpperCamelCase__				)]
														if filetype_suffix:
																					snake_case_          =   [filename + F'''.{filetype_suffix}''' for filename in filenames]
														return filenames
							else:
														snake_case_          =   prefix
														if filetype_suffix:
																					filename += F'''.{filetype_suffix}'''
														return [filename]




