






'''simple docstring'''




from ...configuration_utils import PretrainedConfig


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

	def __init__(      self   :						Any  ,					UpperCAmelCase_   :						Any=30_522  ,					UpperCAmelCase_   :						Dict=768  ,					UpperCAmelCase_   :						List[Any]=12  ,					UpperCAmelCase_   :						Optional[Any]=12  ,					UpperCAmelCase_   :						Optional[Any]=3_072  ,					UpperCAmelCase_   :						Optional[int]="gelu"  ,					UpperCAmelCase_   :						str=0.1  ,					UpperCAmelCase_   :						Optional[int]=0.1  ,					UpperCAmelCase_   :						List[Any]=1_024  ,					UpperCAmelCase_   :						Dict=[3, 256, 256, 2, 256, 256, 10]  ,					UpperCAmelCase_   :						Dict=0.02  ,					UpperCAmelCase_   :						Optional[Any]=1e-12  ,					UpperCAmelCase_   :						Any=0  ,					UpperCAmelCase_   :						List[Any]=10.0  ,					UpperCAmelCase_   :						Any=0  ,					UpperCAmelCase_   :						Dict=1.0  ,					UpperCAmelCase_   :						Dict=None  ,					UpperCAmelCase_   :						str=1.0  ,					UpperCAmelCase_   :						Optional[Any]=False  ,					UpperCAmelCase_   :						Optional[Any]=None  ,					UpperCAmelCase_   :						Optional[int]=1.0  ,					UpperCAmelCase_   :						str=1.0  ,					UpperCAmelCase_   :						Union[str, Any]=False  ,					UpperCAmelCase_   :						Dict=False  ,					UpperCAmelCase_   :						List[Any]="ratio"  ,					UpperCAmelCase_   :						Dict=None  ,					UpperCAmelCase_   :						str=None  ,					UpperCAmelCase_   :						int=64  ,					UpperCAmelCase_   :						Optional[int]=32  ,					UpperCAmelCase_   :						Any=False  ,					UpperCAmelCase_   :						Optional[Any]=True  ,					UpperCAmelCase_   :						Dict=False  ,					UpperCAmelCase_   :						Optional[Any]=False  ,					UpperCAmelCase_   :						int=True  ,					UpperCAmelCase_   :						Optional[Any]=False  ,					UpperCAmelCase_   :						Any=None  ,					UpperCAmelCase_   :						Union[str, Any]=None  ,					**UpperCAmelCase_   :						Dict  ,					):
			super().__init__(pad_token_id=UpperCAmelCase_  ,					**UpperCAmelCase_)

			# BERT hyperparameters (with updated max_position_embeddings and type_vocab_sizes)
			UpperCamelCase__				:					List[str]					=					vocab_size
			UpperCamelCase__				:					str					=					hidden_size
			UpperCamelCase__				:					str					=					num_hidden_layers
			UpperCamelCase__				:					Tuple					=					num_attention_heads
			UpperCamelCase__				:					str					=					hidden_act
			UpperCamelCase__				:					Optional[int]					=					intermediate_size
			UpperCamelCase__				:					Any					=					hidden_dropout_prob
			UpperCamelCase__				:					Optional[int]					=					attention_probs_dropout_prob
			UpperCamelCase__				:					Union[str, Any]					=					max_position_embeddings
			UpperCamelCase__				:					Tuple					=					type_vocab_sizes
			UpperCamelCase__				:					Dict					=					initializer_range
			UpperCamelCase__				:					Optional[int]					=					layer_norm_eps

			# Fine-tuning task hyperparameters
			UpperCamelCase__				:					Optional[int]					=					positive_label_weight
			UpperCamelCase__				:					str					=					num_aggregation_labels
			UpperCamelCase__				:					Union[str, Any]					=					aggregation_loss_weight
			UpperCamelCase__				:					List[str]					=					use_answer_as_supervision
			UpperCamelCase__				:					List[str]					=					answer_loss_importance
			UpperCamelCase__				:					Tuple					=					use_normalized_answer_loss
			UpperCamelCase__				:					Optional[int]					=					huber_loss_delta
			UpperCamelCase__				:					Any					=					temperature
			UpperCamelCase__				:					int					=					aggregation_temperature
			UpperCamelCase__				:					str					=					use_gumbel_for_cells
			UpperCamelCase__				:					Dict					=					use_gumbel_for_aggregation
			UpperCamelCase__				:					List[Any]					=					average_approximation_function
			UpperCamelCase__				:					Dict					=					cell_selection_preference
			UpperCamelCase__				:					Any					=					answer_loss_cutoff
			UpperCamelCase__				:					str					=					max_num_rows
			UpperCamelCase__				:					Optional[Any]					=					max_num_columns
			UpperCamelCase__				:					Tuple					=					average_logits_per_cell
			UpperCamelCase__				:					Optional[int]					=					select_one_column
			UpperCamelCase__				:					Union[str, Any]					=					allow_empty_column_selection
			UpperCamelCase__				:					Tuple					=					init_cell_selection_weights_to_zero
			UpperCamelCase__				:					Dict					=					reset_position_index_per_cell
			UpperCamelCase__				:					Union[str, Any]					=					disable_per_token_loss

			# Aggregation hyperparameters
			UpperCamelCase__				:					Dict					=					aggregation_labels
			UpperCamelCase__				:					Optional[int]					=					no_aggregation_label_index

			if isinstance(self.aggregation_labels  ,					UpperCAmelCase_):
					UpperCamelCase__				:					Optional[int]					=					{int(UpperCAmelCase_): v for k, v in aggregation_labels.items()}







'''simple docstring'''




from math import log

from scipy.constants import Boltzmann, physical_constants

lowerCAmelCase__          =						300  # TEMPERATURE (unit = K)







def       __UpperCAmelCase						(  lowerCamelCase_     ,      lowerCamelCase_     ,      lowerCamelCase_     ,      )							->     float:

		if donor_conc <= 0:
				raise ValueError('Donor concentration should be positive')
		elif acceptor_conc <= 0:
				raise ValueError('Acceptor concentration should be positive')
		elif intrinsic_conc <= 0:
				raise ValueError('Intrinsic concentration should be positive')
		elif donor_conc <= intrinsic_conc:
				raise ValueError(
				    'Donor concentration should be greater than intrinsic concentration')
		elif acceptor_conc <= intrinsic_conc:
				raise ValueError(
				    'Acceptor concentration should be greater than intrinsic concentration')
		else:
				return (
				    Boltzmann
				    * T
				    * log((donor_conc * acceptor_conc) / intrinsic_conc**2)
				    / physical_constants["electron volt"][0]
				)


if __name__ == "__main__":
		import doctest

		doctest.testmod()




