
"""simple docstring"""





from manim import *






class    _UpperCAmelCase(   lowerCamelCase     ):



		def 						UpperCAmelCase							( self)	->	Any:






							'''simple docstring'''
							__UpperCamelCase										=  Rectangle(height=0.5    ,		width=0.5)
							__UpperCamelCase										=  Rectangle(height=0.25    ,		width=0.25)
							__UpperCamelCase										=  Rectangle(height=0.46    ,		width=0.46).set_stroke(width=0)

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

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

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

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

							__UpperCamelCase										=  []
							__UpperCamelCase										=  []
							__UpperCamelCase										=  []

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

												__UpperCamelCase										=  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)

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

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

							self.add(__a)

							__UpperCamelCase										=  []
							__UpperCamelCase										=  []

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

												__UpperCamelCase										=  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)

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

							__UpperCamelCase										=  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)

							__UpperCamelCase										=  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)

							__UpperCamelCase										=  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])

							__UpperCamelCase										=  [meta_mem.copy() for i in range(6)]
							__UpperCamelCase										=  [meta_mem.copy() for i in range(6)]
							__UpperCamelCase										=  VGroup(*__a).arrange(__a    ,		buff=0)
							__UpperCamelCase										=  VGroup(*__a).arrange(__a    ,		buff=0)
							__UpperCamelCase										=  VGroup(__a    ,		__a).arrange(__a    ,		buff=0)
							__UpperCamelCase										=  Text('''Disk'''    ,		font_size=24)
							__UpperCamelCase										=  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))

							__UpperCamelCase										=  []
							for i, rect in enumerate(__a):
												__UpperCamelCase										=  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))

							__UpperCamelCase										=  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"""





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


_a														=		logging.get_logger(__name__)

_a														=		{
    """microsoft/biogpt""": """https://huggingface.co/microsoft/biogpt/resolve/main/config.json""",
    # See all BioGPT models at https://huggingface.co/models?filter=biogpt
}






class    _UpperCAmelCase(   lowerCamelCase     ):
		lowercase__      =				'biogpt'



		def __init__( self    ,		__a=4_23_84    ,		__a=10_24    ,		__a=24    ,		__a=16    ,		__a=40_96    ,		__a="gelu"    ,		__a=0.1    ,		__a=0.1    ,		__a=10_24    ,		__a=0.02    ,		__a=1e-12    ,		__a=True    ,		__a=True    ,		__a=0.0    ,		__a=0.0    ,		__a=1    ,		__a=0    ,		__a=2    ,		**__a    ,		)	->	Dict:






							'''simple docstring'''
							_UpperCamelCase										=  vocab_size
							_UpperCamelCase										=  max_position_embeddings
							_UpperCamelCase										=  hidden_size
							_UpperCamelCase										=  num_hidden_layers
							_UpperCamelCase										=  num_attention_heads
							_UpperCamelCase										=  intermediate_size
							_UpperCamelCase										=  hidden_act
							_UpperCamelCase										=  hidden_dropout_prob
							_UpperCamelCase										=  attention_probs_dropout_prob
							_UpperCamelCase										=  initializer_range
							_UpperCamelCase										=  layer_norm_eps
							_UpperCamelCase										=  scale_embedding
							_UpperCamelCase										=  use_cache
							_UpperCamelCase										=  layerdrop
							_UpperCamelCase										=  activation_dropout
							super().__init__(pad_token_id=__a    ,		bos_token_id=__a    ,		eos_token_id=__a    ,		**__a)






