

'''simple docstring'''




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


UpperCamelCase__ :			Optional[Any]												=				logging.get_logger(__name__)

UpperCamelCase__ :			Dict												=				{
    '''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						(							lowerCamelCase__					):


			'''simple docstring'''

			_A   :	Dict    					=	'''realm'''

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





					"""simple docstring"""






					super().__init__(pad_token_id=lowerCAmelCase__							,  bos_token_id=lowerCAmelCase__							,  eos_token_id=lowerCAmelCase__							,  **lowerCAmelCase__		)

					# Common config
					__SCREAMING_SNAKE_CASE :	Optional[Any]					 =	vocab_size
					__SCREAMING_SNAKE_CASE :	Union[str, Any]					 =	max_position_embeddings
					__SCREAMING_SNAKE_CASE :	Optional[Any]					 =	hidden_size
					__SCREAMING_SNAKE_CASE :	Tuple					 =	retriever_proj_size
					__SCREAMING_SNAKE_CASE :	List[Any]					 =	num_hidden_layers
					__SCREAMING_SNAKE_CASE :	Union[str, Any]					 =	num_attention_heads
					__SCREAMING_SNAKE_CASE :	int					 =	num_candidates
					__SCREAMING_SNAKE_CASE :	str					 =	intermediate_size
					__SCREAMING_SNAKE_CASE :	Tuple					 =	hidden_act
					__SCREAMING_SNAKE_CASE :	Optional[Any]					 =	hidden_dropout_prob
					__SCREAMING_SNAKE_CASE :	str					 =	attention_probs_dropout_prob
					__SCREAMING_SNAKE_CASE :	Optional[int]					 =	initializer_range
					__SCREAMING_SNAKE_CASE :	Dict					 =	type_vocab_size
					__SCREAMING_SNAKE_CASE :	Dict					 =	layer_norm_eps

					# Reader config
					__SCREAMING_SNAKE_CASE :	Optional[Any]					 =	span_hidden_size
					__SCREAMING_SNAKE_CASE :	Optional[Any]					 =	max_span_width
					__SCREAMING_SNAKE_CASE :	Tuple					 =	reader_layer_norm_eps
					__SCREAMING_SNAKE_CASE :	Optional[int]					 =	reader_beam_size
					__SCREAMING_SNAKE_CASE :	Tuple					 =	reader_seq_len

					# Retrieval config
					__SCREAMING_SNAKE_CASE :	List[Any]					 =	num_block_records
					__SCREAMING_SNAKE_CASE :	Union[str, Any]					 =	searcher_beam_size




'''simple docstring'''




# coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this script dumps information about the environment

import os
import sys

import transformers


UpperCamelCase__ :			Tuple												=				'''3'''

print('''Python version:''', sys.version)
print('''transformers version:''', transformers.__version__)

try:
						import torch

						print('''Torch version:''', torch.__version__)
						print('''Cuda available:''', torch.cuda.is_available())
						print('''Cuda version:''', torch.version.cuda)
						print('''CuDNN version:''', torch.backends.cudnn.version())
						print('''Number of GPUs available:''', torch.cuda.device_count())
						print('''NCCL version:''', torch.cuda.nccl.version())
except ImportError:
						print('''Torch version:''', None)

try:
						import deepspeed

						print('''DeepSpeed version:''', deepspeed.__version__)
except ImportError:
						print('''DeepSpeed version:''', None)

try:
						import tensorflow as tf

						print('''TensorFlow version:''', tf.__version__)
						print('''TF GPUs available:''', bool(tf.config.list_physical_devices('''GPU''')))
						print('''Number of TF GPUs available:''', len(tf.config.list_physical_devices('''GPU''')))
except ImportError:
						print('''TensorFlow version:''', None)