
'''simple docstring'''



import warnings

from ...configuration_utils import PretrainedConfig
from ...utils import logging


_lowercase          =						logging.get_logger(__name__)

_lowercase          =						{
    """RUCAIBox/mvp""": """https://huggingface.co/RUCAIBox/mvp/resolve/main/config.json""",
}




class     UpperCAmelCase_	(						_SCREAMING_SNAKE_CASE					):






						'''simple docstring'''






						_lowercase						: List[str]										=  '''mvp'''
						_lowercase						: Any										=  ['''past_key_values''']
						_lowercase						: Optional[Any]										=  {'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}




						def __init__(   self       ,  _lowercase=50_267       ,  _lowercase=1_024       ,  _lowercase=12       ,  _lowercase=4_096       ,  _lowercase=16       ,  _lowercase=12       ,  _lowercase=4_096       ,  _lowercase=16       ,  _lowercase=0.0       ,  _lowercase=0.0       ,  _lowercase="gelu"       ,  _lowercase=1_024       ,  _lowercase=0.1       ,  _lowercase=0.0       ,  _lowercase=0.0       ,  _lowercase=0.02       ,  _lowercase=0.0       ,  _lowercase=False       ,  _lowercase=True       ,  _lowercase=1       ,  _lowercase=0       ,  _lowercase=2       ,  _lowercase=True       ,  _lowercase=2       ,  _lowercase=2       ,  _lowercase=False       ,  _lowercase=100       ,  _lowercase=800       ,  **_lowercase       ,  ):

												"""simple docstring"""



												_lowerCAmelCase    		=					vocab_size
												_lowerCAmelCase    		=					max_position_embeddings
												_lowerCAmelCase    		=					d_model
												_lowerCAmelCase    		=					encoder_ffn_dim
												_lowerCAmelCase    		=					encoder_layers
												_lowerCAmelCase    		=					encoder_attention_heads
												_lowerCAmelCase    		=					decoder_ffn_dim
												_lowerCAmelCase    		=					decoder_layers
												_lowerCAmelCase    		=					decoder_attention_heads
												_lowerCAmelCase    		=					dropout
												_lowerCAmelCase    		=					attention_dropout
												_lowerCAmelCase    		=					activation_dropout
												_lowerCAmelCase    		=					activation_function
												_lowerCAmelCase    		=					init_std
												_lowerCAmelCase    		=					encoder_layerdrop
												_lowerCAmelCase    		=					decoder_layerdrop
												_lowerCAmelCase    		=					classifier_dropout
												_lowerCAmelCase    		=					use_cache
												_lowerCAmelCase    		=					encoder_layers
												_lowerCAmelCase    		=					scale_embedding  # scale factor will be sqrt(d_model) if True
												_lowerCAmelCase    		=					use_prompt
												_lowerCAmelCase    		=					prompt_length
												_lowerCAmelCase    		=					prompt_mid_dim

												super().__init__(
												    pad_token_id=_lowercase       ,  bos_token_id=_lowercase       ,  eos_token_id=_lowercase       ,  is_encoder_decoder=_lowercase       ,  decoder_start_token_id=_lowercase       ,  forced_eos_token_id=_lowercase       ,  **_lowercase       ,  )

												if self.forced_bos_token_id is None and kwargs.get("""force_bos_token_to_be_generated"""       ,  _lowercase ):
																		_lowerCAmelCase    		=					self.bos_token_id
																		warnings.warn(
																		    F'Please make sure the config includes `forced_bos_token_id={self.bos_token_id}` in future versions. '
																		    """The config can simply be saved and uploaded again to be fixed.""" )


'''simple docstring'''



from manim import *




class     UpperCAmelCase_	(						_SCREAMING_SNAKE_CASE					):






						'''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(1 )]
												_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.align_to(_lowercase       ,  _lowercase )
												gpu.set_x(gpu.get_x() - 1 )

												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.play(
												    Create(_lowercase       ,  run_time=1 )       ,  Create(_lowercase       ,  run_time=1 )       ,  Create(_lowercase       ,  run_time=1 )       ,  )

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

												_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] )

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

												self.add(_lowercase )

												_lowerCAmelCase    		=					[]
												_lowerCAmelCase    		=					[]
												_lowerCAmelCase    		=					[]
												for i, rect in enumerate(_lowercase ):
																		_lowerCAmelCase    		=					Rectangle(height=0.46       ,  width=0.46 ).set_stroke(width=0.0 ).set_fill(_lowercase       ,  opacity=0.7 )
																		cpu_target.move_to(_lowercase )
																		cpu_target.generate_target()
																		_lowerCAmelCase    		=					0.46 / 4
																		_lowerCAmelCase    		=					0.46 / 3

																		if i == 0:
																								cpu_target.target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT )       ,  buff=0.02       ,  direction=_lowercase )
																								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=_lowercase       ,  buff=0.0 )
																		else:
																								cpu_target.target.next_to(cpu_targs[i - 1].target       ,  direction=_lowercase       ,  buff=0.0 )
																		cpu_targs.append(_lowercase )

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

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

												self.wait()
