CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
huggingface

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: huggingface/notebooks
Path: blob/main/examples/summarization_ort.ipynb
Views: 2535
Kernel: Python 3 (ipykernel)

How to fine-tune a T5 model with ONNX Runtime

This notebook is largely inspired by the summarization notebook of Transformers which takes PyTorch as backend for fine tuning.

Here you will use the ORTSeq2SeqTrainer class in Optimum library and take ONNX Runtime as backend to accelerate the training.

In this notebook, we will walk through the fine-tuning of T5-small model in the 🤗 Transformers for a summarization task. We will use the XSum dataset (for extreme summarization) which contains BBC articles accompanied with single-sentence summaries, and the training as well as inference will be done by leveraging ORTSeq2SeqTrainer in Optimum!

Let's speed the training up!

Dependencies

To use ONNX Runtime for training, you need a machine with at least one NVIDIA GPU.

ONNX Runtime training module need to be properly installed before launching the notebook! Please follow the instruction in Optimum's documentation to set up your environment.

Check your GPU:

!nvidia-smi
Fri Sep 16 19:04:38 2022 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 440.33.01 Driver Version: 440.33.01 CUDA Version: 11.3 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 Tesla T4 On | 00000000:00:1E.0 Off | 0 | | N/A 43C P0 25W / 70W | 3420MiB / 15109MiB | 0% Default | +-------------------------------+----------------------+----------------------+ +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| +-----------------------------------------------------------------------------+

If you're opening this Notebook on colab, you will probably need to install 🤗 Optimum, 🤗 Transformers, 🤗 Datasets and 🤗 evaluate. Uncomment the following cell and run it.

!pip install optimum transformers datasets evaluate rouge-score nltk tokenizers>=0.11.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
import nltk nltk.download("punkt")
[nltk_data] Downloading package punkt to /root/nltk_data... [nltk_data] Unzipping tokenizers/punkt.zip.
True

[Optional] If you want to share your model with the community and generate an inference API, there are a few more steps to follow.

