



"""simple docstring"""
from manim import *
class 							_UpperCAmelCase							( a      ):





     '''simple docstring'''



     def  __lowerCAmelCase	(					self		)							->					Dict:
         _UpperCAmelCase							:  Any											=    Rectangle(height=0.5       ,	width=0.5		)
         _UpperCAmelCase							:  Tuple											=    Rectangle(height=0.46       ,	width=0.46		).set_stroke(width=0		)

         _UpperCAmelCase							:  int											=    [mem.copy() for i in range(6		)]
         _UpperCAmelCase							:  Dict											=    [mem.copy() for i in range(6		)]
         _UpperCAmelCase							:  int											=    VGroup(*A		).arrange(A       ,	buff=0		)
         _UpperCAmelCase							:  str											=    VGroup(*A		).arrange(A       ,	buff=0		)
         _UpperCAmelCase							:  Tuple											=    VGroup(A       ,	A		).arrange(A       ,	buff=0		)
         _UpperCAmelCase							:  str											=    Text('''CPU'''       ,	font_size=2_4		)
         _UpperCAmelCase							:  List[Any]											=    Group(A       ,	A		).arrange(A       ,	buff=0.5       ,	aligned_edge=A		)
         cpu.move_to([-2.5, -0.5, 0]		)
         self.add(A		)

         _UpperCAmelCase							:  Tuple											=    [mem.copy() for i in range(1		)]
         _UpperCAmelCase							:  List[Any]											=    VGroup(*A		).arrange(A       ,	buff=0		)
         _UpperCAmelCase							:  Union[str, Any]											=    Text('''GPU'''       ,	font_size=2_4		)
         _UpperCAmelCase							:  Optional[int]											=    Group(A       ,	A		).arrange(A       ,	buff=0.5       ,	aligned_edge=A		)
         gpu.align_to(A       ,	A		)
         gpu.set_x(gpu.get_x() - 1		)

         self.add(A		)

         _UpperCAmelCase							:  int											=    [mem.copy() for i in range(6		)]
         _UpperCAmelCase							:  Optional[int]											=    VGroup(*A		).arrange(A       ,	buff=0		)

         _UpperCAmelCase							:  Tuple											=    Text('''Model'''       ,	font_size=2_4		)
         _UpperCAmelCase							:  Optional[Any]											=    Group(A       ,	A		).arrange(A       ,	buff=0.5       ,	aligned_edge=A		)
         model.move_to([3, -1.0, 0]		)

         self.play(
             Create(A       ,	run_time=1		)       ,	Create(A       ,	run_time=1		)       ,	Create(A       ,	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=2_4       ,	)

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

         _UpperCAmelCase							:  List[Any]											=    MarkupText(
             f'<b>Key:</b>\n\n<span fgcolor=\'{YELLOW}\'>●</span> Empty Model'       ,	font_size=1_8       ,	)

         key_text.move_to([-5, 2.4, 0]		)

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

         self.add(A		)

         _UpperCAmelCase							:  Optional[int]											=    []
         _UpperCAmelCase							:  List[str]											=    []
         _UpperCAmelCase							:  Optional[Any]											=    []
         for i, rect in enumerate(A		):
             _UpperCAmelCase							:  Union[str, Any]											=    Rectangle(height=0.46       ,	width=0.46		).set_stroke(width=0.0		).set_fill(A       ,	opacity=0.7		)
             cpu_target.move_to(A		)
             cpu_target.generate_target()
             _UpperCAmelCase							:  Dict											=    0.46 / 4
             _UpperCAmelCase							:  str											=    0.46 / 3

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

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

         self.play(*A		)
         self.play(*A		)

         self.wait()







"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_lowerCAmelCase    :List[Any]     =					{'configuration_opt': ['OPT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'OPTConfig']}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _lowerCAmelCase    :Any     =					[
      'OPT_PRETRAINED_MODEL_ARCHIVE_LIST',
      'OPTForCausalLM',
      'OPTModel',
      'OPTPreTrainedModel',
      'OPTForSequenceClassification',
      'OPTForQuestionAnswering',
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _lowerCAmelCase    :Optional[int]     =					['TFOPTForCausalLM', 'TFOPTModel', 'TFOPTPreTrainedModel']

try:
  if not is_flax_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _lowerCAmelCase    :Any     =					[
      'FlaxOPTForCausalLM',
      'FlaxOPTModel',
      'FlaxOPTPreTrainedModel',
  ]


if TYPE_CHECKING:
  from .configuration_opt import OPT_PRETRAINED_CONFIG_ARCHIVE_MAP, OPTConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_opt import (
        OPT_PRETRAINED_MODEL_ARCHIVE_LIST,
        OPTForCausalLM,
        OPTForQuestionAnswering,
        OPTForSequenceClassification,
        OPTModel,
        OPTPreTrainedModel,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_opt import TFOPTForCausalLM, TFOPTModel, TFOPTPreTrainedModel

  try:
    if not is_flax_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_flax_opt import FlaxOPTForCausalLM, FlaxOPTModel, FlaxOPTPreTrainedModel

else:
  import sys

  _lowerCAmelCase    :int     =					_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


