


"""simple docstring"""







from manim import *


class 				SCREAMING_SNAKE_CASE__    (		lowercase    ):
       """simple docstring"""


       def 	lowercase__							(						self						):






         """simple docstring"""





         lowerCAmelCase					:					Tuple								=							Rectangle(height=0.5		,					width=0.5						)
         lowerCAmelCase					:					Any								=							Rectangle(height=0.46		,					width=0.46						).set_stroke(width=0						)

         lowerCAmelCase					:					Optional[int]								=							[mem.copy() for i in range(6						)]
         lowerCAmelCase					:					Any								=							[mem.copy() for i in range(6						)]
         lowerCAmelCase					:					List[str]								=							VGroup(*snake_case__						).arrange(snake_case__		,					buff=0						)
         lowerCAmelCase					:					Any								=							VGroup(*snake_case__						).arrange(snake_case__		,					buff=0						)
         lowerCAmelCase					:					Dict								=							VGroup(snake_case__		,					snake_case__						).arrange(snake_case__		,					buff=0						)
         lowerCAmelCase					:					List[Any]								=							Text("CPU"		,					font_size=24						)
         lowerCAmelCase					:					Union[str, Any]								=							Group(snake_case__		,					snake_case__						).arrange(snake_case__		,					buff=0.5		,					aligned_edge=snake_case__						)
         cpu.move_to([-2.5, -0.5, 0]						)
         self.add(snake_case__						)

         lowerCAmelCase					:					str								=							[mem.copy() for i in range(1						)]
         lowerCAmelCase					:					int								=							VGroup(*snake_case__						).arrange(snake_case__		,					buff=0						)
         lowerCAmelCase					:					Optional[Any]								=							Text("GPU"		,					font_size=24						)
         lowerCAmelCase					:					Dict								=							Group(snake_case__		,					snake_case__						).arrange(snake_case__		,					buff=0.5		,					aligned_edge=snake_case__						)
         gpu.align_to(snake_case__		,					snake_case__						)
         gpu.set_x(gpu.get_x() - 1						)

         self.add(snake_case__						)

         lowerCAmelCase					:					List[Any]								=							[mem.copy() for i in range(6						)]
         lowerCAmelCase					:					Union[str, Any]								=							VGroup(*snake_case__						).arrange(snake_case__		,					buff=0						)

         lowerCAmelCase					:					Any								=							Text("Model"		,					font_size=24						)
         lowerCAmelCase					:					Union[str, Any]								=							Group(snake_case__		,					snake_case__						).arrange(snake_case__		,					buff=0.5		,					aligned_edge=snake_case__						)
         model.move_to([3, -1.0, 0]						)

         self.play(
             Create(snake_case__		,					run_time=1						)		,					Create(snake_case__		,					run_time=1						)		,					Create(snake_case__		,					run_time=1						)		,					)

         lowerCAmelCase					:					int								=							MarkupText(
             f"""First, an empty model skeleton is loaded\ninto <span fgcolor='{YELLOW}'>memory</span> without using much RAM."""		,					font_size=24		,					)

         lowerCAmelCase					:					Optional[Any]								=							Square(side_length=2.2						)
         key.move_to([-5, 2, 0]						)

         lowerCAmelCase					:					str								=							MarkupText(
             f"""<b>Key:</b>\n\n<span fgcolor='{YELLOW}'>●</span> Empty Model"""		,					font_size=18		,					)

         key_text.move_to([-5, 2.4, 0]						)

         step_a.move_to([2, 2, 0]						)
         self.play(Write(snake_case__		,					run_time=2.5						)		,					Write(snake_case__						)		,					Write(snake_case__						)						)

         self.add(snake_case__						)

         lowerCAmelCase					:					int								=							[]
         lowerCAmelCase					:					List[str]								=							[]
         lowerCAmelCase					:					Tuple								=							[]
         for i, rect in enumerate(snake_case__						):
           lowerCAmelCase					:					Union[str, Any]								=							Rectangle(height=0.46		,					width=0.46						).set_stroke(width=0.0						).set_fill(snake_case__		,					opacity=0.7						)
           cpu_target.move_to(snake_case__						)
           cpu_target.generate_target()
           lowerCAmelCase					:					Optional[int]								=							0.46 / 4
           lowerCAmelCase					:					List[str]								=							0.46 / 3

           if i == 0:
             cpu_target.target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT						)		,					buff=0.02		,					direction=snake_case__						)
             cpu_target.target.set_x(cpu_target.target.get_x() + 0.1						)
           elif i == 3:
             cpu_target.target.next_to(cpu_targs[0].target		,					direction=snake_case__		,					buff=0.0						)
           else:
             cpu_target.target.next_to(cpu_targs[i - 1].target		,					direction=snake_case__		,					buff=0.0						)
           cpu_targs.append(snake_case__						)

           first_animations.append(rect.animate(run_time=0.5						).set_stroke(snake_case__						)						)
           second_animations.append(MoveToTarget(snake_case__		,					run_time=1.5						)						)

         self.play(*snake_case__						)
         self.play(*snake_case__						)

         self.wait()









"""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 				SCREAMING_SNAKE_CASE__    (		lowercase    ):
       """simple docstring"""


       a  :    Any       ="tapas"

       def __init__(						self		,					snake_case__=30_522		,					snake_case__=768		,					snake_case__=12		,					snake_case__=12		,					snake_case__=3_072		,					snake_case__="gelu"		,					snake_case__=0.1		,					snake_case__=0.1		,					snake_case__=1_024		,					snake_case__=[3, 256, 256, 2, 256, 256, 10]		,					snake_case__=0.02		,					snake_case__=1e-12		,					snake_case__=0		,					snake_case__=10.0		,					snake_case__=0		,					snake_case__=1.0		,					snake_case__=None		,					snake_case__=1.0		,					snake_case__=False		,					snake_case__=None		,					snake_case__=1.0		,					snake_case__=1.0		,					snake_case__=False		,					snake_case__=False		,					snake_case__="ratio"		,					snake_case__=None		,					snake_case__=None		,					snake_case__=64		,					snake_case__=32		,					snake_case__=False		,					snake_case__=True		,					snake_case__=False		,					snake_case__=False		,					snake_case__=True		,					snake_case__=False		,					snake_case__=None		,					snake_case__=None		,					**snake_case__		,					):






         """simple docstring"""





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

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

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

         # Aggregation hyperparameters
         lowerCAmelCase					:					List[str]								=							aggregation_labels
         lowerCAmelCase					:					List[str]								=							no_aggregation_label_index

         if isinstance(self.aggregation_labels		,					snake_case__						):
           lowerCAmelCase					:					Union[str, Any]								=							{int(snake_case__						): v for k, v in aggregation_labels.items()}





