I am trying to fine-tune BART for a summarization task using the code on the “Fine Tuning with Custom Dataset” page (https://huggingface.co/transformers/custom_datasets.html 214). The data is a subset of the CNN/Daily Mail data.
I am encountering two different errors. The first comes when I implement the exact code on the page:  "TypeError: new(): invalid data type ‘str’
I assume this is caused by the fact that the labels are not encoded/tokenized, instead they are strings.  I see this is the case in the sample code on the page, the labels are not tokenized.
If I tokenize the labels and run the code I receive a different error:  “Indexing with integers (to access backend Encoding for a given batch index) is not available when using Python based tokenizers”
I am not sure how to interpret that.  I get the same errors whether I am using the Trainer class or using native PyTorch.  Any suggestions?  Thanks!