





"""simple docstring"""


import inspect
import unittest

from transformers import SegformerConfig, is_torch_available, is_vision_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
    import torch

    from transformers import (
        MODEL_MAPPING,
        SegformerForImageClassification,
        SegformerForSemanticSegmentation,
        SegformerModel,
    )
    from transformers.models.segformer.modeling_segformer import SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
    from PIL import Image

    from transformers import SegformerImageProcessor


class 			A__	(						_UpperCamelCase):


     """simple docstring"""

     def 		a__						(	self:						Tuple	)->    List[Any]:
           lowerCamelCase					:					int        =	self.config_class(**self.inputs_dict	)
           self.parent.assertTrue(hasattr(__a     ,		"""hidden_sizes"""	)	)
           self.parent.assertTrue(hasattr(__a     ,		"""num_attention_heads"""	)	)
           self.parent.assertTrue(hasattr(__a     ,		"""num_encoder_blocks"""	)	)


class 			A__	:


     """simple docstring"""

     def __init__(	self:						List[str]     ,		__a:						List[Any]     ,		__a:						int=13     ,		__a:						Dict=64     ,		__a:						Union[str, Any]=3     ,		__a:						int=4     ,		__a:						Union[str, Any]=[2, 2, 2, 2]     ,		__a:						List[Any]=[8, 4, 2, 1]     ,		__a:						Tuple=[16, 32, 64, 128]     ,		__a:						Any=[1, 4, 8, 16]     ,		__a:						Optional[Any]=[1, 2, 4, 8]     ,		__a:						str=True     ,		__a:						Any=True     ,		__a:						Union[str, Any]="gelu"     ,		__a:						List[str]=0.1     ,		__a:						Tuple=0.1     ,		__a:						List[str]=0.02     ,		__a:						Optional[int]=3     ,		__a:						Union[str, Any]=None     ,		)->    List[Any]:
           lowerCamelCase					:					Optional[int]        =	parent
           lowerCamelCase					:					Optional[Any]        =	batch_size
           lowerCamelCase					:					Tuple        =	image_size
           lowerCamelCase					:					int        =	num_channels
           lowerCamelCase					:					Optional[int]        =	num_encoder_blocks
           lowerCamelCase					:					Optional[Any]        =	sr_ratios
           lowerCamelCase					:					Any        =	depths
           lowerCamelCase					:					Dict        =	hidden_sizes
           lowerCamelCase					:					Union[str, Any]        =	downsampling_rates
           lowerCamelCase					:					str        =	num_attention_heads
           lowerCamelCase					:					List[Any]        =	is_training
           lowerCamelCase					:					Dict        =	use_labels
           lowerCamelCase					:					str        =	hidden_act
           lowerCamelCase					:					Optional[Any]        =	hidden_dropout_prob
           lowerCamelCase					:					Optional[int]        =	attention_probs_dropout_prob
           lowerCamelCase					:					Tuple        =	initializer_range
           lowerCamelCase					:					int        =	num_labels
           lowerCamelCase					:					Union[str, Any]        =	scope

     def 		a__						(	self:						Dict	)->    Tuple:
           lowerCamelCase					:					List[str]        =	floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]	)

           lowerCamelCase					:					List[Any]        =	None
           if self.use_labels:
                 lowerCamelCase					:					Union[str, Any]        =	ids_tensor([self.batch_size, self.image_size, self.image_size]     ,		self.num_labels	)

           lowerCamelCase					:					List[Any]        =	self.get_config()
           return config, pixel_values, labels

     def 		a__						(	self:						List[str]	)->    Any:
           return SegformerConfig(
               image_size=self.image_size     ,		num_channels=self.num_channels     ,		num_encoder_blocks=self.num_encoder_blocks     ,		depths=self.depths     ,		hidden_sizes=self.hidden_sizes     ,		num_attention_heads=self.num_attention_heads     ,		hidden_act=self.hidden_act     ,		hidden_dropout_prob=self.hidden_dropout_prob     ,		attention_probs_dropout_prob=self.attention_probs_dropout_prob     ,		initializer_range=self.initializer_range     ,		)

     def 		a__						(	self:						str     ,		__a:						Union[str, Any]     ,		__a:						Tuple     ,		__a:						Any	)->    Optional[int]:
           lowerCamelCase					:					Tuple        =	SegformerModel(config=__a	)
           model.to(__a	)
           model.eval()
           lowerCamelCase					:					Optional[Any]        =	model(__a	)
           lowerCamelCase					:					Optional[Any]        =	self.image_size // (self.downsampling_rates[-1] * 2)
           self.parent.assertEqual(
               result.last_hidden_state.shape     ,		(self.batch_size, self.hidden_sizes[-1], expected_height, expected_width)	)

     def 		a__						(	self:						Union[str, Any]     ,		__a:						List[Any]     ,		__a:						Any     ,		__a:						Union[str, Any]	)->    int:
           lowerCamelCase					:					List[str]        =	self.num_labels
           lowerCamelCase					:					List[str]        =	SegformerForSemanticSegmentation(__a	)
           model.to(__a	)
           model.eval()
           lowerCamelCase					:					int        =	model(__a	)
           self.parent.assertEqual(
               result.logits.shape     ,		(self.batch_size, self.num_labels, self.image_size // 4, self.image_size // 4)	)
           lowerCamelCase					:					Optional[Any]        =	model(__a     ,		labels=__a	)
           self.parent.assertEqual(
               result.logits.shape     ,		(self.batch_size, self.num_labels, self.image_size // 4, self.image_size // 4)	)
           self.parent.assertGreater(result.loss     ,		0.0	)

     def 		a__						(	self:						Union[str, Any]     ,		__a:						Any     ,		__a:						List[Any]     ,		__a:						Tuple	)->    Tuple:
           lowerCamelCase					:					List[str]        =	1
           lowerCamelCase					:					List[Any]        =	SegformerForSemanticSegmentation(config=__a	)
           model.to(__a	)
           model.eval()
           lowerCamelCase					:					int        =	torch.randint(0     ,		1     ,		(self.batch_size, self.image_size, self.image_size)	).to(__a	)
           lowerCamelCase					:					int        =	model(__a     ,		labels=__a	)
           self.parent.assertGreater(result.loss     ,		0.0	)







     def 		a__						(	self:						Any	)->    List[Any]:
           lowerCamelCase					:					int        =	self.prepare_config_and_inputs()
           lowerCamelCase					:					Any        =	config_and_inputs
           lowerCamelCase					:					Optional[int]        =	{"pixel_values": pixel_values}
           return config, inputs_dict


@require_torch
class 			A__	(						_UpperCamelCase ,     _UpperCamelCase ,     unittest.TestCase):


     """simple docstring"""
     snake_case__	:					int													=(
         (
             SegformerModel,
             SegformerForSemanticSegmentation,
             SegformerForImageClassification,
         )
         if is_torch_available()
         else ()
     )
     snake_case__	:					Tuple													=(
         {
             '''feature-extraction''': SegformerModel,
             '''image-classification''': SegformerForImageClassification,
             '''image-segmentation''': SegformerForSemanticSegmentation,
         }
         if is_torch_available()
         else {}
     )

     snake_case__	:					str													=True
     snake_case__	:					int													=False
     snake_case__	:					Dict													=False
     snake_case__	:					int													=False

     def 		a__						(	self:						str	)->    Optional[Any]:
           lowerCamelCase					:					Dict        =	SegformerModelTester(self	)
           lowerCamelCase					:					Union[str, Any]        =	SegformerConfigTester(self     ,		config_class=__a	)

     def 		a__						(	self:						str	)->    Any:
           self.config_tester.run_common_tests()

     def 		a__						(	self:						Union[str, Any]	)->    Tuple:
           lowerCamelCase					:					Dict        =	self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_model(*__a	)

     def 		a__						(	self:						str	)->    str:
           lowerCamelCase					:					int        =	self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_for_binary_image_segmentation(*__a	)

     def 		a__						(	self:						Tuple	)->    int:
           lowerCamelCase					:					Any        =	self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_for_image_segmentation(*__a	)

     @unittest.skip("""SegFormer does not use inputs_embeds"""	)
     def 		a__						(	self:						Any	)->    Dict:
           pass

     @unittest.skip("""SegFormer does not have get_input_embeddings method and get_output_embeddings methods"""	)
     def 		a__						(	self:						Optional[Any]	)->    Tuple:
           pass

     def 		a__						(	self:						List[str]	)->    int:
           lowerCamelCase					:					List[str]        =	self.model_tester.prepare_config_and_inputs_for_common()

           for model_class in self.all_model_classes:
                 lowerCamelCase					:					Any        =	model_class(__a	)
                 lowerCamelCase					:					Dict        =	inspect.signature(model.forward	)
                 # signature.parameters is an OrderedDict => so arg_names order is deterministic
                 lowerCamelCase					:					Tuple        =	[*signature.parameters.keys()]

                 lowerCamelCase					:					Dict        =	["pixel_values"]
                 self.assertListEqual(arg_names[:1]     ,		__a	)

     def 		a__						(	self:						Optional[int]	)->    int:
           lowerCamelCase					:					List[str]        =	self.model_tester.prepare_config_and_inputs_for_common()
           lowerCamelCase					:					Union[str, Any]        =	True

           for model_class in self.all_model_classes:
                 lowerCamelCase					:					Any        =	True
                 lowerCamelCase					:					int        =	False
                 lowerCamelCase					:					str        =	True
                 lowerCamelCase					:					Union[str, Any]        =	model_class(__a	)
                 model.to(__a	)
                 model.eval()
                 with torch.no_grad():
                       lowerCamelCase					:					Optional[int]        =	model(**self._prepare_for_class(__a     ,		__a	)	)
                 lowerCamelCase					:					Dict        =	outputs.attentions

                 lowerCamelCase					:					Optional[int]        =	sum(self.model_tester.depths	)
                 self.assertEqual(len(__a	)     ,		__a	)

                 # check that output_attentions also work using config
                 del inputs_dict["output_attentions"]
                 lowerCamelCase					:					Union[str, Any]        =	True
                 lowerCamelCase					:					Union[str, Any]        =	model_class(__a	)
                 model.to(__a	)
                 model.eval()
                 with torch.no_grad():
                       lowerCamelCase					:					List[Any]        =	model(**self._prepare_for_class(__a     ,		__a	)	)
                 lowerCamelCase					:					Optional[int]        =	outputs.attentions

                 self.assertEqual(len(__a	)     ,		__a	)

                 # verify the first attentions (first block, first layer)
                 lowerCamelCase					:					Optional[int]        =	(self.model_tester.image_size // 4) ** 2
                 lowerCamelCase					:					Dict        =	(self.model_tester.image_size // (4 * self.model_tester.sr_ratios[0])) ** 2
                 self.assertListEqual(
                     list(attentions[0].shape[-3:]	)     ,		[self.model_tester.num_attention_heads[0], expected_seq_len, expected_reduced_seq_len]     ,		)

                 # verify the last attentions (last block, last layer)
                 lowerCamelCase					:					Tuple        =	(self.model_tester.image_size // 32) ** 2
                 lowerCamelCase					:					Optional[int]        =	(self.model_tester.image_size // (32 * self.model_tester.sr_ratios[-1])) ** 2
                 self.assertListEqual(
                     list(attentions[-1].shape[-3:]	)     ,		[self.model_tester.num_attention_heads[-1], expected_seq_len, expected_reduced_seq_len]     ,		)
                 lowerCamelCase					:					Optional[Any]        =	len(__a	)

                 # Check attention is always last and order is fine
                 lowerCamelCase					:					Optional[int]        =	True
                 lowerCamelCase					:					Optional[int]        =	True
                 lowerCamelCase					:					List[str]        =	model_class(__a	)
                 model.to(__a	)
                 model.eval()
                 with torch.no_grad():
                       lowerCamelCase					:					Optional[Any]        =	model(**self._prepare_for_class(__a     ,		__a	)	)

                 self.assertEqual(out_len + 1     ,		len(__a	)	)

                 lowerCamelCase					:					Any        =	outputs.attentions

                 self.assertEqual(len(__a	)     ,		__a	)
                 # verify the first attentions (first block, first layer)
                 lowerCamelCase					:					Dict        =	(self.model_tester.image_size // 4) ** 2
                 lowerCamelCase					:					int        =	(self.model_tester.image_size // (4 * self.model_tester.sr_ratios[0])) ** 2
                 self.assertListEqual(
                     list(self_attentions[0].shape[-3:]	)     ,		[self.model_tester.num_attention_heads[0], expected_seq_len, expected_reduced_seq_len]     ,		)

     def 		a__						(	self:						List[Any]	)->    Dict:
           def check_hidden_states_output(__a:						Any     ,		__a:						Union[str, Any]     ,		__a:						str	):
                 lowerCamelCase					:					List[str]        =	model_class(__a	)
                 model.to(__a	)
                 model.eval()

                 with torch.no_grad():
                       lowerCamelCase					:					str        =	model(**self._prepare_for_class(__a     ,		__a	)	)

                 lowerCamelCase					:					Dict        =	outputs.hidden_states

                 lowerCamelCase					:					int        =	self.model_tester.num_encoder_blocks
                 self.assertEqual(len(__a	)     ,		__a	)

                 # verify the first hidden states (first block)
                 self.assertListEqual(
                     list(hidden_states[0].shape[-3:]	)     ,		[
                         self.model_tester.hidden_sizes[0],
                         self.model_tester.image_size // 4,
                         self.model_tester.image_size // 4,
                     ]     ,		)

           lowerCamelCase					:					int        =	self.model_tester.prepare_config_and_inputs_for_common()

           for model_class in self.all_model_classes:
                 lowerCamelCase					:					List[Any]        =	True
                 check_hidden_states_output(__a     ,		__a     ,		__a	)

                 # check that output_hidden_states also work using config
                 del inputs_dict["output_hidden_states"]
                 lowerCamelCase					:					str        =	True

                 check_hidden_states_output(__a     ,		__a     ,		__a	)

     def 		a__						(	self:						Union[str, Any]	)->    List[Any]:
           if not self.model_tester.is_training:
                 return

           lowerCamelCase					:					Tuple        =	self.model_tester.prepare_config_and_inputs_for_common()
           lowerCamelCase					:					List[Any]        =	True

           for model_class in self.all_model_classes:
                 if model_class in get_values(__a	):
                       continue

                 lowerCamelCase					:					Optional[int]        =	model_class(__a	)
                 model.to(__a	)
                 model.train()
                 lowerCamelCase					:					List[Any]        =	self._prepare_for_class(__a     ,		__a     ,		return_labels=__a	)
                 lowerCamelCase					:					Any        =	model(**__a	).loss
                 loss.backward()

     @unittest.skip("""Will be fixed soon by reducing the size of the model used for common tests."""	)
     def 		a__						(	self:						Union[str, Any]	)->    List[Any]:
           pass







     @slow
     def 		a__						(	self:						Any	)->    int:
           for model_name in SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                 lowerCamelCase					:					List[str]        =	SegformerModel.from_pretrained(__a	)
                 self.assertIsNotNone(__a	)




def   snake_case		(     )   ->      Any:
      lowerCamelCase					:					Dict        =	Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png"""    )
      return image






@require_torch
class 			A__	(						unittest.TestCase):


     """simple docstring"""

     @slow
     def 		a__						(	self:						Dict	)->    Union[str, Any]:
           # only resize + normalize
           lowerCamelCase					:					str        =	SegformerImageProcessor(
               image_scale=(512, 512)     ,		keep_ratio=__a     ,		align=__a     ,		do_random_crop=__a	)
           lowerCamelCase					:					str        =	SegformerForSemanticSegmentation.from_pretrained("""nvidia/segformer-b0-finetuned-ade-512-512"""	).to(
               __a	)

           lowerCamelCase					:					str        =	prepare_img()
           lowerCamelCase					:					List[Any]        =	image_processor(images=__a     ,		return_tensors="""pt"""	)
           lowerCamelCase					:					Optional[Any]        =	encoded_inputs.pixel_values.to(__a	)

           with torch.no_grad():
                 lowerCamelCase					:					Optional[Any]        =	model(__a	)

           lowerCamelCase					:					List[Any]        =	torch.Size((1, model.config.num_labels, 128, 128)	)
           self.assertEqual(outputs.logits.shape     ,		__a	)

           lowerCamelCase					:					int        =	torch.tensor(
               [
                   [[-4.63_10, -5.52_32, -6.23_56], [-5.19_21, -6.14_44, -6.59_96], [-5.44_24, -6.27_90, -6.75_74]],
                   [[-12.13_91, -13.31_22, -13.95_54], [-12.87_32, -13.93_52, -14.35_63], [-12.94_38, -13.82_26, -14.25_13]],
                   [[-12.51_34, -13.46_86, -14.49_15], [-12.86_69, -14.43_43, -14.77_58], [-13.25_23, -14.58_19, -15.06_94]],
               ]	).to(__a	)
           self.assertTrue(torch.allclose(outputs.logits[0, :3, :3, :3]     ,		__a     ,		atol=1e-4	)	)

     @slow
     def 		a__						(	self:						Optional[Any]	)->    List[Any]:
           # only resize + normalize
           lowerCamelCase					:					List[Any]        =	SegformerImageProcessor(
               image_scale=(512, 512)     ,		keep_ratio=__a     ,		align=__a     ,		do_random_crop=__a	)
           lowerCamelCase					:					Dict        =	SegformerForSemanticSegmentation.from_pretrained(
               """nvidia/segformer-b1-finetuned-cityscapes-1024-1024"""	).to(__a	)

           lowerCamelCase					:					Union[str, Any]        =	prepare_img()
           lowerCamelCase					:					List[str]        =	image_processor(images=__a     ,		return_tensors="""pt"""	)
           lowerCamelCase					:					Any        =	encoded_inputs.pixel_values.to(__a	)

           with torch.no_grad():
                 lowerCamelCase					:					Any        =	model(__a	)

           lowerCamelCase					:					List[Any]        =	torch.Size((1, model.config.num_labels, 128, 128)	)
           self.assertEqual(outputs.logits.shape     ,		__a	)

           lowerCamelCase					:					Dict        =	torch.tensor(
               [
                   [[-13.57_48, -13.91_11, -12.65_00], [-14.35_00, -15.36_83, -14.23_28], [-14.75_32, -16.04_24, -15.60_87]],
                   [[-17.16_51, -15.87_25, -12.96_53], [-17.25_80, -17.37_18, -14.82_23], [-16.60_58, -16.87_83, -16.74_52]],
                   [[-3.64_56, -3.02_09, -1.42_03], [-3.07_97, -3.19_59, -2.00_00], [-1.87_57, -1.92_17, -1.69_97]],
               ]	).to(__a	)
           self.assertTrue(torch.allclose(outputs.logits[0, :3, :3, :3]     ,		__a     ,		atol=1e-1	)	)







     @slow
     def 		a__						(	self:						Tuple	)->    Dict:
           # only resize + normalize
           lowerCamelCase					:					int        =	SegformerImageProcessor(
               image_scale=(512, 512)     ,		keep_ratio=__a     ,		align=__a     ,		do_random_crop=__a	)
           lowerCamelCase					:					Dict        =	SegformerForSemanticSegmentation.from_pretrained("""nvidia/segformer-b0-finetuned-ade-512-512"""	).to(
               __a	)

           lowerCamelCase					:					Tuple        =	prepare_img()
           lowerCamelCase					:					Dict        =	image_processor(images=__a     ,		return_tensors="""pt"""	)
           lowerCamelCase					:					int        =	encoded_inputs.pixel_values.to(__a	)

           with torch.no_grad():
                 lowerCamelCase					:					List[str]        =	model(__a	)

           lowerCamelCase					:					Optional[Any]        =	outputs.logits.detach().cpu()

           lowerCamelCase					:					Union[str, Any]        =	image_processor.post_process_semantic_segmentation(outputs=__a     ,		target_sizes=[(500, 300)]	)
           lowerCamelCase					:					Union[str, Any]        =	torch.Size((500, 300)	)
           self.assertEqual(segmentation[0].shape     ,		__a	)

           lowerCamelCase					:					Any        =	image_processor.post_process_semantic_segmentation(outputs=__a	)
           lowerCamelCase					:					List[str]        =	torch.Size((128, 128)	)
           self.assertEqual(segmentation[0].shape     ,		__a	)








"""simple docstring"""


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


__lowerCamelCase      :Optional[int]	    =		logging.get_logger(__name__)

__lowerCamelCase      :List[str]	    =		{
    '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 			A__	(						__lowercase):


     """simple docstring"""
     snake_case__	:					Optional[Any]													='''realm'''

     def __init__(	self:						Union[str, Any]     ,		__a:						List[Any]=30_522     ,		__a:						List[Any]=768     ,		__a:						List[Any]=128     ,		__a:						Union[str, Any]=12     ,		__a:						Union[str, Any]=12     ,		__a:						Optional[Any]=8     ,		__a:						Dict=3_072     ,		__a:						List[Any]="gelu_new"     ,		__a:						List[Any]=0.1     ,		__a:						Tuple=0.1     ,		__a:						Optional[Any]=512     ,		__a:						Optional[int]=2     ,		__a:						str=0.02     ,		__a:						int=1e-1_2     ,		__a:						Optional[Any]=256     ,		__a:						Any=10     ,		__a:						Dict=1e-3     ,		__a:						Optional[Any]=5     ,		__a:						Dict=320     ,		__a:						Tuple=13_353_718     ,		__a:						List[Any]=5_000     ,		__a:						Dict=1     ,		__a:						int=0     ,		__a:						Dict=2     ,		**__a:						List[str]     ,		)->    Any:
           super().__init__(pad_token_id=__a     ,		bos_token_id=__a     ,		eos_token_id=__a     ,		**__a	)

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

           # Reader config
           lowerCamelCase					:					List[str]        =	span_hidden_size
           lowerCamelCase					:					Dict        =	max_span_width
           lowerCamelCase					:					Optional[Any]        =	reader_layer_norm_eps
           lowerCamelCase					:					Optional[int]        =	reader_beam_size
           lowerCamelCase					:					List[Any]        =	reader_seq_len

           # Retrieval config
           lowerCamelCase					:					int        =	num_block_records
           lowerCamelCase					:					Dict        =	searcher_beam_size




