





from manim import *

class    _UpperCAmelCase							(		_lowerCamelCase     ):
      def 		_lowerCamelCase      (		self       ):
         A_     :				Optional[int]			      =	Rectangle(height=0.5      ,       width=0.5       )
         A_     :				str			      =	Rectangle(height=0.46      ,       width=0.46       ).set_stroke(width=0       )

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

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

         A_     :				Any			      =	[mem.copy() for i in range(6       )]
         A_     :				Tuple			      =	VGroup(*a__       ).arrange(a__      ,       buff=0       )

         A_     :				List[str]			      =	Text("""Model"""      ,       font_size=24       )
         A_     :				Optional[Any]			      =	Group(a__      ,       a__       ).arrange(a__      ,       buff=0.5      ,       aligned_edge=a__       )
         model.move_to([3, -1.0, 0]       )
         self.add(a__       )

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

            A_     :				List[str]			      =	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(cpu_targs[0]      ,       direction=a__      ,       buff=0.0       )
            else:
               cpu_target.next_to(cpu_targs[i - 1]      ,       direction=a__      ,       buff=0.0       )
            self.add(a__       )
            cpu_targs.append(a__       )

         A_     :				Tuple			      =	[mem.copy() for i in range(6       )]
         A_     :				Any			      =	VGroup(*a__       ).arrange(a__      ,       buff=0       )

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

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

         A_     :				Tuple			      =	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__       )

         A_     :				Dict			      =	MarkupText(
             F"""<span fgcolor='{BLUE}'>●</span> Checkpoint"""      ,       font_size=18      ,       )

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

         A_     :				int			      =	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(a__       )      ,       Write(a__       )       )

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

         A_     :				str			      =	[]
         A_     :				str			      =	[]
         for i, rect in enumerate(a__       ):
            A_     :				int			      =	fill.copy().set_fill(a__      ,       opacity=0.7       )
            target.move_to(a__       )
            first_animations.append(GrowFromCenter(a__      ,       run_time=1       )       )

            A_     :				Tuple			      =	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(a__      ,       run_time=1.5       )       )

         self.play(*a__       )
         self.play(*a__       )
         self.wait()













# coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this script dumps information about the environment

import os
import sys

import transformers


_lowerCAmelCase 				=     """3"""

print("""Python version:""", sys.version)
print("""transformers version:""", transformers.__version__)

try:
      import torch

      print("""Torch version:""", torch.__version__)
      print("""Cuda available:""", torch.cuda.is_available())
      print("""Cuda version:""", torch.version.cuda)
      print("""CuDNN version:""", torch.backends.cudnn.version())
      print("""Number of GPUs available:""", torch.cuda.device_count())
      print("""NCCL version:""", torch.cuda.nccl.version())
except ImportError:
      print("""Torch version:""", None)

try:
      import deepspeed

      print("""DeepSpeed version:""", deepspeed.__version__)
except ImportError:
      print("""DeepSpeed version:""", None)

try:
      import tensorflow as tf

      print("""TensorFlow version:""", tf.__version__)
      print("""TF GPUs available:""", bool(tf.config.list_physical_devices("""GPU""")))
      print("""Number of TF GPUs available:""", len(tf.config.list_physical_devices("""GPU""")))
except ImportError:
      print("""TensorFlow version:""", None)






