




"""simple docstring"""

import argparse
import json
import os

import evaluate
import torch
from datasets import load_dataset
from torch.optim import AdamW
from torch.utils.data import DataLoader
from transformers import AutoModelForSequenceClassification, AutoTokenizer, get_linear_schedule_with_warmup, set_seed

from accelerate import Accelerator, DistributedType
from accelerate.utils.deepspeed import DummyOptim, DummyScheduler


_lowerCamelCase  :			List[Any]        =       16
_lowerCamelCase  :			List[Any]        =       32

def 		lowercase_      (		_UpperCAmelCase  ,      _UpperCAmelCase = 16  ,      _UpperCAmelCase = "bert-base-cased"	):




	"""simple docstring"""






	A_  :				Optional[Any]	   =		AutoTokenizer.from_pretrained(_UpperCAmelCase	)
	A_  :				Optional[int]	   =		load_dataset('''glue'''  ,      '''mrpc'''	)

	def tokenize_function(_UpperCAmelCase	):
		# max_length=None => use the model max length (it's actually the default)
		A_  :				Optional[Any]	   =		tokenizer(examples['''sentence1''']  ,      examples['''sentence2''']  ,      truncation=_UpperCAmelCase  ,      max_length=_UpperCAmelCase	)
		return outputs

	# Apply the method we just defined to all the examples in all the splits of the dataset
	A_  :				Dict	   =		datasets.map(
	    _UpperCAmelCase  ,      batched=_UpperCAmelCase  ,      remove_columns=['''idx''', '''sentence1''', '''sentence2''']  ,      load_from_cache_file=_UpperCAmelCase	)

	# We also rename the 'label' column to 'labels' which is the expected name for labels by the models of the
	# transformers library
	A_  :				Any	   =		tokenized_datasets.rename_column('''label'''  ,      '''labels'''	)

	def collate_fn(_UpperCAmelCase	):
		# On TPU it's best to pad everything to the same length or training will be very slow.
		if accelerator.distributed_type == DistributedType.TPU:
			return tokenizer.pad(_UpperCAmelCase  ,      padding='''max_length'''  ,      max_length=128  ,      return_tensors='''pt'''	)
		return tokenizer.pad(_UpperCAmelCase  ,      padding='''longest'''  ,      return_tensors='''pt'''	)

	# Instantiate dataloaders.
	A_  :				Any	   =		DataLoader(
	    tokenized_datasets['''train''']  ,      shuffle=_UpperCAmelCase  ,      collate_fn=_UpperCAmelCase  ,      batch_size=_UpperCAmelCase	)
	A_  :				Any	   =		DataLoader(
	    tokenized_datasets['''validation''']  ,      shuffle=_UpperCAmelCase  ,      collate_fn=_UpperCAmelCase  ,      batch_size=_UpperCAmelCase	)

	return train_dataloader, eval_dataloader

