'''simple docstring'''




from ...configuration_utils import PretrainedConfig


__lowercase        =    {
    '''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 							a__(   lowerCAmelCase__      ):


			'''simple docstring'''






			UpperCAmelCase_     :	str						=			'''tapas'''



			def __init__(  self			,       __lowerCAmelCase=30522			,       __lowerCAmelCase=768			,       __lowerCAmelCase=12			,       __lowerCAmelCase=12			,       __lowerCAmelCase=3072			,       __lowerCAmelCase="gelu"			,       __lowerCAmelCase=0.1			,       __lowerCAmelCase=0.1			,       __lowerCAmelCase=1024			,       __lowerCAmelCase=[3, 256, 256, 2, 256, 256, 10]			,       __lowerCAmelCase=0.02			,       __lowerCAmelCase=1E-1_2			,       __lowerCAmelCase=0			,       __lowerCAmelCase=10.0			,       __lowerCAmelCase=0			,       __lowerCAmelCase=1.0			,       __lowerCAmelCase=None			,       __lowerCAmelCase=1.0			,       __lowerCAmelCase=False			,       __lowerCAmelCase=None			,       __lowerCAmelCase=1.0			,       __lowerCAmelCase=1.0			,       __lowerCAmelCase=False			,       __lowerCAmelCase=False			,       __lowerCAmelCase="ratio"			,       __lowerCAmelCase=None			,       __lowerCAmelCase=None			,       __lowerCAmelCase=64			,       __lowerCAmelCase=32			,       __lowerCAmelCase=False			,       __lowerCAmelCase=True			,       __lowerCAmelCase=False			,       __lowerCAmelCase=False			,       __lowerCAmelCase=True			,       __lowerCAmelCase=False			,       __lowerCAmelCase=None			,       __lowerCAmelCase=None			,       **__lowerCAmelCase			,       ):




					"""simple docstring"""


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

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

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

					# Aggregation hyperparameters
					lowerCAmelCase     =    aggregation_labels
					lowerCAmelCase     =    no_aggregation_label_index

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





'''simple docstring'''




import copy
from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Audio, Features, Value
from .base import TaskTemplate






@dataclass(frozen=lowerCAmelCase__      )
class 							a__(   lowerCAmelCase__      ):


			'''simple docstring'''






			UpperCAmelCase_     :	str						=			field(default='''automatic-speech-recognition'''					,		metadata={'''include_in_asdict_even_if_is_default''': True}      )
			UpperCAmelCase_     :	ClassVar[Features]						=			Features({'''audio''': Audio()}      )
			UpperCAmelCase_     :	ClassVar[Features]						=			Features({'''transcription''': Value('''string'''      )}      )
			UpperCAmelCase_     :	str						=			"audio"
			UpperCAmelCase_     :	str						=			"transcription"



			def 				a_			(  self			,       __lowerCAmelCase):




					"""simple docstring"""


					if self.audio_column not in features:
							raise ValueError(f"Column {self.audio_column} is not present in features.")
					if not isinstance(features[self.audio_column]			,       __lowerCAmelCase):
							raise ValueError(f"Column {self.audio_column} is not an Audio type.")
					lowerCAmelCase     =    copy.deepcopy(self)
					lowerCAmelCase     =    self.input_schema.copy()
					lowerCAmelCase     =    features[self.audio_column]
					lowerCAmelCase     =    input_schema
					return task_template







			@property
			def 				a_			(  self):




					"""simple docstring"""


					return {self.audio_column: "audio", self.transcription_column: "transcription"}




