


'''simple docstring'''







from ...configuration_utils import PretrainedConfig


SCREAMING_SNAKE_CASE_      =			{
    'google/tapas-base-finetuned-sqa': (
        'https://huggingface.co/google/tapas-base-finetuned-sqa/resolve/main/config.json'
    ),
    'google/tapas-base-finetuned-wtq': (
        'https://huggingface.co/google/tapas-base-finetuned-wtq/resolve/main/config.json'
    ),
    'google/tapas-base-finetuned-wikisql-supervised': (
        'https://huggingface.co/google/tapas-base-finetuned-wikisql-supervised/resolve/main/config.json'
    ),
    'google/tapas-base-finetuned-tabfact': (
        'https://huggingface.co/google/tapas-base-finetuned-tabfact/resolve/main/config.json'
    ),
}


class  lowerCAmelCase_						(       snake_case__      ):





  """simple docstring"""



  a_       :Union[str, Any]												="""tapas"""

  def __init__(					self     :							List[str]				,							SCREAMING_SNAKE_CASE__     :							Union[str, Any]=3_0_5_2_2				,							SCREAMING_SNAKE_CASE__     :							Any=7_6_8				,							SCREAMING_SNAKE_CASE__     :							Optional[Any]=1_2				,							SCREAMING_SNAKE_CASE__     :							Dict=1_2				,							SCREAMING_SNAKE_CASE__     :							List[Any]=3_0_7_2				,							SCREAMING_SNAKE_CASE__     :							Union[str, Any]="gelu"				,							SCREAMING_SNAKE_CASE__     :							Optional[int]=0.1				,							SCREAMING_SNAKE_CASE__     :							Dict=0.1				,							SCREAMING_SNAKE_CASE__     :							List[str]=1_0_2_4				,							SCREAMING_SNAKE_CASE__     :							int=[3, 2_5_6, 2_5_6, 2, 2_5_6, 2_5_6, 1_0]				,							SCREAMING_SNAKE_CASE__     :							str=0.0_2				,							SCREAMING_SNAKE_CASE__     :							Any=1E-12				,							SCREAMING_SNAKE_CASE__     :							Tuple=0				,							SCREAMING_SNAKE_CASE__     :							Optional[Any]=1_0.0				,							SCREAMING_SNAKE_CASE__     :							List[str]=0				,							SCREAMING_SNAKE_CASE__     :							Optional[Any]=1.0				,							SCREAMING_SNAKE_CASE__     :							List[Any]=None				,							SCREAMING_SNAKE_CASE__     :							List[Any]=1.0				,							SCREAMING_SNAKE_CASE__     :							Optional[int]=False				,							SCREAMING_SNAKE_CASE__     :							Tuple=None				,							SCREAMING_SNAKE_CASE__     :							Optional[Any]=1.0				,							SCREAMING_SNAKE_CASE__     :							Optional[int]=1.0				,							SCREAMING_SNAKE_CASE__     :							Optional[int]=False				,							SCREAMING_SNAKE_CASE__     :							int=False				,							SCREAMING_SNAKE_CASE__     :							Optional[Any]="ratio"				,							SCREAMING_SNAKE_CASE__     :							List[Any]=None				,							SCREAMING_SNAKE_CASE__     :							int=None				,							SCREAMING_SNAKE_CASE__     :							int=6_4				,							SCREAMING_SNAKE_CASE__     :							str=3_2				,							SCREAMING_SNAKE_CASE__     :							Dict=False				,							SCREAMING_SNAKE_CASE__     :							str=True				,							SCREAMING_SNAKE_CASE__     :							Optional[Any]=False				,							SCREAMING_SNAKE_CASE__     :							List[Any]=False				,							SCREAMING_SNAKE_CASE__     :							List[Any]=True				,							SCREAMING_SNAKE_CASE__     :							Optional[Any]=False				,							SCREAMING_SNAKE_CASE__     :							Any=None				,							SCREAMING_SNAKE_CASE__     :							Optional[Any]=None				,							**SCREAMING_SNAKE_CASE__     :							Optional[int]				,							):





       '''simple docstring'''

       super().__init__(pad_token_id=SCREAMING_SNAKE_CASE__				,							**SCREAMING_SNAKE_CASE__						)

       # BERT hyperparameters (with updated max_position_embeddings and type_vocab_sizes)
       __a       =   vocab_size
       __a       =   hidden_size
       __a       =   num_hidden_layers
       __a       =   num_attention_heads
       __a       =   hidden_act
       __a       =   intermediate_size
       __a       =   hidden_dropout_prob
       __a       =   attention_probs_dropout_prob
       __a       =   max_position_embeddings
       __a       =   type_vocab_sizes
       __a       =   initializer_range
       __a       =   layer_norm_eps

       # Fine-tuning task hyperparameters
       __a       =   positive_label_weight
       __a       =   num_aggregation_labels
       __a       =   aggregation_loss_weight
       __a       =   use_answer_as_supervision
       __a       =   answer_loss_importance
       __a       =   use_normalized_answer_loss
       __a       =   huber_loss_delta
       __a       =   temperature
       __a       =   aggregation_temperature
       __a       =   use_gumbel_for_cells
       __a       =   use_gumbel_for_aggregation
       __a       =   average_approximation_function
       __a       =   cell_selection_preference
       __a       =   answer_loss_cutoff
       __a       =   max_num_rows
       __a       =   max_num_columns
       __a       =   average_logits_per_cell
       __a       =   select_one_column
       __a       =   allow_empty_column_selection
       __a       =   init_cell_selection_weights_to_zero
       __a       =   reset_position_index_per_cell
       __a       =   disable_per_token_loss

       # Aggregation hyperparameters
       __a       =   aggregation_labels
       __a       =   no_aggregation_label_index

       if isinstance(self.aggregation_labels				,							SCREAMING_SNAKE_CASE__						):
            __a       =   {int(SCREAMING_SNAKE_CASE__						): v for k, v in aggregation_labels.items()}










'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


SCREAMING_SNAKE_CASE_      =			{
    'configuration_rag': ['RagConfig'],
    'retrieval_rag': ['RagRetriever'],
    'tokenization_rag': ['RagTokenizer'],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 SCREAMING_SNAKE_CASE_      =			[
     'RagModel',
     'RagPreTrainedModel',
     'RagSequenceForGeneration',
     'RagTokenForGeneration',
 ]

try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 SCREAMING_SNAKE_CASE_      =			[
     'TFRagModel',
     'TFRagPreTrainedModel',
     'TFRagSequenceForGeneration',
     'TFRagTokenForGeneration',
 ]


if TYPE_CHECKING:
 from .configuration_rag import RagConfig
 from .retrieval_rag import RagRetriever
 from .tokenization_rag import RagTokenizer

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_rag import RagModel, RagPreTrainedModel, RagSequenceForGeneration, RagTokenForGeneration

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_rag import (
      TFRagModel,
      TFRagPreTrainedModel,
      TFRagSequenceForGeneration,
      TFRagTokenForGeneration,
  )

else:
 import sys

 SCREAMING_SNAKE_CASE_      =			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)