def 		lowercase_      (		_UpperCAmelCase  ,      _UpperCAmelCase	):




	"""simple docstring"""






	A_  :				Tuple	   =		Accelerator()

	# Sample hyper-parameters for learning rate, batch size, seed and a few other HPs
	A_  :				int	   =		config['''lr''']
	A_  :				Union[str, Any]	   =		int(config['''num_epochs''']	)
	A_  :				Tuple	   =		int(config['''seed''']	)
	A_  :				str	   =		int(config['''batch_size''']	)
	A_  :				Dict	   =		args.model_name_or_path

	set_seed(_UpperCAmelCase	)
	A_   , A_  :				Optional[int]	   =		get_dataloaders(_UpperCAmelCase  ,      _UpperCAmelCase  ,      _UpperCAmelCase	)

	# Instantiate the model (we build the model here so that the seed also control new weights initialization)
	A_  :				Tuple	   =		AutoModelForSequenceClassification.from_pretrained(_UpperCAmelCase  ,      return_dict=_UpperCAmelCase	)

	# Instantiate optimizer
	A_  :				Tuple	   =		(
	    AdamW
	    if accelerator.state.deepspeed_plugin is None
	    or '''optimizer''' not in accelerator.state.deepspeed_plugin.deepspeed_config
	    else DummyOptim
	)
	A_  :				Any	   =		optimizer_cls(params=model.parameters()  ,      lr=_UpperCAmelCase	)

	if accelerator.state.deepspeed_plugin is not None:
		A_  :				Optional[Any]	   =		accelerator.state.deepspeed_plugin.deepspeed_config[
		    '''gradient_accumulation_steps'''
		]
	else:
		A_  :				Any	   =		1
	A_  :				Optional[int]	   =		(len(_UpperCAmelCase	) * num_epochs) // gradient_accumulation_steps

	# Instantiate scheduler
	if (
	    accelerator.state.deepspeed_plugin is None
	    or "scheduler" not in accelerator.state.deepspeed_plugin.deepspeed_config
	):
		A_  :				Union[str, Any]	   =		get_linear_schedule_with_warmup(
		    optimizer=_UpperCAmelCase  ,      num_warmup_steps=0  ,      num_training_steps=_UpperCAmelCase  ,      )
	else:
		A_  :				str	   =		DummyScheduler(_UpperCAmelCase  ,      total_num_steps=_UpperCAmelCase  ,      warmup_num_steps=0	)

	# Prepare everything
	# There is no specific order to remember, we just need to unpack the objects in the same order we gave them to the
	# prepare method.
	A_   , A_   , A_   , A_   , A_  :				Optional[Any]	   =		accelerator.prepare(
	    _UpperCAmelCase  ,      _UpperCAmelCase  ,      _UpperCAmelCase  ,      _UpperCAmelCase  ,      _UpperCAmelCase	)

	# We need to keep track of how many total steps we have iterated over
	A_  :				str	   =		0
	# We also need to keep track of the stating epoch so files are named properly
	A_  :				Tuple	   =		0

	# Now we train the model
	A_  :				List[Any]	   =		evaluate.load('''glue'''  ,      '''mrpc'''	)
	A_  :				Dict	   =		0
	A_  :				List[str]	   =		{}
	for epoch in range(_UpperCAmelCase  ,      _UpperCAmelCase	):
		model.train()
		for step, batch in enumerate(_UpperCAmelCase	):
			A_  :				Optional[int]	   =		model(**_UpperCAmelCase	)
			A_  :				Optional[Any]	   =		outputs.loss
			A_  :				Optional[Any]	   =		loss / gradient_accumulation_steps
			accelerator.backward(_UpperCAmelCase	)
			if step % gradient_accumulation_steps == 0:
				optimizer.step()
				lr_scheduler.step()
				optimizer.zero_grad()

			overall_step += 1

		model.eval()
		A_  :				int	   =		0
		for step, batch in enumerate(_UpperCAmelCase	):
			# We could avoid this line since we set the accelerator with `device_placement=True`.
			batch.to(accelerator.device	)
			with torch.no_grad():
				A_  :				List[str]	   =		model(**_UpperCAmelCase	)
			A_  :				Dict	   =		outputs.logits.argmax(dim=-1	)
			# It is slightly faster to call this once, than multiple times
			A_   , A_  :				Optional[int]	   =		accelerator.gather(
			    (predictions, batch['''labels'''])	)  # If we are in a multiprocess environment, the last batch has duplicates
			if accelerator.use_distributed:
				if step == len(_UpperCAmelCase	) - 1:
					A_  :				Dict	   =		predictions[: len(eval_dataloader.dataset	) - samples_seen]
					A_  :				Tuple	   =		references[: len(eval_dataloader.dataset	) - samples_seen]
				else:
					samples_seen += references.shape[0]
			metric.add_batch(
			    predictions=_UpperCAmelCase  ,      references=_UpperCAmelCase  ,      )

		A_  :				Optional[int]	   =		metric.compute()
		# Use accelerator.print to print only on the main process.
		accelerator.print(f"""epoch {epoch}:"""  ,      _UpperCAmelCase	)
		A_  :				List[str]	   =		eval_metric['''accuracy''']

		if best_performance < eval_metric["accuracy"]:
			A_  :				Tuple	   =		eval_metric['''accuracy''']

	if args.performance_lower_bound is not None:
		assert (
		    args.performance_lower_bound <= best_performance
		), f"""Best performance metric {best_performance} is lower than the lower bound {args.performance_lower_bound}"""

	accelerator.wait_for_everyone()
	if accelerator.is_main_process:
		with open(os.path.join(args.output_dir  ,      '''all_results.json'''	)  ,      '''w'''	) as f:
			json.dump(_UpperCAmelCase  ,      _UpperCAmelCase	)

