I am following this tutorial and copy-pasting all the code blocks into Colab. However when it gets to the training segment, this error pops up.
/usr/local/lib/python3.7/dist-packages/transformers/optimization.py:310: FutureWarning: This implementation of AdamW is deprecated and will be removed in a future version. Use the PyTorch implementation torch.optim.AdamW instead, or set `no_deprecation_warning=True` to disable this warning
FutureWarning,
***** Running training *****
Num examples = 8466
Num Epochs = 3
Instantaneous batch size per device = 8
Total train batch size (w. parallel, distributed & accumulation) = 8
Gradient Accumulation steps = 1
Total optimization steps = 3177
[ 254/3177 00:47 < 09:10, 5.31 it/s, Epoch 0.24/3]
Epoch Training Loss Validation Loss
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_base.py in convert_to_tensors(self, tensor_type, prepend_batch_axis)
718 if not is_tensor(value):
--> 719 tensor = as_tensor(value)
720
ValueError: expected sequence of length 128 at dim 1 (got 127)
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
10 frames
/usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_base.py in convert_to_tensors(self, tensor_type, prepend_batch_axis)
734 )
735 raise ValueError(
--> 736 "Unable to create tensor, you should probably activate truncation and/or padding with"
737 " 'padding=True' 'truncation=True' to have batched tensors with the same length. Perhaps your"
738 f" features (`{key}` in this case) have excessive nesting (inputs type `list` where type `int` is"
ValueError: Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' 'truncation=True' to have batched tensors with the same length. Perhaps your features (`labels` in this case) have excessive nesting (inputs type `list` where type `int` is expected).
I have already initialized the data_collator/ran all the code blocks in the tutorial but am still receiving an error about truncation?