
"""simple docstring"""






import unittest

from parameterized import parameterized

from transformers import OpenLlamaConfig, is_torch_available, set_seed
from transformers.testing_utils import require_torch, torch_device

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
 import torch

 from transformers import OpenLlamaForCausalLM, OpenLlamaForSequenceClassification, OpenLlamaModel





class 				a__					:



     def __init__(							self :Optional[int]      ,  _lowerCamelCase :int      ,  _lowerCamelCase :List[Any]=13      ,  _lowerCamelCase :Dict=7      ,  _lowerCamelCase :List[str]=True      ,  _lowerCamelCase :Dict=True      ,  _lowerCamelCase :List[Any]=False      ,  _lowerCamelCase :List[str]=True      ,  _lowerCamelCase :Union[str, Any]=99      ,  _lowerCamelCase :str=32      ,  _lowerCamelCase :Tuple=5      ,  _lowerCamelCase :str=4      ,  _lowerCamelCase :List[Any]=37      ,  _lowerCamelCase :Optional[Any]="gelu"      ,  _lowerCamelCase :Tuple=0.1      ,  _lowerCamelCase :Dict=0.1      ,  _lowerCamelCase :Union[str, Any]=512      ,  _lowerCamelCase :str=16      ,  _lowerCamelCase :Any=2      ,  _lowerCamelCase :List[str]=0.02      ,  _lowerCamelCase :Dict=3      ,  _lowerCamelCase :Any=4      ,  _lowerCamelCase :Dict=None      ,  ):







      '''simple docstring'''



      UpperCamelCase_     :					List[Any]   	=parent
      UpperCamelCase_     :					Union[str, Any]   	=batch_size
      UpperCamelCase_     :					str   	=seq_length
      UpperCamelCase_     :					Tuple   	=is_training
      UpperCamelCase_     :					str   	=use_input_mask
      UpperCamelCase_     :					Tuple   	=use_token_type_ids
      UpperCamelCase_     :					Dict   	=use_labels
      UpperCamelCase_     :					int   	=vocab_size
      UpperCamelCase_     :					Dict   	=hidden_size
      UpperCamelCase_     :					List[str]   	=num_hidden_layers
      UpperCamelCase_     :					Optional[Any]   	=num_attention_heads
      UpperCamelCase_     :					Any   	=intermediate_size
      UpperCamelCase_     :					Union[str, Any]   	=hidden_act
      UpperCamelCase_     :					Dict   	=hidden_dropout_prob
      UpperCamelCase_     :					Optional[Any]   	=attention_probs_dropout_prob
      UpperCamelCase_     :					str   	=max_position_embeddings
      UpperCamelCase_     :					List[Any]   	=type_vocab_size
      UpperCamelCase_     :					Optional[int]   	=type_sequence_label_size
      UpperCamelCase_     :					Dict   	=initializer_range
      UpperCamelCase_     :					str   	=num_labels
      UpperCamelCase_     :					Any   	=num_choices
      UpperCamelCase_     :					Any   	=scope



     def  lowerCamelCase_						(							self :Dict   ):







      '''simple docstring'''



      UpperCamelCase_     :					Dict   	=ids_tensor([self.batch_size, self.seq_length]      ,  self.vocab_size   )

      UpperCamelCase_     :					Union[str, Any]   	=None
      if self.use_input_mask:
       UpperCamelCase_     :					Tuple   	=random_attention_mask([self.batch_size, self.seq_length]   )

      UpperCamelCase_     :					Optional[int]   	=None
      if self.use_token_type_ids:
       UpperCamelCase_     :					str   	=ids_tensor([self.batch_size, self.seq_length]      ,  self.type_vocab_size   )

      UpperCamelCase_     :					Tuple   	=None
      UpperCamelCase_     :					Optional[Any]   	=None
      UpperCamelCase_     :					List[Any]   	=None
      if self.use_labels:
       UpperCamelCase_     :					Tuple   	=ids_tensor([self.batch_size]      ,  self.type_sequence_label_size   )
       UpperCamelCase_     :					Optional[int]   	=ids_tensor([self.batch_size, self.seq_length]      ,  self.num_labels   )
       UpperCamelCase_     :					Any   	=ids_tensor([self.batch_size]      ,  self.num_choices   )

      UpperCamelCase_     :					List[Any]   	=self.get_config()

      return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels



     def  lowerCamelCase_						(							self :int   ):







      '''simple docstring'''



      return OpenLlamaConfig(
          vocab_size=self.vocab_size      ,  hidden_size=self.hidden_size      ,  num_hidden_layers=self.num_hidden_layers      ,  num_attention_heads=self.num_attention_heads      ,  intermediate_size=self.intermediate_size      ,  hidden_act=self.hidden_act      ,  hidden_dropout_prob=self.hidden_dropout_prob      ,  attention_probs_dropout_prob=self.attention_probs_dropout_prob      ,  max_position_embeddings=self.max_position_embeddings      ,  type_vocab_size=self.type_vocab_size      ,  is_decoder=_lowerCamelCase      ,  initializer_range=self.initializer_range      ,  use_stable_embedding=_lowerCamelCase      ,  )



     def  lowerCamelCase_						(							self :Dict      ,  _lowerCamelCase :Optional[Any]      ,  _lowerCamelCase :Union[str, Any]      ,  _lowerCamelCase :Union[str, Any]      ,  _lowerCamelCase :int      ,  _lowerCamelCase :Tuple      ,  _lowerCamelCase :List[str]      ,  _lowerCamelCase :Union[str, Any]   ):







      '''simple docstring'''



      UpperCamelCase_     :					str   	=OpenLlamaModel(config=_lowerCamelCase   )
      model.to(_lowerCamelCase   )
      model.eval()
      UpperCamelCase_     :					Tuple   	=model(_lowerCamelCase      ,  attention_mask=_lowerCamelCase   )
      UpperCamelCase_     :					List[str]   	=model(_lowerCamelCase   )
      self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, self.seq_length, self.hidden_size)   )



     def  lowerCamelCase_						(							self :Tuple      ,  _lowerCamelCase :Tuple      ,  _lowerCamelCase :Union[str, Any]      ,  _lowerCamelCase :List[str]      ,  _lowerCamelCase :List[Any]      ,  _lowerCamelCase :Optional[Any]      ,  _lowerCamelCase :Optional[Any]      ,  _lowerCamelCase :Dict      ,  _lowerCamelCase :List[str]      ,  _lowerCamelCase :Optional[int]      ,  ):







      '''simple docstring'''



      UpperCamelCase_     :					str   	=True
      UpperCamelCase_     :					int   	=OpenLlamaModel(_lowerCamelCase   )
      model.to(_lowerCamelCase   )
      model.eval()
      UpperCamelCase_     :					int   	=model(
          _lowerCamelCase      ,  attention_mask=_lowerCamelCase      ,  encoder_hidden_states=_lowerCamelCase      ,  encoder_attention_mask=_lowerCamelCase      ,  )
      UpperCamelCase_     :					Any   	=model(
          _lowerCamelCase      ,  attention_mask=_lowerCamelCase      ,  encoder_hidden_states=_lowerCamelCase      ,  )
      UpperCamelCase_     :					int   	=model(_lowerCamelCase      ,  attention_mask=_lowerCamelCase   )
      self.parent.assertEqual(result.last_hidden_state.shape      ,  (self.batch_size, self.seq_length, self.hidden_size)   )



     def  lowerCamelCase_						(							self :Optional[Any]      ,  _lowerCamelCase :List[Any]      ,  _lowerCamelCase :Dict      ,  _lowerCamelCase :Optional[Any]      ,  _lowerCamelCase :Union[str, Any]      ,  _lowerCamelCase :Any      ,  _lowerCamelCase :Union[str, Any]      ,  _lowerCamelCase :List[str]      ,  _lowerCamelCase :Tuple      ,  _lowerCamelCase :Dict      ,  ):







      '''simple docstring'''



      UpperCamelCase_     :					Optional[Any]   	=OpenLlamaForCausalLM(config=_lowerCamelCase   )
      model.to(_lowerCamelCase   )
      model.eval()
      UpperCamelCase_     :					int   	=model(_lowerCamelCase      ,  attention_mask=_lowerCamelCase      ,  labels=_lowerCamelCase   )
      self.parent.assertEqual(result.logits.shape      ,  (self.batch_size, self.seq_length, self.vocab_size)   )



     def  lowerCamelCase_						(							self :Dict      ,  _lowerCamelCase :Union[str, Any]      ,  _lowerCamelCase :Union[str, Any]      ,  _lowerCamelCase :Dict      ,  _lowerCamelCase :int      ,  _lowerCamelCase :List[Any]      ,  _lowerCamelCase :Dict      ,  _lowerCamelCase :Optional[int]      ,  _lowerCamelCase :int      ,  _lowerCamelCase :Tuple      ,  ):







      '''simple docstring'''



      UpperCamelCase_     :					Any   	=True
      UpperCamelCase_     :					str   	=True
      UpperCamelCase_     :					str   	=OpenLlamaForCausalLM(config=_lowerCamelCase   )
      model.to(_lowerCamelCase   )
      model.eval()

      # first forward pass
      UpperCamelCase_     :					List[str]   	=model(
          _lowerCamelCase      ,  attention_mask=_lowerCamelCase      ,  encoder_hidden_states=_lowerCamelCase      ,  encoder_attention_mask=_lowerCamelCase      ,  use_cache=_lowerCamelCase      ,  )
      UpperCamelCase_     :					Optional[int]   	=outputs.past_key_values

      # create hypothetical multiple next token and extent to next_input_ids
      UpperCamelCase_     :					Any   	=ids_tensor((self.batch_size, 3)      ,  config.vocab_size   )
      UpperCamelCase_     :					Dict   	=ids_tensor((self.batch_size, 3)      ,  vocab_size=2   )

      # append to next input_ids and
      UpperCamelCase_     :					int   	=torch.cat([input_ids, next_tokens]      ,  dim=-1   )
      UpperCamelCase_     :					str   	=torch.cat([input_mask, next_mask]      ,  dim=-1   )

      UpperCamelCase_     :					Union[str, Any]   	=model(
          _lowerCamelCase      ,  attention_mask=_lowerCamelCase      ,  encoder_hidden_states=_lowerCamelCase      ,  encoder_attention_mask=_lowerCamelCase      ,  output_hidden_states=_lowerCamelCase      ,  )['hidden_states'][0]
      UpperCamelCase_     :					Any   	=model(
          _lowerCamelCase      ,  attention_mask=_lowerCamelCase      ,  encoder_hidden_states=_lowerCamelCase      ,  encoder_attention_mask=_lowerCamelCase      ,  past_key_values=_lowerCamelCase      ,  output_hidden_states=_lowerCamelCase      ,  )['hidden_states'][0]

      # select random slice
      UpperCamelCase_     :					int   	=ids_tensor((1,)      ,  output_from_past.shape[-1]   ).item()
      UpperCamelCase_     :					Tuple   	=output_from_no_past[:, -3:, random_slice_idx].detach()
      UpperCamelCase_     :					List[Any]   	=output_from_past[:, :, random_slice_idx].detach()

      self.parent.assertTrue(output_from_past_slice.shape[1] == next_tokens.shape[1]   )

      # test that outputs are equal for slice
      self.parent.assertTrue(torch.allclose(_lowerCamelCase      ,  _lowerCamelCase      ,  atol=1E-3   )   )




     def  lowerCamelCase_						(							self :Optional[Any]   ):







      '''simple docstring'''



      UpperCamelCase_     :					Optional[Any]   	=self.prepare_config_and_inputs()
      (
          (
          UpperCamelCase_
      )	,     (
          UpperCamelCase_
      )	,     (
          UpperCamelCase_
      )	,     (
          UpperCamelCase_
      )	,     (
          UpperCamelCase_
      )	,     (
          UpperCamelCase_
      )	,     (
          UpperCamelCase_
      )	,     
      )     :					int   	=config_and_inputs
      UpperCamelCase_     :					Union[str, Any]   	={'input_ids': input_ids, 'attention_mask': input_mask}
      return config, inputs_dict