def 		lowercase_      (		):




	"""simple docstring"""






	A_  :				Optional[Any]	   =		argparse.ArgumentParser(description='''Simple example of training script tracking peak GPU memory usage.'''	)
	parser.add_argument(
	    '''--model_name_or_path'''  ,      type=_UpperCAmelCase  ,      default='''bert-base-cased'''  ,      help='''Path to pretrained model or model identifier from huggingface.co/models.'''  ,      required=_UpperCAmelCase  ,      )
	parser.add_argument(
	    '''--output_dir'''  ,      type=_UpperCAmelCase  ,      default='''.'''  ,      help='''Optional save directory where all checkpoint folders will be stored. Default is the current working directory.'''  ,      )
	parser.add_argument(
	    '''--performance_lower_bound'''  ,      type=_UpperCAmelCase  ,      default=_UpperCAmelCase  ,      help='''Optional lower bound for the performance metric. If set, the training will throw error when the performance metric drops below this value.'''  ,      )
	parser.add_argument(
	    '''--num_epochs'''  ,      type=_UpperCAmelCase  ,      default=3  ,      help='''Number of train epochs.'''  ,      )
	A_  :				List[Any]	   =		parser.parse_args()
	A_  :				str	   =		{'''lr''': 2E-5, '''num_epochs''': args.num_epochs, '''seed''': 42, '''batch_size''': 16}
	training_function(_UpperCAmelCase  ,      _UpperCAmelCase	)


if __name__ == "__main__":
		main()











"""simple docstring"""

import unittest

from transformers import SPIECE_UNDERLINE, XLNetTokenizer, XLNetTokenizerFast
from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin


_lowerCamelCase  :			Tuple        =       get_tests_dir('fixtures/test_sentencepiece.model')

