






"""simple docstring"""
from manim import *







class      UpperCamelCase_			(__A	):





	def 	_SCREAMING_SNAKE_CASE ( self   :					Any		)		->     Dict:
				UpperCAmelCase_	:					List[Any]     	=   Rectangle(height=0.5      ,      width=0.5		)
				UpperCAmelCase_	:					Optional[int]     	=   Rectangle(height=0.4_6      ,      width=0.4_6		).set_stroke(width=0		)

				UpperCAmelCase_	:					List[str]     	=   [mem.copy() for i in range(6		)]
				UpperCAmelCase_	:					int     	=   [mem.copy() for i in range(6		)]
				UpperCAmelCase_	:					Union[str, Any]     	=   VGroup(*lowerCAmelCase_		).arrange(lowerCAmelCase_      ,      buff=0		)
				UpperCAmelCase_	:					Optional[int]     	=   VGroup(*lowerCAmelCase_		).arrange(lowerCAmelCase_      ,      buff=0		)
				UpperCAmelCase_	:					List[Any]     	=   VGroup(lowerCAmelCase_      ,      lowerCAmelCase_		).arrange(lowerCAmelCase_      ,      buff=0		)
				UpperCAmelCase_	:					Tuple     	=   Text("CPU"      ,      font_size=24		)
				UpperCAmelCase_	:					Tuple     	=   Group(lowerCAmelCase_      ,      lowerCAmelCase_		).arrange(lowerCAmelCase_      ,      buff=0.5      ,      aligned_edge=lowerCAmelCase_		)
				cpu.move_to([-2.5, -0.5, 0]		)
				self.add(lowerCAmelCase_		)

				UpperCAmelCase_	:					Optional[Any]     	=   [mem.copy() for i in range(1		)]
				UpperCAmelCase_	:					Optional[Any]     	=   VGroup(*lowerCAmelCase_		).arrange(lowerCAmelCase_      ,      buff=0		)
				UpperCAmelCase_	:					Union[str, Any]     	=   Text("GPU"      ,      font_size=24		)
				UpperCAmelCase_	:					Tuple     	=   Group(lowerCAmelCase_      ,      lowerCAmelCase_		).arrange(lowerCAmelCase_      ,      buff=0.5      ,      aligned_edge=lowerCAmelCase_		)
				gpu.align_to(lowerCAmelCase_      ,      lowerCAmelCase_		)
				gpu.set_x(gpu.get_x() - 1		)

				self.add(lowerCAmelCase_		)

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

				UpperCAmelCase_	:					int     	=   Text("Model"      ,      font_size=24		)
				UpperCAmelCase_	:					str     	=   Group(lowerCAmelCase_      ,      lowerCAmelCase_		).arrange(lowerCAmelCase_      ,      buff=0.5      ,      aligned_edge=lowerCAmelCase_		)
				model.move_to([3, -1.0, 0]		)

				self.play(
				    Create(lowerCAmelCase_      ,      run_time=1		)      ,      Create(lowerCAmelCase_      ,      run_time=1		)      ,      Create(lowerCAmelCase_      ,      run_time=1		)      ,      )

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

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

				UpperCAmelCase_	:					Optional[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]		)

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

				self.add(lowerCAmelCase_		)

				UpperCAmelCase_	:					Tuple     	=   []
				UpperCAmelCase_	:					Union[str, Any]     	=   []
				UpperCAmelCase_	:					Union[str, Any]     	=   []
				for i, rect in enumerate(lowerCAmelCase_		):
							UpperCAmelCase_	:					List[str]     	=   Rectangle(height=0.4_6      ,      width=0.4_6		).set_stroke(width=0.0		).set_fill(lowerCAmelCase_      ,      opacity=0.7		)
							cpu_target.move_to(lowerCAmelCase_		)
							cpu_target.generate_target()
							UpperCAmelCase_	:					Union[str, Any]     	=   0.4_6 / 4
							UpperCAmelCase_	:					str     	=   0.4_6 / 3

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

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

				self.play(*lowerCAmelCase_		)
				self.play(*lowerCAmelCase_		)

				self.wait()








"""simple docstring"""

from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


A_						:    Optional[int]				=      {
    'configuration_llama': ['LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP', 'LlamaConfig'],
}

try:
							if not is_sentencepiece_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							A_						:    int				=      ['LlamaTokenizer']

try:
							if not is_tokenizers_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							A_						:    List[str]				=      ['LlamaTokenizerFast']

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							A_						:    List[str]				=      [
							    'LlamaForCausalLM',
							    'LlamaModel',
							    'LlamaPreTrainedModel',
							    'LlamaForSequenceClassification',
							]


if TYPE_CHECKING:
							from .configuration_llama import LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP, LlamaConfig

							try:
														if not is_sentencepiece_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_llama import LlamaTokenizer

							try:
														if not is_tokenizers_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_llama_fast import LlamaTokenizerFast

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_llama import LlamaForCausalLM, LlamaForSequenceClassification, LlamaModel, LlamaPreTrainedModel


else:
							import sys

							A_						:    str				=      _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





