
from manim import *

class        _UpperCamelCase				(					_A  ):






			'''simple docstring'''

			def       lowerCAmelCase__	(       self :       List[Any]      ):
							UpperCamelCase_:							Optional[Any]	=						Rectangle(height=0.5						,	width=0.5      )
							UpperCamelCase_:							List[str]	=						Rectangle(height=0.25						,	width=0.25      )
							UpperCamelCase_:							List[str]	=						Rectangle(height=0.46						,	width=0.46      ).set_stroke(width=0      )

							UpperCamelCase_:							str	=						[mem.copy() for i in range(6      )]
							UpperCamelCase_:							List[str]	=						[mem.copy() for i in range(6      )]
							UpperCamelCase_:							Optional[Any]	=						VGroup(*snake_case_      ).arrange(snake_case_						,	buff=0      )
							UpperCamelCase_:							Union[str, Any]	=						VGroup(*snake_case_      ).arrange(snake_case_						,	buff=0      )
							UpperCamelCase_:							List[str]	=						VGroup(snake_case_						,	snake_case_      ).arrange(snake_case_						,	buff=0      )
							UpperCamelCase_:							Dict	=						Text("""CPU"""						,	font_size=24      )
							UpperCamelCase_:							Optional[int]	=						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_      )

							UpperCamelCase_:							str	=						[mem.copy() for i in range(4      )]
							UpperCamelCase_:							List[str]	=						VGroup(*snake_case_      ).arrange(snake_case_						,	buff=0      )
							UpperCamelCase_:							Any	=						Text("""GPU"""						,	font_size=24      )
							UpperCamelCase_:							Optional[Any]	=						Group(snake_case_						,	snake_case_      ).arrange(snake_case_						,	buff=0.5						,	aligned_edge=snake_case_      )
							gpu.move_to([-1, -1, 0]      )
							self.add(snake_case_      )

							UpperCamelCase_:							Optional[Any]	=						[mem.copy() for i in range(6      )]
							UpperCamelCase_:							str	=						VGroup(*snake_case_      ).arrange(snake_case_						,	buff=0      )

							UpperCamelCase_:							Tuple	=						Text("""Model"""						,	font_size=24      )
							UpperCamelCase_:							str	=						Group(snake_case_						,	snake_case_      ).arrange(snake_case_						,	buff=0.5						,	aligned_edge=snake_case_      )
							model.move_to([3, -1.0, 0]      )
							self.add(snake_case_      )

							UpperCamelCase_:							List[str]	=						[]
							UpperCamelCase_:							Optional[int]	=						[]
							UpperCamelCase_:							List[Any]	=						[]

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

											UpperCamelCase_:							List[Any]	=						Rectangle(height=0.46 / 4						,	width=0.46 / 3      ).set_stroke(width=0.0      ).set_fill(snake_case_						,	opacity=0.7      )

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

							self.add(*snake_case_						,	*snake_case_						,	*snake_case_      )

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

							UpperCamelCase_:							Union[str, Any]	=						Text("""Loaded Checkpoint"""						,	font_size=24      )
							UpperCamelCase_:							List[Any]	=						Group(snake_case_						,	snake_case_      ).arrange(snake_case_						,	buff=0.5						,	aligned_edge=snake_case_      )
							checkpoint.move_to([3, 0.5, 0]      )

							self.add(snake_case_      )

							UpperCamelCase_:							Union[str, Any]	=						[]
							UpperCamelCase_:							str	=						[]

							for i, rect in enumerate(snake_case_      ):
											UpperCamelCase_:							Optional[int]	=						fill.copy().set_fill(snake_case_						,	opacity=0.7      )
											target.move_to(snake_case_      )
											ckpt_arr.append(snake_case_      )

											UpperCamelCase_:							List[str]	=						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(snake_case_      )
							self.add(*snake_case_						,	*snake_case_      )

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

							UpperCamelCase_:							Union[str, Any]	=						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(snake_case_						,	snake_case_      )

							UpperCamelCase_:							int	=						MarkupText(
							    f'''<span fgcolor=\'{BLUE}\'>●</span> Checkpoint'''						,	font_size=18						,	)

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

							UpperCamelCase_:							List[str]	=						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_:							Any	=						[meta_mem.copy() for i in range(6      )]
							UpperCamelCase_:							Union[str, Any]	=						[meta_mem.copy() for i in range(6      )]
							UpperCamelCase_:							Any	=						VGroup(*snake_case_      ).arrange(snake_case_						,	buff=0      )
							UpperCamelCase_:							Union[str, Any]	=						VGroup(*snake_case_      ).arrange(snake_case_						,	buff=0      )
							UpperCamelCase_:							List[str]	=						VGroup(snake_case_						,	snake_case_      ).arrange(snake_case_						,	buff=0      )
							UpperCamelCase_:							List[str]	=						Text("""Disk"""						,	font_size=24      )
							UpperCamelCase_:							int	=						Group(snake_case_						,	snake_case_      ).arrange(snake_case_						,	buff=0.5						,	aligned_edge=snake_case_      )
							disk.move_to([-4.0, -1.25, 0]      )
							self.play(Write(snake_case_						,	run_time=3      )						,	Write(snake_case_						,	run_time=1      )						,	Create(snake_case_						,	run_time=1      )      )

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

							self.play(FadeOut(snake_case_      )      )

							UpperCamelCase_:							Optional[int]	=						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(snake_case_						,	run_time=3      )      )

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

							self.wait()








lowerCamelCase_						: Optional[Any]         =  """
# Transformers installation
! pip install transformers datasets
# To install from source instead of the last release, comment the command above and uncomment the following one.
# ! pip install git+https://github.com/huggingface/transformers.git
"""

lowerCamelCase_						: Union[str, Any]         =  [{"""type""": """code""", """content""": INSTALL_CONTENT}]
lowerCamelCase_						: Optional[Any]         =  {
    """{processor_class}""": """FakeProcessorClass""",
    """{model_class}""": """FakeModelClass""",
    """{object_class}""": """FakeObjectClass""",
}