@require_torch
class 				a__					(						A__   ,							A__   ,							A__   ,							unittest.TestCase       ):
     UpperCAmelCase__         =      (
         (OpenLlamaModel, OpenLlamaForCausalLM, OpenLlamaForSequenceClassification) if is_torch_available() else ()
     )
     UpperCAmelCase__         =      (OpenLlamaForCausalLM,) if is_torch_available() else ()
     UpperCAmelCase__         =      (
         {
             '''feature-extraction''': OpenLlamaModel,
             '''text-classification''': OpenLlamaForSequenceClassification,
             '''text-generation''': OpenLlamaForCausalLM,
             '''zero-shot''': OpenLlamaForSequenceClassification,
         }
         if is_torch_available()
         else {}
     )
     UpperCAmelCase__         =      False
     UpperCAmelCase__         =      False



     def  lowerCamelCase_						(							self :List[Any]   ):







      '''simple docstring'''



      UpperCamelCase_     :					int   	=OpenLlamaModelTester(self   )
      UpperCamelCase_     :					Union[str, Any]   	=ConfigTester(self      ,  config_class=_lowerCamelCase      ,  hidden_size=37   )



     def  lowerCamelCase_						(							self :Optional[int]   ):







      '''simple docstring'''



      self.config_tester.run_common_tests()



     def  lowerCamelCase_						(							self :int   ):







      '''simple docstring'''



      UpperCamelCase_     :					Tuple   	=self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_model(*_lowerCamelCase   )



     def  lowerCamelCase_						(							self :Any   ):







      '''simple docstring'''



      UpperCamelCase_     :					Dict   	=self.model_tester.prepare_config_and_inputs()
      for type in ["absolute", "relative_key", "relative_key_query"]:
       UpperCamelCase_     :					List[str]   	=type
       self.model_tester.create_and_check_model(*_lowerCamelCase   )



     def  lowerCamelCase_						(							self :List[Any]   ):







      '''simple docstring'''



      UpperCamelCase_	,     UpperCamelCase_     :					str   	=self.model_tester.prepare_config_and_inputs_for_common()
      UpperCamelCase_     :					Any   	=3
      UpperCamelCase_     :					Union[str, Any]   	=input_dict['input_ids']
      UpperCamelCase_     :					Any   	=input_ids.ne(1   ).to(_lowerCamelCase   )
      UpperCamelCase_     :					Dict   	=ids_tensor([self.model_tester.batch_size]      ,  self.model_tester.type_sequence_label_size   )
      UpperCamelCase_     :					str   	=OpenLlamaForSequenceClassification(_lowerCamelCase   )
      model.to(_lowerCamelCase   )
      model.eval()
      UpperCamelCase_     :					str   	=model(_lowerCamelCase      ,  attention_mask=_lowerCamelCase      ,  labels=_lowerCamelCase   )
      self.assertEqual(result.logits.shape      ,  (self.model_tester.batch_size, self.model_tester.num_labels)   )



     def  lowerCamelCase_						(							self :Tuple   ):







      '''simple docstring'''



      UpperCamelCase_	,     UpperCamelCase_     :					Optional[Any]   	=self.model_tester.prepare_config_and_inputs_for_common()
      UpperCamelCase_     :					str   	=3
      UpperCamelCase_     :					Any   	='single_label_classification'
      UpperCamelCase_     :					int   	=input_dict['input_ids']
      UpperCamelCase_     :					Union[str, Any]   	=input_ids.ne(1   ).to(_lowerCamelCase   )
      UpperCamelCase_     :					str   	=ids_tensor([self.model_tester.batch_size]      ,  self.model_tester.type_sequence_label_size   )
      UpperCamelCase_     :					Tuple   	=OpenLlamaForSequenceClassification(_lowerCamelCase   )
      model.to(_lowerCamelCase   )
      model.eval()
      UpperCamelCase_     :					Any   	=model(_lowerCamelCase      ,  attention_mask=_lowerCamelCase      ,  labels=_lowerCamelCase   )
      self.assertEqual(result.logits.shape      ,  (self.model_tester.batch_size, self.model_tester.num_labels)   )



     def  lowerCamelCase_						(							self :Union[str, Any]   ):







      '''simple docstring'''



      UpperCamelCase_	,     UpperCamelCase_     :					Any   	=self.model_tester.prepare_config_and_inputs_for_common()
      UpperCamelCase_     :					int   	=3
      UpperCamelCase_     :					int   	='multi_label_classification'
      UpperCamelCase_     :					Optional[Any]   	=input_dict['input_ids']
      UpperCamelCase_     :					Dict   	=input_ids.ne(1   ).to(_lowerCamelCase   )
      UpperCamelCase_     :					List[str]   	=ids_tensor(
          [self.model_tester.batch_size, config.num_labels]      ,  self.model_tester.type_sequence_label_size   ).to(torch.float   )
      UpperCamelCase_     :					List[Any]   	=OpenLlamaForSequenceClassification(_lowerCamelCase   )
      model.to(_lowerCamelCase   )
      model.eval()
      UpperCamelCase_     :					Optional[int]   	=model(_lowerCamelCase      ,  attention_mask=_lowerCamelCase      ,  labels=_lowerCamelCase   )
      self.assertEqual(result.logits.shape      ,  (self.model_tester.batch_size, self.model_tester.num_labels)   )



     @unittest.skip('Open-Llama buffers include complex numbers, which breaks this test'   )
     def  lowerCamelCase_						(							self :List[str]   ):







      '''simple docstring'''



      pass




     @parameterized.expand([('linear',), ('dynamic',)]   )
     def  lowerCamelCase_						(							self :Any      ,  _lowerCamelCase :Dict   ):







      '''simple docstring'''



      UpperCamelCase_	,     UpperCamelCase_     :					List[Any]   	=self.model_tester.prepare_config_and_inputs_for_common()
      UpperCamelCase_     :					int   	=ids_tensor([1, 10]      ,  config.vocab_size   )
      UpperCamelCase_     :					List[str]   	=ids_tensor([1, int(config.max_position_embeddings * 1.5   )]      ,  config.vocab_size   )

      set_seed(42   )  # Fixed seed at init time so the two models get the same random weights
      UpperCamelCase_     :					Dict   	=OpenLlamaModel(_lowerCamelCase   )
      original_model.to(_lowerCamelCase   )
      original_model.eval()
      UpperCamelCase_     :					Optional[Any]   	=original_model(_lowerCamelCase   ).last_hidden_state
      UpperCamelCase_     :					str   	=original_model(_lowerCamelCase   ).last_hidden_state

      set_seed(42   )  # Fixed seed at init time so the two models get the same random weights
      UpperCamelCase_     :					Optional[int]   	={'type': scaling_type, 'factor': 10.0}
      UpperCamelCase_     :					str   	=OpenLlamaModel(_lowerCamelCase   )
      scaled_model.to(_lowerCamelCase   )
      scaled_model.eval()
      UpperCamelCase_     :					List[str]   	=scaled_model(_lowerCamelCase   ).last_hidden_state
      UpperCamelCase_     :					str   	=scaled_model(_lowerCamelCase   ).last_hidden_state

      # Dynamic scaling does not change the RoPE embeddings until it receives an input longer than the original
      # maximum sequence length, so the outputs for the short input should match.
      if scaling_type == "dynamic":
       self.assertTrue(torch.allclose(_lowerCamelCase      ,  _lowerCamelCase      ,  atol=1E-5   )   )
      else:
       self.assertFalse(torch.allclose(_lowerCamelCase      ,  _lowerCamelCase      ,  atol=1E-5   )   )

      # The output should be different for long inputs
      self.assertFalse(torch.allclose(_lowerCamelCase      ,  _lowerCamelCase      ,  atol=1E-5   )   )


