





'''simple docstring'''







from arguments import TokenizerTrainingArguments
from datasets import load_dataset
from tqdm import tqdm

from transformers import AutoTokenizer, HfArgumentParser
from transformers.models.gpta.tokenization_gpta import bytes_to_unicode





def 							lowerCamelCase_   (	SCREAMING_SNAKE_CASE__   :      str=10 )			->						List[str]:
						for _ in tqdm(range(0,      args.n_examples,      SCREAMING_SNAKE_CASE__ ) ):
												yield [next(SCREAMING_SNAKE_CASE__ )[args.text_column] for _ in range(SCREAMING_SNAKE_CASE__ )]


# Configuration
snake_case_  :							List[Any]            =	HfArgumentParser(TokenizerTrainingArguments)
snake_case_  :							Optional[int]            =	parser.parse_args()

# Base tokenizer
snake_case_  :							Union[str, Any]            =	AutoTokenizer.from_pretrained(args.base_tokenizer)
snake_case_  :							Optional[int]            =	list(bytes_to_unicode().values())

# Load dataset
snake_case_  :							Tuple            =	load_dataset(args.dataset_name, split="train", streaming=True)
snake_case_  :							Any            =	iter(dataset)


# Training and saving
snake_case_  :							Optional[int]            =	tokenizer.train_new_from_iterator(
    batch_iterator(), vocab_size=args.vocab_size, initial_alphabet=base_vocab
)
new_tokenizer.save_pretrained(args.tokenizer_name, push_to_hub=args.push_to_hub)








"""simple docstring"""

import os





def 					__UpperCamelCase (     )					->      int:




					"""simple docstring"""



					__lowercase        =      os.path.dirname(os.path.realpath(a__      )      )
					__lowercase        =      os.path.join(a__			,						'''triangle.txt'''      )

					with open(a__      ) as f:
										__lowercase        =      f.readlines()

					__lowercase        =      [[int(a__      ) for y in x.rstrip('''\r\n'''      ).split(''' '''      )] for x in triangle]

					for i in range(1			,						len(a__      )      ):
										for j in range(len(a[i]      )      ):
															__lowercase        =      a[i - 1][j] if j != len(a[i - 1]      ) else 0
															__lowercase        =      a[i - 1][j - 1] if j > 0 else 0
															a[i][j] += max(a__			,						a__      )
					return max(a[-1]      )


if __name__ == "__main__":
							print(solution())


