




from manim import *







class     A(		UpperCamelCase  ):



 '''simple docstring'''


 def 							a__					(							self   :    Tuple    )  ->      Union[str, Any]:

       """simple docstring"""






       lowerCamelCase_							=       Rectangle(height=0.5		,				width=0.5    )
       lowerCamelCase_							=       Rectangle(height=0.25		,				width=0.25    )
       lowerCamelCase_							=       Rectangle(height=0.46		,				width=0.46    ).set_stroke(width=0    )

       lowerCamelCase_							=       [mem.copy() for i in range(6    )]
       lowerCamelCase_							=       [mem.copy() for i in range(6    )]
       lowerCamelCase_							=       VGroup(*A_    ).arrange(A_		,				buff=0    )
       lowerCamelCase_							=       VGroup(*A_    ).arrange(A_		,				buff=0    )
       lowerCamelCase_							=       VGroup(A_		,				A_    ).arrange(A_		,				buff=0    )
       lowerCamelCase_							=       Text('CPU'		,				font_size=24    )
       lowerCamelCase_							=       Group(A_		,				A_    ).arrange(A_		,				buff=0.5		,				aligned_edge=A_    )
       cpu.move_to([-2.5, -0.5, 0]    )
       self.add(A_    )

       lowerCamelCase_							=       [mem.copy() for i in range(4    )]
       lowerCamelCase_							=       VGroup(*A_    ).arrange(A_		,				buff=0    )
       lowerCamelCase_							=       Text('GPU'		,				font_size=24    )
       lowerCamelCase_							=       Group(A_		,				A_    ).arrange(A_		,				buff=0.5		,				aligned_edge=A_    )
       gpu.move_to([-1, -1, 0]    )
       self.add(A_    )

       lowerCamelCase_							=       [mem.copy() for i in range(6    )]
       lowerCamelCase_							=       VGroup(*A_    ).arrange(A_		,				buff=0    )

       lowerCamelCase_							=       Text('Model'		,				font_size=24    )
       lowerCamelCase_							=       Group(A_		,				A_    ).arrange(A_		,				buff=0.5		,				aligned_edge=A_    )
       model.move_to([3, -1.0, 0]    )
       self.add(A_    )

       lowerCamelCase_							=       []
       lowerCamelCase_							=       []
       lowerCamelCase_							=       []

       for i, rect in enumerate(A_    ):
             rect.set_stroke(A_    )

             lowerCamelCase_							=       Rectangle(height=0.46 / 4		,				width=0.46 / 3    ).set_stroke(width=0.0    ).set_fill(A_		,				opacity=0.7    )

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

       self.add(*A_		,				*A_		,				*A_    )

       lowerCamelCase_							=       [mem.copy() for i in range(6    )]
       lowerCamelCase_							=       VGroup(*A_    ).arrange(A_		,				buff=0    )

       lowerCamelCase_							=       Text('Loaded Checkpoint'		,				font_size=24    )
       lowerCamelCase_							=       Group(A_		,				A_    ).arrange(A_		,				buff=0.5		,				aligned_edge=A_    )
       checkpoint.move_to([3, 0.5, 0]    )

       self.add(A_    )

       lowerCamelCase_							=       []
       lowerCamelCase_							=       []

       for i, rect in enumerate(A_    ):
             lowerCamelCase_							=       fill.copy().set_fill(A_		,				opacity=0.7    )
             target.move_to(A_    )
             ckpt_arr.append(A_    )

             lowerCamelCase_							=       target.copy()
             if i < 5:
                   cpu_target.move_to(cpu_left_col_base[i + 1]    )
             else:
                   cpu_target.move_to(cpu_right_col_base[i - 5]    )
             ckpt_cpu_arr.append(A_    )
       self.add(*A_		,				*A_    )

       lowerCamelCase_							=       Square(side_length=2.2    )
       key.move_to([-5, 2, 0]    )

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

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

       self.add(A_		,				A_    )

       lowerCamelCase_							=       MarkupText(
           f"""<span fgcolor='{BLUE}'>●</span> Checkpoint"""		,				font_size=18		,				)

       blue_text.next_to(A_		,				DOWN * 2.4		,				aligned_edge=key_text.get_left()    )
       self.add(A_    )

       lowerCamelCase_							=       MarkupText(
           f"""Based on the passed in configuration, weights are stored in\na variety of np.memmaps on disk or to a particular device."""		,				font_size=24		,				)
       step_a.move_to([2, 2, 0]    )

       lowerCamelCase_							=       [meta_mem.copy() for i in range(6    )]
       lowerCamelCase_							=       [meta_mem.copy() for i in range(6    )]
       lowerCamelCase_							=       VGroup(*A_    ).arrange(A_		,				buff=0    )
       lowerCamelCase_							=       VGroup(*A_    ).arrange(A_		,				buff=0    )
       lowerCamelCase_							=       VGroup(A_		,				A_    ).arrange(A_		,				buff=0    )
       lowerCamelCase_							=       Text('Disk'		,				font_size=24    )
       lowerCamelCase_							=       Group(A_		,				A_    ).arrange(A_		,				buff=0.5		,				aligned_edge=A_    )
       disk.move_to([-4.0, -1.25, 0]    )
       self.play(Write(A_		,				run_time=3    )		,				Write(A_		,				run_time=1    )		,				Create(A_		,				run_time=1    )    )

       lowerCamelCase_							=       []
       for i, rect in enumerate(A_    ):
             lowerCamelCase_							=       rect.copy()
             target.generate_target()
             target.target.move_to(disk_left_col_base[i]    ).scale(0.5    )
             animations.append(MoveToTarget(A_		,				run_time=1.5    )    )
       self.play(*A_    )

       self.play(FadeOut(A_    )    )

       lowerCamelCase_							=       MarkupText(f"""Then, the checkpoint is removed from memory\nthrough garbage collection."""		,				font_size=24    )
       step_a.move_to([2, 2, 0]    )

       self.play(Write(A_		,				run_time=3    )    )

       self.play(
           FadeOut(A_		,				A_		,				*A_		,				*A_    )		,				)

       self.wait()










