


"""simple docstring"""







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


a__    :							List[str]            =					logging.get_logger(__name__)

a__    :							Union[str, Any]            =					{
    '''google/realm-cc-news-pretrained-embedder''': (
        '''https://huggingface.co/google/realm-cc-news-pretrained-embedder/resolve/main/config.json'''
    ),
    '''google/realm-cc-news-pretrained-encoder''': (
        '''https://huggingface.co/google/realm-cc-news-pretrained-encoder/resolve/main/config.json'''
    ),
    '''google/realm-cc-news-pretrained-scorer''': (
        '''https://huggingface.co/google/realm-cc-news-pretrained-scorer/resolve/main/config.json'''
    ),
    '''google/realm-cc-news-pretrained-openqa''': (
        '''https://huggingface.co/google/realm-cc-news-pretrained-openqa/aresolve/main/config.json'''
    ),
    '''google/realm-orqa-nq-openqa''': '''https://huggingface.co/google/realm-orqa-nq-openqa/resolve/main/config.json''',
    '''google/realm-orqa-nq-reader''': '''https://huggingface.co/google/realm-orqa-nq-reader/resolve/main/config.json''',
    '''google/realm-orqa-wq-openqa''': '''https://huggingface.co/google/realm-orqa-wq-openqa/resolve/main/config.json''',
    '''google/realm-orqa-wq-reader''': '''https://huggingface.co/google/realm-orqa-wq-reader/resolve/main/config.json''',
    # See all REALM models at https://huggingface.co/models?filter=realm
}




class 			UpperCamelCase_     (			UpperCamelCase):

	"""simple docstring"""





	snake_case__    :  List[Any]    =      "realm"




	def __init__(			self      :    Optional[Any]      ,      UpperCAmelCase__      :    int=3_0_5_2_2      ,      UpperCAmelCase__      :    str=7_6_8      ,      UpperCAmelCase__      :    Dict=1_2_8      ,      UpperCAmelCase__      :    Optional[Any]=1_2      ,      UpperCAmelCase__      :    Tuple=1_2      ,      UpperCAmelCase__      :    str=8      ,      UpperCAmelCase__      :    Union[str, Any]=3_0_7_2      ,      UpperCAmelCase__      :    Tuple="gelu_new"      ,      UpperCAmelCase__      :    Tuple=0.1      ,      UpperCAmelCase__      :    List[str]=0.1      ,      UpperCAmelCase__      :    List[str]=5_1_2      ,      UpperCAmelCase__      :    Any=2      ,      UpperCAmelCase__      :    List[Any]=0.02      ,      UpperCAmelCase__      :    Union[str, Any]=1E-12      ,      UpperCAmelCase__      :    Union[str, Any]=2_5_6      ,      UpperCAmelCase__      :    Optional[int]=1_0      ,      UpperCAmelCase__      :    Optional[Any]=1E-3      ,      UpperCAmelCase__      :    Any=5      ,      UpperCAmelCase__      :    List[str]=3_2_0      ,      UpperCAmelCase__      :    str=1_3_3_5_3_7_1_8      ,      UpperCAmelCase__      :    Dict=5_0_0_0      ,      UpperCAmelCase__      :    Tuple=1      ,      UpperCAmelCase__      :    Dict=0      ,      UpperCAmelCase__      :    Dict=2      ,      **UpperCAmelCase__      :    Any      ,      )	->     List[str]:
						super().__init__(pad_token_id=UpperCAmelCase__      ,      bos_token_id=UpperCAmelCase__      ,      eos_token_id=UpperCAmelCase__      ,      **UpperCAmelCase__       )

						# Common config
						__SCREAMING_SNAKE_CASE						       =    vocab_size
						__SCREAMING_SNAKE_CASE						       =    max_position_embeddings
						__SCREAMING_SNAKE_CASE						       =    hidden_size
						__SCREAMING_SNAKE_CASE						       =    retriever_proj_size
						__SCREAMING_SNAKE_CASE						       =    num_hidden_layers
						__SCREAMING_SNAKE_CASE						       =    num_attention_heads
						__SCREAMING_SNAKE_CASE						       =    num_candidates
						__SCREAMING_SNAKE_CASE						       =    intermediate_size
						__SCREAMING_SNAKE_CASE						       =    hidden_act
						__SCREAMING_SNAKE_CASE						       =    hidden_dropout_prob
						__SCREAMING_SNAKE_CASE						       =    attention_probs_dropout_prob
						__SCREAMING_SNAKE_CASE						       =    initializer_range
						__SCREAMING_SNAKE_CASE						       =    type_vocab_size
						__SCREAMING_SNAKE_CASE						       =    layer_norm_eps

						# Reader config
						__SCREAMING_SNAKE_CASE						       =    span_hidden_size
						__SCREAMING_SNAKE_CASE						       =    max_span_width
						__SCREAMING_SNAKE_CASE						       =    reader_layer_norm_eps
						__SCREAMING_SNAKE_CASE						       =    reader_beam_size
						__SCREAMING_SNAKE_CASE						       =    reader_seq_len

						# Retrieval config
						__SCREAMING_SNAKE_CASE						       =    num_block_records
						__SCREAMING_SNAKE_CASE						       =    searcher_beam_size




"""simple docstring"""







from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
		if not (is_transformers_available() and is_torch_available()):
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		from ...utils.dummy_torch_and_transformers_objects import KandinskyPipeline, KandinskyPriorPipeline
else:
		from .pipeline_kandinsky import KandinskyPipeline
		from .pipeline_kandinsky_imgaimg import KandinskyImgaImgPipeline
		from .pipeline_kandinsky_inpaint import KandinskyInpaintPipeline
		from .pipeline_kandinsky_prior import KandinskyPriorPipeline, KandinskyPriorPipelineOutput
		from .text_encoder import MultilingualCLIP
