AttributeError for Text Dataset For Next Sentence Prediction: no attribute 'documents'
Hello,I am preparing some data for BERT fine-tuning for Next Sentence Prediction.In my understanding, the way to go is:Pass the data through theTextDatasetForNextSentencePredictionclassInstantiateDataCollatorForLanguageModeling(as DataCollatorForNextSentencePrediction has been removed)Pass both to the TrainerHowever, there seems to be some bug with the attributedocumentsto the classTextDatasetForNextSentencePrediction. Indeed, while for some runs the attribute is produced, for others I getAttributeError: 'TextDatasetForNextSentencePrediction' object has no attribute 'documents'reporting that the attribute is missing.I also see a warning saying that soon enough this code will be replaced. I was thus wondering whether this is still the pipeline you suggest or I should go another way.Below sample data and minimal code to reproduce the error.from transformers.data.datasets.language_modeling import TextDatasetForNextSentencePrediction
from transformers import BertTokenizerFast

tokenizer = BertTokenizerFast.from_pretrained('bert-base-cased')
train_dataset = TextDatasetForNextSentencePrediction(
    tokenizer=tokenizer,
    file_path="test.txt",
    block_size=512,
)

docs = train_dataset.documents