






from manim import *






class 						UpperCAmelCase__ (							__snake_case							):







		def  A__      (					self		):
						_A	:				Tuple   =      Rectangle(height=0.5       ,width=0.5		)
						_A	:				Optional[int]   =      Rectangle(height=0.46       ,width=0.46		).set_stroke(width=0		)

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

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

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

						_A	:				Union[str, Any]   =      Text('''Model'''       ,font_size=24		)
						_A	:				List[Any]   =      Group(A__       ,A__		).arrange(A__       ,buff=0.5       ,aligned_edge=A__		)
						model.move_to([3, -1.0, 0]		)
						self.add(A__		)

						_A	:				str   =      []
						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	:				Dict   =      [mem.copy() for i in range(6		)]
						_A	:				List[str]   =      VGroup(*A__		).arrange(A__       ,buff=0		)

						_A	:				Tuple   =      Text('''Loaded Checkpoint'''       ,font_size=24		)
						_A	:				Optional[Any]   =      Group(A__       ,A__		).arrange(A__       ,aligned_edge=A__       ,buff=0.4		)
						checkpoint.move_to([3, 0.5, 0]		)

						_A	:				Optional[int]   =      Square(side_length=2.2		)
						key.move_to([-5, 2, 0]		)

						_A	:				Union[str, 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(A__       ,A__		)

						_A	:				Any   =      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	:				List[Any]   =      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	:				List[Any]   =      []
						_A	:				List[Any]   =      []
						for i, rect in enumerate(A__		):
										_A	:				Optional[int]   =      fill.copy().set_fill(A__       ,opacity=0.7		)
										target.move_to(A__		)
										first_animations.append(GrowFromCenter(A__       ,run_time=1		)		)

										_A	:				List[str]   =      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()











from ...configuration_utils import PretrainedConfig
from ...utils import logging


_UpperCamelCase			:	Optional[int]								=logging.get_logger(__name__)

_UpperCamelCase			:	Tuple								={
    'google/canine-s': 'https://huggingface.co/google/canine-s/resolve/main/config.json',
    # See all CANINE models at https://huggingface.co/models?filter=canine
}






class 						UpperCAmelCase__ (							__snake_case							):
		__snake_case      :       Any     =   "canine"







		def __init__(					self       ,A__=768       ,A__=12       ,A__=12       ,A__=3072       ,A__="gelu"       ,A__=0.1       ,A__=0.1       ,A__=16384       ,A__=16       ,A__=0.02       ,A__=1E-12       ,A__=0       ,A__=0xE_000       ,A__=0xE_001       ,A__=4       ,A__=4       ,A__=8       ,A__=16384       ,A__=128       ,**A__       ,):
						super().__init__(pad_token_id=A__       ,bos_token_id=A__       ,eos_token_id=A__       ,**A__		)

						_A	:				int   =      max_position_embeddings
						_A	:				Dict   =      hidden_size
						_A	:				List[str]   =      num_hidden_layers
						_A	:				Optional[Any]   =      num_attention_heads
						_A	:				Optional[Any]   =      intermediate_size
						_A	:				Optional[Any]   =      hidden_act
						_A	:				str   =      hidden_dropout_prob
						_A	:				Optional[int]   =      attention_probs_dropout_prob
						_A	:				Union[str, Any]   =      initializer_range
						_A	:				Dict   =      type_vocab_size
						_A	:				Optional[Any]   =      layer_norm_eps

						# Character config:
						_A	:				Union[str, Any]   =      downsampling_rate
						_A	:				List[str]   =      upsampling_kernel_size
						_A	:				str   =      num_hash_functions
						_A	:				Optional[Any]   =      num_hash_buckets
						_A	:				Optional[Any]   =      local_transformer_stride