'''simple docstring'''




import logging

from transformers.configuration_utils import PretrainedConfig


_SCREAMING_SNAKE_CASE							     =			logging.getLogger(__name__)
class 			_lowerCAmelCase		(			A__	):






     """simple docstring"""






     snake_case_						      =   "masked_bert"



     def __init__(   self							:			Any   ,       __snake_case							:			Optional[Any]=3_05_22   ,       __snake_case							:			List[Any]=7_68   ,       __snake_case							:			int=12   ,       __snake_case							:			List[str]=12   ,       __snake_case							:			int=30_72   ,       __snake_case							:			Optional[int]="gelu"   ,       __snake_case							:			Any=0.1   ,       __snake_case							:			Tuple=0.1   ,       __snake_case							:			List[str]=5_12   ,       __snake_case							:			Tuple=2   ,       __snake_case							:			Tuple=0.02   ,       __snake_case							:			Tuple=1e-12   ,       __snake_case							:			Union[str, Any]=0   ,       __snake_case							:			int="topK"   ,       __snake_case							:			int="constant"   ,       __snake_case							:			List[str]=0.0   ,       **__snake_case							:			Any   ,       )->	Union[str, Any]:
        super().__init__(pad_token_id=__snake_case   ,       **__snake_case						)

        snake_case 						=   vocab_size
        snake_case 						=   hidden_size
        snake_case 						=   num_hidden_layers
        snake_case 						=   num_attention_heads
        snake_case 						=   hidden_act
        snake_case 						=   intermediate_size
        snake_case 						=   hidden_dropout_prob
        snake_case 						=   attention_probs_dropout_prob
        snake_case 						=   max_position_embeddings
        snake_case 						=   type_vocab_size
        snake_case 						=   initializer_range
        snake_case 						=   layer_norm_eps
        snake_case 						=   pruning_method
        snake_case 						=   mask_init
        snake_case 						=   mask_scale

