"""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(		__UpperCAmelCase=10      ):






	"""simple docstring"""





	for _ in tqdm(range(0  ,args.n_examples  ,__UpperCAmelCase      )      ):
		yield [next(__UpperCAmelCase      )[args.text_column] for _ in range(__UpperCAmelCase      )]


# Configuration
SCREAMING_SNAKE_CASE						=    HfArgumentParser(TokenizerTrainingArguments)
SCREAMING_SNAKE_CASE						=    parser.parse_args()

# Base tokenizer
SCREAMING_SNAKE_CASE						=    AutoTokenizer.from_pretrained(args.base_tokenizer)
SCREAMING_SNAKE_CASE						=    list(bytes_to_unicode().values())

# Load dataset
SCREAMING_SNAKE_CASE						=    load_dataset(args.dataset_name, split='train', streaming=True)
SCREAMING_SNAKE_CASE						=    iter(dataset)


# Training and saving
SCREAMING_SNAKE_CASE						=    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"""







def   __lowerCAmelCase(		__UpperCAmelCase  ,__UpperCAmelCase      ):






	"""simple docstring"""





	if n == 0:
		return 1

	elif n % 2 == 1:
		return binary_exponentiation(__UpperCAmelCase  ,n - 1      ) * a

	else:
		_lowercase			:     Dict      					=				binary_exponentiation(__UpperCAmelCase  ,n / 2      )
		return b * b


if __name__ == "__main__":
						try:
												SCREAMING_SNAKE_CASE						=    int(input('Enter Base : ').strip())
												SCREAMING_SNAKE_CASE						=    int(input('Enter Power : ').strip())
						except ValueError:
												print('Invalid literal for integer')

						SCREAMING_SNAKE_CASE						=    binary_exponentiation(BASE, POWER)
						print(f"""{BASE}^({POWER}) : {RESULT}""")



