
'''simple docstring'''



from manim import *




class     UpperCAmelCase_	(						lowerCamelCase__					):






						'''simple docstring'''






						def    _lowercase      (   self ):

												"""simple docstring"""



												_lowerCAmelCase    		=					Rectangle(height=0.5       ,  width=0.5 )
												_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(*_lowercase ).arrange(_lowercase       ,  buff=0 )
												_lowerCAmelCase    		=					VGroup(*_lowercase ).arrange(_lowercase       ,  buff=0 )
												_lowerCAmelCase    		=					VGroup(_lowercase       ,  _lowercase ).arrange(_lowercase       ,  buff=0 )
												_lowerCAmelCase    		=					Text("""CPU"""       ,  font_size=24 )
												_lowerCAmelCase    		=					Group(_lowercase       ,  _lowercase ).arrange(_lowercase       ,  buff=0.5       ,  aligned_edge=_lowercase )
												cpu.move_to([-2.5, -0.5, 0] )
												self.add(_lowercase )

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

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

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

												_lowerCAmelCase    		=					[]
												for i, rect in enumerate(_lowercase ):
																		rect.set_stroke(_lowercase )
																		# target = fill.copy().set_fill(YELLOW, opacity=0.7)
																		# target.move_to(rect)
																		# self.add(target)

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

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

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

												_lowerCAmelCase    		=					Text("""Loaded Checkpoint"""       ,  font_size=24 )
												_lowerCAmelCase    		=					Group(_lowercase       ,  _lowercase ).arrange(_lowercase       ,  aligned_edge=_lowercase       ,  buff=0.4 )
												checkpoint.move_to([3, 0.5, 0] )

												_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(_lowercase       ,  _lowercase )

												_lowerCAmelCase    		=					MarkupText(
												    F'<span fgcolor=\'{BLUE}\'>●</span> Checkpoint'       ,  font_size=18       ,  )

												blue_text.next_to(_lowercase       ,  DOWN * 2.4       ,  aligned_edge=key_text.get_left() )

												_lowerCAmelCase    		=					MarkupText(
												    F'Next, a <i><span fgcolor=\"{BLUE}\">second</span></i> model is loaded into memory,\nwith the weights of a <span fgcolor=\"{BLUE}\">single shard</span>.'       ,  font_size=24       ,  )
												step_a.move_to([2, 2, 0] )
												self.play(Write(_lowercase )       ,  Write(_lowercase ) )

												self.play(Write(_lowercase       ,  run_time=1 )       ,  Create(_lowercase       ,  run_time=1 ) )

												_lowerCAmelCase    		=					[]
												_lowerCAmelCase    		=					[]
												for i, rect in enumerate(_lowercase ):
																		_lowerCAmelCase    		=					fill.copy().set_fill(_lowercase       ,  opacity=0.7 )
																		target.move_to(_lowercase )
																		first_animations.append(GrowFromCenter(_lowercase       ,  run_time=1 ) )

																		_lowerCAmelCase    		=					target.copy()
																		cpu_target.generate_target()
																		if i < 5:
																								cpu_target.target.move_to(cpu_left_col_base[i + 1] )
																		else:
																								cpu_target.target.move_to(cpu_right_col_base[i - 5] )
																		second_animations.append(MoveToTarget(_lowercase       ,  run_time=1.5 ) )

												self.play(*_lowercase )
												self.play(*_lowercase )
												self.wait()







import logging

from transformers import PretrainedConfig


_lowerCAmelCase				:   str						       =						logging.getLogger(__name__)


_lowerCAmelCase				:   Dict						       =						{
    '''bertabs-finetuned-cnndm''': '''https://huggingface.co/remi/bertabs-finetuned-cnndm-extractive-abstractive-summarization/resolve/main/config.json''',
}


class        __magic_name__	(				lowerCamelCase__				):





     """simple docstring"""



     __UpperCamelCase            =  '''bertabs'''



     def __init__(				self							:Optional[int]      ,   snake_case							:Any=30_522      ,   snake_case							:List[str]=512      ,   snake_case							:str=6      ,   snake_case							:int=512      ,   snake_case							:Optional[Any]=8      ,   snake_case							:Tuple=512      ,   snake_case							:str=0.2      ,   snake_case							:Any=6      ,   snake_case							:Optional[Any]=768      ,   snake_case							:Optional[Any]=8      ,   snake_case							:List[Any]=2_048      ,   snake_case							:Dict=0.2      ,   **snake_case							:List[str]      ,   ):





        '''simple docstring'''




        super().__init__(**snake_case	)

        A_       :					List[str]        =      vocab_size
        A_       :					int        =      max_pos

        A_       :					Tuple        =      enc_layers
        A_       :					Tuple        =      enc_hidden_size
        A_       :					str        =      enc_heads
        A_       :					Optional[Any]        =      enc_ff_size
        A_       :					Optional[Any]        =      enc_dropout

        A_       :					List[str]        =      dec_layers
        A_       :					List[Any]        =      dec_hidden_size
        A_       :					Optional[int]        =      dec_heads
        A_       :					Any        =      dec_ff_size
        A_       :					Optional[int]        =      dec_dropout