"""simple docstring"""






from manim import *





class 				a__					(						A__       ):



     def  lowerCamelCase_						(							self :List[Any]   ):







      '''simple docstring'''



      UpperCamelCase_     :					Tuple   	=Rectangle(height=0.5      ,  width=0.5   )
      UpperCamelCase_     :					Any   	=Rectangle(height=0.46      ,  width=0.46   ).set_stroke(width=0   )

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

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

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

      UpperCamelCase_     :					Optional[int]   	=Text('Model'      ,  font_size=24   )
      UpperCamelCase_     :					List[Any]   	=Group(_lowerCamelCase      ,  _lowerCamelCase   ).arrange(_lowerCamelCase      ,  buff=0.5      ,  aligned_edge=_lowerCamelCase   )
      model.move_to([3, -1.0, 0]   )
      self.add(_lowerCamelCase   )

      UpperCamelCase_     :					int   	=[]
      for i, rect in enumerate(_lowerCamelCase   ):
       rect.set_stroke(_lowerCamelCase   )
       # target = fill.copy().set_fill(YELLOW, opacity=0.7)
       # target.move_to(rect)
       # self.add(target)

       UpperCamelCase_     :					str   	=Rectangle(height=0.46 / 4      ,  width=0.46 / 3   ).set_stroke(width=0.0   ).set_fill(_lowerCamelCase      ,  opacity=0.7   )

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

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

      UpperCamelCase_     :					Optional[int]   	=Text('Loaded Checkpoint'      ,  font_size=24   )
      UpperCamelCase_     :					List[Any]   	=Group(_lowerCamelCase      ,  _lowerCamelCase   ).arrange(_lowerCamelCase      ,  aligned_edge=_lowerCamelCase      ,  buff=0.4   )
      checkpoint.move_to([3, 0.5, 0]   )

      UpperCamelCase_     :					int   	=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]   )

      self.add(_lowerCamelCase      ,  _lowerCamelCase   )

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

      blue_text.next_to(_lowerCamelCase      ,  DOWN * 2.4      ,  aligned_edge=key_text.get_left()   )

      UpperCamelCase_     :					Dict   	=MarkupText(
          f'''Next, a <i><span fgcolor="{BLUE}">second</span></i> model is loaded into memory,\nwith the weights of a <span fgcolor="{BLUE}">single shard</span>.'''      ,  font_size=24      ,  )
      step_a.move_to([2, 2, 0]   )
      self.play(Write(_lowerCamelCase   )      ,  Write(_lowerCamelCase   )   )

      self.play(Write(_lowerCamelCase      ,  run_time=1   )      ,  Create(_lowerCamelCase      ,  run_time=1   )   )

      UpperCamelCase_     :					Union[str, Any]   	=[]
      UpperCamelCase_     :					List[Any]   	=[]
      for i, rect in enumerate(_lowerCamelCase   ):
       UpperCamelCase_     :					str   	=fill.copy().set_fill(_lowerCamelCase      ,  opacity=0.7   )
       target.move_to(_lowerCamelCase   )
       first_animations.append(GrowFromCenter(_lowerCamelCase      ,  run_time=1   )   )

       UpperCamelCase_     :					Any   	=target.copy()
       cpu_target.generate_target()
       if i < 5:
        cpu_target.target.move_to(cpu_left_col_base[i + 1]   )
       else:
        cpu_target.target.move_to(cpu_right_col_base[i - 5]   )
       second_animations.append(MoveToTarget(_lowerCamelCase      ,  run_time=1.5   )   )

      self.play(*_lowerCamelCase   )
      self.play(*_lowerCamelCase   )
      self.wait()