First you have to store your authentication token from the Hugging Face website (sign up here if you haven't already!) then execute the following cell and input your username and password:

from huggingface_hub import notebook_login notebook_login()

Then you need to install Git-LFS. Uncomment the following instructions:

!apt install git-lfs

Make sure your version of Transformers is at least 4.15.0:

import transformers print(transformers.__version__)
4.23.0.dev0

Setup

model_checkpoint = "t5-small" task = "xsum" metric_name = "rouge" batch_size = 8 learning_rate=2e-5 weight_decay = 0.01 num_train_epochs = 1

We also quickly upload some telemetry - this tells us which examples and software versions are getting used so we know where to prioritize our maintenance efforts. We don't collect (or care about) any personally identifiable information, but if you'd prefer not to be counted, feel free to skip this step or delete this cell entirely.

from transformers.utils import send_example_telemetry send_example_telemetry("summarization_notebook_ort", framework="none")

Loading the dataset

We will use the 🤗 Datasets library to download the data and get the metric we need to use for evaluation (to compare our model to the benchmark). This can be easily done with the functions load_dataset and load_metric.

from datasets import load_dataset, load_metric raw_datasets = load_dataset(task) metric = load_metric(metric_name)

[Optional] To get a sense of what the data looks like, the following function will show some examples picked randomly in the dataset.

import datasets import random import pandas as pd from IPython.display import display, HTML def show_random_elements(dataset, num_examples=1): assert num_examples <= len(dataset), "Can't pick more elements than there are in the dataset." picks = [] for _ in range(num_examples): pick = random.randint(0, len(dataset)-1) while pick in picks: pick = random.randint(0, len(dataset)-1) picks.append(pick) df = pd.DataFrame(dataset[picks]) for column, typ in dataset.features.items(): if isinstance(typ, datasets.ClassLabel): df[column] = df[column].transform(lambda i: typ.names[i]) display(HTML(df.to_html()))
show_random_elements(raw_datasets["train"])

The metric is an instance of datasets.Metric:

metric
Metric(name: "rouge", features: {'predictions': Value(dtype='string', id='sequence'), 'references': Value(dtype='string', id='sequence')}, usage: """ Calculates average rouge scores for a list of hypotheses and references Args: predictions: list of predictions to score. Each prediction should be a string with tokens separated by spaces. references: list of reference for each prediction. Each reference should be a string with tokens separated by spaces. rouge_types: A list of rouge types to calculate. Valid names: `"rouge{n}"` (e.g. `"rouge1"`, `"rouge2"`) where: {n} is the n-gram based scoring, `"rougeL"`: Longest common subsequence based scoring. `"rougeLSum"`: rougeLsum splits text using `" "`. See details in https://github.com/huggingface/datasets/issues/617 use_stemmer: Bool indicating whether Porter stemmer should be used to strip word suffixes. use_aggregator: Return aggregates if this is set to True Returns: rouge1: rouge_1 (precision, recall, f1), rouge2: rouge_2 (precision, recall, f1), rougeL: rouge_l (precision, recall, f1), rougeLsum: rouge_lsum (precision, recall, f1) Examples: >>> rouge = datasets.load_metric('rouge') >>> predictions = ["hello there", "general kenobi"] >>> references = ["hello there", "general kenobi"] >>> results = rouge.compute(predictions=predictions, references=references) >>> print(list(results.keys())) ['rouge1', 'rouge2', 'rougeL', 'rougeLsum'] >>> print(results["rouge1"]) AggregateScore(low=Score(precision=1.0, recall=1.0, fmeasure=1.0), mid=Score(precision=1.0, recall=1.0, fmeasure=1.0), high=Score(precision=1.0, recall=1.0, fmeasure=1.0)) >>> print(results["rouge1"].mid.fmeasure) 1.0 """, stored examples: 0)
fake_preds = ["hello there", "general kenobi"] fake_labels = ["hello there", "general kenobi"] metric.compute(predictions=fake_preds, references=fake_labels)
{'rouge1': AggregateScore(low=Score(precision=1.0, recall=1.0, fmeasure=1.0), mid=Score(precision=1.0, recall=1.0, fmeasure=1.0), high=Score(precision=1.0, recall=1.0, fmeasure=1.0)), 'rouge2': AggregateScore(low=Score(precision=1.0, recall=1.0, fmeasure=1.0), mid=Score(precision=1.0, recall=1.0, fmeasure=1.0), high=Score(precision=1.0, recall=1.0, fmeasure=1.0)), 'rougeL': AggregateScore(low=Score(precision=1.0, recall=1.0, fmeasure=1.0), mid=Score(precision=1.0, recall=1.0, fmeasure=1.0), high=Score(precision=1.0, recall=1.0, fmeasure=1.0)), 'rougeLsum': AggregateScore(low=Score(precision=1.0, recall=1.0, fmeasure=1.0), mid=Score(precision=1.0, recall=1.0, fmeasure=1.0), high=Score(precision=1.0, recall=1.0, fmeasure=1.0))}

Preprocessing the data

Before we can feed those texts to our model, we need to preprocess them. This is done by a 🤗 Transformers Tokenizer which will (as the name indicates) tokenize the inputs (including converting the tokens to their corresponding IDs in the pretrained vocabulary) and put it in a format the model expects, as well as generate the other inputs that the model requires.

To do all of this, we instantiate our tokenizer with the AutoTokenizer.from_pretrained method, which will ensure:

  • we get a tokenizer that corresponds to the model architecture we want to use,

  • we download the vocabulary used when pretraining this specific checkpoint.

That vocabulary will be cached, so it's not downloaded again the next time we run the cell.

from transformers import AutoTokenizer tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
/usr/local/lib/python3.8/dist-packages/transformers/models/t5/tokenization_t5_fast.py:156: FutureWarning: This tokenizer was incorrectly instantiated with a model max length of 512 which will be corrected in Transformers v5. For now, this behavior is kept to avoid breaking backwards compatibility when padding/encoding with `truncation is True`. - Be aware that you SHOULD NOT rely on t5-small automatically truncating your input to 512 when padding/encoding. - If you want to encode/pad to sequences longer than 512 you can either instantiate this tokenizer with `model_max_length` or pass `max_length` when encoding/padding. - To avoid this warning, please instantiate this tokenizer with `model_max_length` set to your preferred value. warnings.warn(

To prepare the targets for our model, we need to tokenize them inside the as_target_tokenizer context manager. This will make sure the tokenizer uses the special tokens corresponding to the targets:

with tokenizer.as_target_tokenizer(): print(tokenizer(["Hello, this one sentence!", "This is another sentence."]))
{'input_ids': [[8774, 6, 48, 80, 7142, 55, 1], [100, 19, 430, 7142, 5, 1]], 'attention_mask': [[1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]]}
/usr/local/lib/python3.8/dist-packages/transformers/tokenization_utils_base.py:3540: UserWarning: `as_target_tokenizer` is deprecated and will be removed in v5 of Transformers. You can tokenize your labels by using the argument `text_target` of the regular `__call__` method (either in the same call as your input texts if you use the same keyword arguments, or in a separate call. warnings.warn(

If you are using one of the five T5 checkpoints we have to prefix the inputs with "summarize:" (the model can also translate and it needs the prefix to know which task it has to perform).

if model_checkpoint in ["t5-small", "t5-base", "t5-large", "t5-3b", "t5-11b"]: prefix = "summarize: " else: prefix = ""

We can then write the function that will preprocess our samples. We just feed them to the tokenizer with the argument truncation=True. This will ensure that an input longer that what the model selected can handle will be truncated to the maximum length accepted by the model. The padding will be dealt with later on (in a data collator) so we pad examples to the longest length in the batch and not the whole dataset.

max_input_length = 1024 max_target_length = 128 def preprocess_function(examples): inputs = [prefix + doc for doc in examples["document"]] model_inputs = tokenizer(inputs, max_length=max_input_length, truncation=True) # Setup the tokenizer for targets with tokenizer.as_target_tokenizer(): labels = tokenizer(examples["summary"], max_length=max_target_length, truncation=True) model_inputs["labels"] = labels["input_ids"] return model_inputs

To apply this function on all the pairs of sentences in our dataset, we just use the map method of our dataset object we created earlier. This will apply the function on all the elements of all the splits in dataset, so our training, validation and testing data will be preprocessed in one single command.

tokenized_datasets = raw_datasets.map(preprocess_function, batched=True)

Even better, the results are automatically cached by the 🤗 Datasets library to avoid spending time on this step the next time you run your notebook. The 🤗 Datasets library is normally smart enough to detect when the function you pass to map has changed (and thus requires to not use the cache data). For instance, it will properly detect if you change the task in the first cell and rerun the notebook. 🤗 Datasets warns you when it uses cached files, you can pass load_from_cache_file=False in the call to map to not use the cached files and force the preprocessing to be applied again.

Note that we passed batched=True to encode the texts by batches together. This is to leverage the full benefit of the fast tokenizer we loaded earlier, which will use multi-threading to treat the texts in a batch concurrently.

Fine-tuning the model

Now that our data is ready, we can download the pretrained model and fine-tune it. Since our task is of the sequence-to-sequence kind, we use the AutoModelForSeq2SeqLM class to fist load the PyTorch model. Like with the tokenizer, the from_pretrained method will download and cache the model for us.

from transformers import AutoModelForSeq2SeqLM, DataCollatorForSeq2Seq from optimum.onnxruntime import ORTSeq2SeqTrainer, ORTSeq2SeqTrainingArguments model = AutoModelForSeq2SeqLM.from_pretrained(model_checkpoint)
huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks... To disable this warning, you can either: - Avoid using `tokenizers` before the fork if possible - Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false) huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks... To disable this warning, you can either: - Avoid using `tokenizers` before the fork if possible - Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false) huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks... To disable this warning, you can either: - Avoid using `tokenizers` before the fork if possible - Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)

Note that we don't get a warning like in our classification example. This means we used all the weights of the pretrained model and there is no randomly initialized head in this case.

To instantiate a ORTSeq2SeqTrainer, we will need to define three more things. The most important is the ORTSeq2SeqTrainingArguments, which is a class that contains all the attributes to customize the training. You can also use Seq2SeqTrainingArguments in Transformers, but ORTSeq2SeqTrainingArguments enables more optimized features of ONNX Runtime. It requires one folder name, which will be used to save the checkpoints of the model, and all other arguments are optional:

model_name = model_checkpoint.split("/")[-1] args = ORTSeq2SeqTrainingArguments( f"{model_name}-finetuned-xsum", evaluation_strategy = "epoch", learning_rate=learning_rate, per_device_train_batch_size=batch_size, per_device_eval_batch_size=batch_size, weight_decay=weight_decay, save_total_limit=3, num_train_epochs=num_train_epochs, predict_with_generate=True, optim="adamw_ort_fused", # push_to_hub=True, )

Here we set the evaluation to be done at the end of each epoch, tweak the learning rate, use the batch_size defined at the top of the cell and customize the weight decay. Since the ORTSeq2SeqTrainer will save the model regularly and our dataset is quite large, we tell it to make three saves maximum. Lastly, we use the predict_with_generate option (to properly generate summaries) and activate mixed precision training (to go a bit faster).

The last argument to setup everything so we can push the model to the Hub regularly during training. Remove it if you didn't follow the installation steps at the top of the notebook. If you want to save your model locally in a name that is different than the name of the repository it will be pushed, or if you want to push your model under an organization and not your name space, use the hub_model_id argument to set the repo name (it needs to be the full name, including your namespace: for instance "optimum/t5-large-finetuned-xsum").

Then, we need a special kind of data collator, which will not only pad the inputs to the maximum length in the batch, but also the labels:

data_collator = DataCollatorForSeq2Seq( tokenizer, model=model, label_pad_token_id=tokenizer.pad_token_id, pad_to_multiple_of=8 if args.fp16 else None, )

The last thing to define for our ORTSeq2SeqTrainer is how to compute the metrics from the predictions. We need to define a function for this, which will just use the metric we loaded earlier, and we have to do a bit of pre-processing to decode the predictions into texts:

import nltk import numpy as np def compute_metrics(eval_pred): predictions, labels = eval_pred decoded_preds = tokenizer.batch_decode(predictions, skip_special_tokens=True) # Replace -100 in the labels as we can't decode them. labels = np.where(labels != -100, labels, tokenizer.pad_token_id) decoded_labels = tokenizer.batch_decode(labels, skip_special_tokens=True) # Rouge expects a newline after each sentence decoded_preds = ["\n".join(nltk.sent_tokenize(pred.strip())) for pred in decoded_preds] decoded_labels = ["\n".join(nltk.sent_tokenize(label.strip())) for label in decoded_labels] result = metric.compute(predictions=decoded_preds, references=decoded_labels, use_stemmer=True) # Extract a few results result = {key: value.mid.fmeasure * 100 for key, value in result.items()} # Add mean generated length prediction_lens = [np.count_nonzero(pred != tokenizer.pad_token_id) for pred in predictions] result["gen_len"] = np.mean(prediction_lens) return {k: round(v, 4) for k, v in result.items()}

Then we just need to pass all of this along with our datasets to the ORTSeq2SeqTrainer:

trainer = ORTSeq2SeqTrainer( model=model, args=args, train_dataset=tokenized_datasets["train"], eval_dataset=tokenized_datasets["validation"], tokenizer=tokenizer, data_collator=data_collator, compute_metrics=compute_metrics if args.predict_with_generate else None, feature="seq2seq-lm", )

We can now finetune our model by just calling the train method:

trainer.train()
The following columns in the training set don't have a corresponding argument in `T5ForConditionalGeneration.forward` and have been ignored: summary, id, document. If summary, id, document are not expected by `T5ForConditionalGeneration.forward`, you can safely ignore this message. You're using a T5TokenizerFast tokenizer. Please note that with a fast tokenizer, using the `__call__` method is faster than using a method to encode the text followed by a call to the `pad` method to get a padded encoding. /usr/local/lib/python3.8/dist-packages/onnxruntime/training/ortmodule/_training_manager.py:191: UserWarning: Fast path enabled - skipping checks. Rebuild graph: True, Execution agent: True, Device check: True warnings.warn( WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of prim::Constant type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of prim::Constant type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen /usr/local/lib/python3.8/dist-packages/onnxruntime/training/ortmodule/_logger.py:52: UserWarning: There were one or more warnings or errors raised while exporting the PyTorch model. Please enable INFO level logging to view all warnings and errors. warnings.warn( Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen
Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-500 Configuration saved in t5-small-finetuned-xsum/checkpoint-500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-500/spiece.model Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-1000 Configuration saved in t5-small-finetuned-xsum/checkpoint-1000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-1000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-1000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-1000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-1000/spiece.model Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-1500 Configuration saved in t5-small-finetuned-xsum/checkpoint-1500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-1500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-1500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-1500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-1500/spiece.model Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-2000 Configuration saved in t5-small-finetuned-xsum/checkpoint-2000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-2000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-2000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-2000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-2000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-2500 Configuration saved in t5-small-finetuned-xsum/checkpoint-2500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-2500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-2500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-2500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-2500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-1000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-3000 Configuration saved in t5-small-finetuned-xsum/checkpoint-3000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-3000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-3000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-3000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-3000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-1500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-3500 Configuration saved in t5-small-finetuned-xsum/checkpoint-3500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-3500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-3500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-3500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-3500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-2000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-4000 Configuration saved in t5-small-finetuned-xsum/checkpoint-4000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-4000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-4000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-4000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-4000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-2500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-4500 Configuration saved in t5-small-finetuned-xsum/checkpoint-4500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-4500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-4500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-4500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-4500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-3000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-5000 Configuration saved in t5-small-finetuned-xsum/checkpoint-5000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-5000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-5000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-5000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-5000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-3500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-5500 Configuration saved in t5-small-finetuned-xsum/checkpoint-5500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-5500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-5500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-5500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-5500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-4000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-6000 Configuration saved in t5-small-finetuned-xsum/checkpoint-6000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-6000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-6000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-6000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-6000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-4500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-6500 Configuration saved in t5-small-finetuned-xsum/checkpoint-6500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-6500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-6500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-6500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-6500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-5000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-7000 Configuration saved in t5-small-finetuned-xsum/checkpoint-7000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-7000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-7000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-7000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-7000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-5500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-7500 Configuration saved in t5-small-finetuned-xsum/checkpoint-7500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-7500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-7500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-7500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-7500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-6000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-8000 Configuration saved in t5-small-finetuned-xsum/checkpoint-8000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-8000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-8000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-8000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-8000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-6500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-8500 Configuration saved in t5-small-finetuned-xsum/checkpoint-8500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-8500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-8500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-8500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-8500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-7000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-9000 Configuration saved in t5-small-finetuned-xsum/checkpoint-9000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-9000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-9000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-9000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-9000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-7500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-9500 Configuration saved in t5-small-finetuned-xsum/checkpoint-9500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-9500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-9500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-9500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-9500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-8000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-10000 Configuration saved in t5-small-finetuned-xsum/checkpoint-10000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-10000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-10000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-10000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-10000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-8500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-10500 Configuration saved in t5-small-finetuned-xsum/checkpoint-10500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-10500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-10500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-10500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-10500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-9000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-11000 Configuration saved in t5-small-finetuned-xsum/checkpoint-11000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-11000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-11000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-11000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-11000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-9500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-11500 Configuration saved in t5-small-finetuned-xsum/checkpoint-11500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-11500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-11500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-11500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-11500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-10000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-12000 Configuration saved in t5-small-finetuned-xsum/checkpoint-12000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-12000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-12000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-12000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-12000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-10500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-12500 Configuration saved in t5-small-finetuned-xsum/checkpoint-12500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-12500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-12500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-12500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-12500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-11000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-13000 Configuration saved in t5-small-finetuned-xsum/checkpoint-13000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-13000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-13000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-13000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-13000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-11500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-13500 Configuration saved in t5-small-finetuned-xsum/checkpoint-13500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-13500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-13500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-13500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-13500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-12000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-14000 Configuration saved in t5-small-finetuned-xsum/checkpoint-14000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-14000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-14000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-14000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-14000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-12500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-14500 Configuration saved in t5-small-finetuned-xsum/checkpoint-14500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-14500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-14500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-14500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-14500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-13000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-15000 Configuration saved in t5-small-finetuned-xsum/checkpoint-15000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-15000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-15000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-15000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-15000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-13500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-15500 Configuration saved in t5-small-finetuned-xsum/checkpoint-15500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-15500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-15500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-15500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-15500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-14000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-16000 Configuration saved in t5-small-finetuned-xsum/checkpoint-16000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-16000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-16000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-16000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-16000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-14500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-16500 Configuration saved in t5-small-finetuned-xsum/checkpoint-16500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-16500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-16500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-16500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-16500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-15000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-17000 Configuration saved in t5-small-finetuned-xsum/checkpoint-17000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-17000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-17000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-17000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-17000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-15500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-17500 Configuration saved in t5-small-finetuned-xsum/checkpoint-17500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-17500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-17500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-17500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-17500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-16000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-18000 Configuration saved in t5-small-finetuned-xsum/checkpoint-18000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-18000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-18000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-18000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-18000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-16500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-18500 Configuration saved in t5-small-finetuned-xsum/checkpoint-18500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-18500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-18500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-18500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-18500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-17000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-19000 Configuration saved in t5-small-finetuned-xsum/checkpoint-19000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-19000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-19000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-19000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-19000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-17500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-19500 Configuration saved in t5-small-finetuned-xsum/checkpoint-19500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-19500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-19500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-19500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-19500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-18000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-20000 Configuration saved in t5-small-finetuned-xsum/checkpoint-20000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-20000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-20000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-20000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-20000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-18500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-20500 Configuration saved in t5-small-finetuned-xsum/checkpoint-20500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-20500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-20500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-20500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-20500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-19000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-21000 Configuration saved in t5-small-finetuned-xsum/checkpoint-21000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-21000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-21000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-21000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-21000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-19500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-21500 Configuration saved in t5-small-finetuned-xsum/checkpoint-21500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-21500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-21500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-21500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-21500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-20000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-22000 Configuration saved in t5-small-finetuned-xsum/checkpoint-22000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-22000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-22000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-22000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-22000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-20500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-22500 Configuration saved in t5-small-finetuned-xsum/checkpoint-22500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-22500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-22500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-22500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-22500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-21000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-23000 Configuration saved in t5-small-finetuned-xsum/checkpoint-23000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-23000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-23000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-23000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-23000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-21500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-23500 Configuration saved in t5-small-finetuned-xsum/checkpoint-23500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-23500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-23500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-23500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-23500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-22000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-24000 Configuration saved in t5-small-finetuned-xsum/checkpoint-24000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-24000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-24000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-24000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-24000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-22500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-24500 Configuration saved in t5-small-finetuned-xsum/checkpoint-24500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-24500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-24500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-24500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-24500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-23000] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-25000 Configuration saved in t5-small-finetuned-xsum/checkpoint-25000/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-25000/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-25000/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-25000/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-25000/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-23500] due to args.save_total_limit Saving model checkpoint to t5-small-finetuned-xsum/checkpoint-25500 Configuration saved in t5-small-finetuned-xsum/checkpoint-25500/config.json Model weights saved in t5-small-finetuned-xsum/checkpoint-25500/pytorch_model.bin tokenizer config file saved in t5-small-finetuned-xsum/checkpoint-25500/tokenizer_config.json Special tokens file saved in t5-small-finetuned-xsum/checkpoint-25500/special_tokens_map.json Copy vocab file to t5-small-finetuned-xsum/checkpoint-25500/spiece.model Deleting older checkpoint [t5-small-finetuned-xsum/checkpoint-24000] due to args.save_total_limit The following columns in the evaluation set don't have a corresponding argument in `T5ForConditionalGeneration.forward` and have been ignored: summary, id, document. If summary, id, document are not expected by `T5ForConditionalGeneration.forward`, you can safely ignore this message. WARNING:optimum.onnxruntime.trainer:[INFO] Evaluating with PyTorch backend. If you want to use ONNX Runtime for the evaluation, set `trainer.evaluate(inference_with_ort=True)`. ***** Running Evaluation ***** Num examples = 11332 Batch size = 8
TrainOutput(global_step=25506, training_loss=2.008956053654633, metrics={'train_runtime': 12251.2493, 'train_samples_per_second': 16.655, 'train_steps_per_second': 2.082, 'total_flos': 5.03014392471552e+16, 'train_loss': 2.008956053654633, 'epoch': 1.0})

You can now upload the result of the training to the Hub, just execute this instruction:

trainer.push_to_hub()

You will also be able to save your fine-tuned model as PyTorch or ONNX model in the output_dir that you set in ORTSeq2SeqTrainer:

trainer.save_model()

Evaluating your model

Evaluate the performance of the model that you just fine-tuned with the validation dataset that you've passed to ORTSeq2SeqTrainer by just calling the evaluate method.

If you set inference_with_ort=True, the inference will be done with ONNX Runtime backend. Otherwise, the inference will take PyTorch as backend.

trainer.evaluate(inference_with_ort=True)
The following columns in the evaluation set don't have a corresponding argument in `T5ForConditionalGeneration.forward` and have been ignored: summary, id, document. If summary, id, document are not expected by `T5ForConditionalGeneration.forward`, you can safely ignore this message. Using framework PyTorch: 1.11.0+cu113 Overriding 1 configuration item(s) - use_cache -> False WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. Warning: Checker does not support models with experimental ops: ATen Using framework PyTorch: 1.11.0+cu113 Warning: Checker does not support models with experimental ops: ATen Overriding 1 configuration item(s) - use_cache -> False /usr/local/lib/python3.8/dist-packages/transformers/modeling_utils.py:701: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if causal_mask.shape[1] < attention_mask.shape[1]: WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of prim::Constant type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of prim::Constant type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Using framework PyTorch: 1.11.0+cu113 Overriding 1 configuration item(s) - use_cache -> True In-place op on output of tensor.shape. See https://pytorch.org/docs/master/onnx.html#avoid-inplace-operations-when-using-tensor-shape-in-tracing-mode In-place op on output of tensor.shape. See https://pytorch.org/docs/master/onnx.html#avoid-inplace-operations-when-using-tensor-shape-in-tracing-mode WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of prim::Constant type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of org.pytorch.aten::ATen type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of prim::Constant type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of com.microsoft::SoftmaxCrossEntropyLossInternal type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen WARNING:optimum.modeling_base:config.json NOT FOUND in HuggingFace Hub Model config PretrainedConfig { "transformers_version": "4.23.0.dev0" } Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen 2022-09-16 23:10:03.897260566 [W:onnxruntime:, graph.cc:106 MergeShapeInfo] Error merging shape info for output. 'loss' source:{} target:{-1,-1}. Falling back to lenient merge. Warning: Checker does not support models with experimental ops: ATen Warning: Checker does not support models with experimental ops: ATen 2022-09-16 23:10:04.342904389 [W:onnxruntime:, graph.cc:106 MergeShapeInfo] Error merging shape info for output. 'loss' source:{} target:{-1,-1}. Falling back to lenient merge.
{'eval_loss': 1.782148003578186, 'eval_rouge1': 28.6232, 'eval_rouge2': 7.9747, 'eval_rougeL': 22.5269, 'eval_rougeLsum': 22.527, 'eval_gen_len': 18.8108, 'eval_runtime': 2303.9032, 'eval_samples_per_second': 4.919, 'eval_steps_per_second': 0.615, 'epoch': 1.0}

Extended reading

Now check your trained ONNX model with Netron, and you might notice that the computation graph is under optimizatiom. Want to accelerate even more?

Check the graph optimizers and quantizers of Optimum🤗!