





from manim import *



class    __lowerCAmelCase			(     _a	):






			def      lowerCamelCase    (self       )	->  int:


							'''simple docstring'''



							snake_case_		:       Union[str, Any]           =    Rectangle(height=0.5   ,				width=0.5       )
							snake_case_		:       List[str]           =    Rectangle(height=0.25   ,				width=0.25       )
							snake_case_		:       Any           =    Rectangle(height=0.46   ,				width=0.46       ).set_stroke(width=0       )

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

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

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

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

							snake_case_		:       List[str]           =    []
							snake_case_		:       List[Any]           =    []
							snake_case_		:       str           =    []

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

											snake_case_		:       Tuple           =    Rectangle(height=0.46 / 4   ,				width=0.46 / 3       ).set_stroke(width=0.0       ).set_fill(__magic_name__   ,				opacity=0.7       )

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

							self.add(*__magic_name__   ,				*__magic_name__   ,				*__magic_name__       )

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

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

							self.add(__magic_name__       )

							snake_case_		:       str           =    []
							snake_case_		:       Tuple           =    []

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

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

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

							snake_case_		:       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(__magic_name__   ,				__magic_name__       )

							snake_case_		:       List[str]           =    MarkupText(
							    F'''<span fgcolor=\'{BLUE}\'>●</span> Checkpoint'''   ,				font_size=18   ,				)

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

							snake_case_		:       Tuple           =    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]       )

							snake_case_		:       Optional[Any]           =    [meta_mem.copy() for i in range(6       )]
							snake_case_		:       List[str]           =    [meta_mem.copy() for i in range(6       )]
							snake_case_		:       Union[str, Any]           =    VGroup(*__magic_name__       ).arrange(__magic_name__   ,				buff=0       )
							snake_case_		:       Optional[Any]           =    VGroup(*__magic_name__       ).arrange(__magic_name__   ,				buff=0       )
							snake_case_		:       List[Any]           =    VGroup(__magic_name__   ,				__magic_name__       ).arrange(__magic_name__   ,				buff=0       )
							snake_case_		:       Dict           =    Text('''Disk'''   ,				font_size=24       )
							snake_case_		:       Union[str, Any]           =    Group(__magic_name__   ,				__magic_name__       ).arrange(__magic_name__   ,				buff=0.5   ,				aligned_edge=__magic_name__       )
							disk.move_to([-4.0, -1.25, 0]       )
							self.play(Write(__magic_name__   ,				run_time=3       )   ,				Write(__magic_name__   ,				run_time=1       )   ,				Create(__magic_name__   ,				run_time=1       )       )

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

							self.play(FadeOut(__magic_name__       )       )

							snake_case_		:       Dict           =    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(__magic_name__   ,				run_time=3       )       )

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

							self.wait()




"""simple docstring"""



from typing import TYPE_CHECKING

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


lowercase_							=							{
    'configuration_mobilebert': [
        'MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'MobileBertConfig',
        'MobileBertOnnxConfig',
    ],
    'tokenization_mobilebert': ['MobileBertTokenizer'],
}

try:
		if not is_tokenizers_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase_							=							['MobileBertTokenizerFast']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase_							=							[
		    'MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'MobileBertForMaskedLM',
		    'MobileBertForMultipleChoice',
		    'MobileBertForNextSentencePrediction',
		    'MobileBertForPreTraining',
		    'MobileBertForQuestionAnswering',
		    'MobileBertForSequenceClassification',
		    'MobileBertForTokenClassification',
		    'MobileBertLayer',
		    'MobileBertModel',
		    'MobileBertPreTrainedModel',
		    'load_tf_weights_in_mobilebert',
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase_							=							[
		    'TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'TFMobileBertForMaskedLM',
		    'TFMobileBertForMultipleChoice',
		    'TFMobileBertForNextSentencePrediction',
		    'TFMobileBertForPreTraining',
		    'TFMobileBertForQuestionAnswering',
		    'TFMobileBertForSequenceClassification',
		    'TFMobileBertForTokenClassification',
		    'TFMobileBertMainLayer',
		    'TFMobileBertModel',
		    'TFMobileBertPreTrainedModel',
		]


if TYPE_CHECKING:
		from .configuration_mobilebert import (
		    MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    MobileBertConfig,
		    MobileBertOnnxConfig,
		)
		from .tokenization_mobilebert import MobileBertTokenizer

		try:
				if not is_tokenizers_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .tokenization_mobilebert_fast import MobileBertTokenizerFast

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_mobilebert import (
				    MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    MobileBertForMaskedLM,
				    MobileBertForMultipleChoice,
				    MobileBertForNextSentencePrediction,
				    MobileBertForPreTraining,
				    MobileBertForQuestionAnswering,
				    MobileBertForSequenceClassification,
				    MobileBertForTokenClassification,
				    MobileBertLayer,
				    MobileBertModel,
				    MobileBertPreTrainedModel,
				    load_tf_weights_in_mobilebert,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_mobilebert import (
				    TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFMobileBertForMaskedLM,
				    TFMobileBertForMultipleChoice,
				    TFMobileBertForNextSentencePrediction,
				    TFMobileBertForPreTraining,
				    TFMobileBertForQuestionAnswering,
				    TFMobileBertForSequenceClassification,
				    TFMobileBertForTokenClassification,
				    TFMobileBertMainLayer,
				    TFMobileBertModel,
				    TFMobileBertPreTrainedModel,
				)

else:
		import sys

		lowercase_							=							_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)