@require_sentencepiece
@require_tokenizers
class        lowercase      (    __UpperCAmelCase     ,	unittest.TestCase):
				__lowerCAmelCase    :    Tuple         =   XLNetTokenizer
				__lowerCAmelCase    :    Optional[int]         =   XLNetTokenizerFast
				__lowerCAmelCase    :    Union[str, Any]         =   True
				__lowerCAmelCase    :    Any         =   True







				def 					a_  (							self   :					List[str]       ):



					"""simple docstring"""

					super().setUp()

					# We have a SentencePiece fixture for testing
					A_  :				Optional[Any]	   =		XLNetTokenizer(_lowerCamelCase      ,     keep_accents=_lowerCamelCase       )
					tokenizer.sanitize_special_tokens()
					tokenizer.save_pretrained(self.tmpdirname       )







				def 					a_  (							self   :					List[str]       ):



					"""simple docstring"""

					A_  :				Optional[int]	   =		'''<s>'''
					A_  :				int	   =		1

					self.assertEqual(self.get_tokenizer()._convert_token_to_id(_lowerCamelCase       )      ,     _lowerCamelCase       )
					self.assertEqual(self.get_tokenizer()._convert_id_to_token(_lowerCamelCase       )      ,     _lowerCamelCase       )







				def 					a_  (							self   :					str       ):



					"""simple docstring"""

					A_  :				Any	   =		list(self.get_tokenizer().get_vocab().keys()       )

					self.assertEqual(vocab_keys[0]      ,     '''<unk>'''       )
					self.assertEqual(vocab_keys[1]      ,     '''<s>'''       )
					self.assertEqual(vocab_keys[-1]      ,     '''<eod>'''       )
					self.assertEqual(len(_lowerCamelCase       )      ,     10_06       )







				def 					a_  (							self   :					Optional[int]       ):



					"""simple docstring"""

					self.assertEqual(self.get_tokenizer().vocab_size      ,     10_00       )







				def 					a_  (							self   :					Optional[Any]       ):



					"""simple docstring"""

					A_  :				Optional[int]	   =		XLNetTokenizer(_lowerCamelCase      ,     keep_accents=_lowerCamelCase       )

					A_  :				Union[str, Any]	   =		tokenizer.tokenize('''This is a test'''       )
					self.assertListEqual(_lowerCamelCase      ,     ['''▁This''', '''▁is''', '''▁a''', '''▁t''', '''est''']       )

					self.assertListEqual(tokenizer.convert_tokens_to_ids(_lowerCamelCase       )      ,     [2_85, 46, 10, 1_70, 3_82]       )

					A_  :				List[str]	   =		tokenizer.tokenize('''I was born in 92000, and this is falsé.'''       )
					self.assertListEqual(
					    _lowerCamelCase      ,     [
					        SPIECE_UNDERLINE + '''I''',
					        SPIECE_UNDERLINE + '''was''',
					        SPIECE_UNDERLINE + '''b''',
					        '''or''',
					        '''n''',
					        SPIECE_UNDERLINE + '''in''',
					        SPIECE_UNDERLINE + '''''',
					        '''9''',
					        '''2''',
					        '''0''',
					        '''0''',
					        '''0''',
					        ''',''',
					        SPIECE_UNDERLINE + '''and''',
					        SPIECE_UNDERLINE + '''this''',
					        SPIECE_UNDERLINE + '''is''',
					        SPIECE_UNDERLINE + '''f''',
					        '''al''',
					        '''s''',
					        '''é''',
					        '''.''',
					    ]      ,     )
					A_  :				int	   =		tokenizer.convert_tokens_to_ids(_lowerCamelCase       )
					self.assertListEqual(_lowerCamelCase      ,     [8, 21, 84, 55, 24, 19, 7, 0, 6_02, 3_47, 3_47, 3_47, 3, 12, 66, 46, 72, 80, 6, 0, 4]       )

					A_  :				Union[str, Any]	   =		tokenizer.convert_ids_to_tokens(_lowerCamelCase       )
					self.assertListEqual(
					    _lowerCamelCase      ,     [
					        SPIECE_UNDERLINE + '''I''',
					        SPIECE_UNDERLINE + '''was''',
					        SPIECE_UNDERLINE + '''b''',
					        '''or''',
					        '''n''',
					        SPIECE_UNDERLINE + '''in''',
					        SPIECE_UNDERLINE + '''''',
					        '''<unk>''',
					        '''2''',
					        '''0''',
					        '''0''',
					        '''0''',
					        ''',''',
					        SPIECE_UNDERLINE + '''and''',
					        SPIECE_UNDERLINE + '''this''',
					        SPIECE_UNDERLINE + '''is''',
					        SPIECE_UNDERLINE + '''f''',
					        '''al''',
					        '''s''',
					        '''<unk>''',
					        '''.''',
					    ]      ,     )







				def 					a_  (							self   :					List[str]       ):



					"""simple docstring"""

					A_  :				Optional[Any]	   =		XLNetTokenizer(_lowerCamelCase      ,     do_lower_case=_lowerCamelCase       )
					A_  :				str	   =		tokenizer.tokenize('''I was born in 92000, and this is falsé.'''       )
					self.assertListEqual(
					    _lowerCamelCase      ,     [
					        SPIECE_UNDERLINE + '''''',
					        '''i''',
					        SPIECE_UNDERLINE + '''was''',
					        SPIECE_UNDERLINE + '''b''',
					        '''or''',
					        '''n''',
					        SPIECE_UNDERLINE + '''in''',
					        SPIECE_UNDERLINE + '''''',
					        '''9''',
					        '''2''',
					        '''0''',
					        '''0''',
					        '''0''',
					        ''',''',
					        SPIECE_UNDERLINE + '''and''',
					        SPIECE_UNDERLINE + '''this''',
					        SPIECE_UNDERLINE + '''is''',
					        SPIECE_UNDERLINE + '''f''',
					        '''al''',
					        '''se''',
					        '''.''',
					    ]      ,     )
					self.assertListEqual(tokenizer.tokenize('''H\u00E9llo'''       )      ,     ['''▁he''', '''ll''', '''o''']       )







				def 					a_  (							self   :					Optional[Any]       ):



					"""simple docstring"""

					A_  :				Optional[int]	   =		XLNetTokenizer(_lowerCamelCase      ,     do_lower_case=_lowerCamelCase       )
					A_  :				Tuple	   =		tokenizer.tokenize('''I was born in 92000, and this is falsé.'''       )
					self.assertListEqual(
					    _lowerCamelCase      ,     [
					        SPIECE_UNDERLINE + '''I''',
					        SPIECE_UNDERLINE + '''was''',
					        SPIECE_UNDERLINE + '''b''',
					        '''or''',
					        '''n''',
					        SPIECE_UNDERLINE + '''in''',
					        SPIECE_UNDERLINE + '''''',
					        '''9''',
					        '''2''',
					        '''0''',
					        '''0''',
					        '''0''',
					        ''',''',
					        SPIECE_UNDERLINE + '''and''',
					        SPIECE_UNDERLINE + '''this''',
					        SPIECE_UNDERLINE + '''is''',
					        SPIECE_UNDERLINE + '''f''',
					        '''al''',
					        '''se''',
					        '''.''',
					    ]      ,     )







				@slow
				def 					a_  (							self   :					Dict       ):



					"""simple docstring"""

					A_  :				int	   =		XLNetTokenizer.from_pretrained('''xlnet-base-cased'''       )

					A_  :				Optional[int]	   =		tokenizer.encode('''sequence builders'''      ,     add_special_tokens=_lowerCamelCase       )
					A_  :				Optional[int]	   =		tokenizer.encode('''multi-sequence build'''      ,     add_special_tokens=_lowerCamelCase       )

					A_  :				Tuple	   =		tokenizer.build_inputs_with_special_tokens(_lowerCamelCase       )
					A_  :				Union[str, Any]	   =		tokenizer.build_inputs_with_special_tokens(_lowerCamelCase      ,     _lowerCamelCase       )

					assert encoded_sentence == text + [4, 3]
					assert encoded_pair == text + [4] + text_a + [4, 3]







				@slow
				def 					a_  (							self   :					List[str]       ):



					"""simple docstring"""

					A_  :				Dict	   =		{'''input_ids''': [[17, 2_14_42, 2_70, 17, 10, 1_46_45, 3_18, 34, 17, 45_46, 31_45, 7_87, 13, 77_52, 2_20_18, 23, 21, 17, 45_46, 31_45, 7_87, 13, 33_52, 1_44_31, 13, 55_00, 11, 11_76, 5_80, 13, 1_68_19, 47_97, 23, 17, 10, 1_71_35, 6_58, 19, 4_57, 79_32, 13, 1_84, 19, 31_54, 1_71_35, 64_68, 19, 14_04, 1_22_69, 19, 42_29, 53_56, 1_62_64, 46, 19, 17, 2_05_45, 1_03_95, 9, 9, 9, 11, 28, 64_21, 95_31, 2_07_29, 17, 10, 3_53, 1_70_22, 11, 21, 64_21, 95_31, 1_69_49, 17, 10, 1_15_09, 7_53, 11, 33, 95, 24_21, 73_85, 9_56, 1_44_31, 26_26, 25, 8_42, 73_85, 48_36, 21, 14_29, 22_72, 98_55, 31_20, 1_61, 2_47_38, 19, 1_32_03, 6_58, 2_18, 7_87, 21, 4_30, 1_84_82, 8_47, 26_37, 9, 4, 3], [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]}  # noqa: E501
					# fmt: on

					self.tokenizer_integration_test_util(
					    expected_encoding=_lowerCamelCase      ,     model_name='''xlnet-base-cased'''      ,     revision='''c841166438c31ec7ca9a106dee7bb312b73ae511'''      ,     )





