Type of dataset in Trainer class
Hi, I was going through the documentation and got a confusiontrainer = Trainer(model=model,                         # the instantiatedTransformers model to be trainedargs=training_args,                  # training arguments, defined abovetrain_dataset=train_dataset,         # training dataseteval_dataset=test_dataset            # evaluation dataset)I couldn’t understand what is the type of train_dataset and how the target for loss calculation is selected.In Fine-tuning in native TensorFlow 2 also there is no target value. Am I missing something?model.fit(train_dataset, epochs=2, steps_per_epoch=115)Thank you
2020-07-18T04:50:00Z
For more context, he/she is talking about this page:https://huggingface.co/transformers/training.htmlI also got confused by this bit of the documentation, but I think this code expects datasets like the ones provided byHugging Face’s NLP package.I think they are all based onPytorch’s Dataset Class, but I could be mistaken.Try to use one of the datasets provided by their NLP package and check if it works correctly.Hope this helps!
2020-07-18T09:23:20Z
Hi@suyash21thisposthas some explanation about the dataset expected byTrainer
2020-07-20T13:48:18Z
Traineris to be used with PyTorch, so in this case thetrain_datasetneeds to be a PyTorch dataset.TFTrainerwould expect a TF dataset. Thedoc pageis a bit unclear (types are right in the signature but too short/wrong in the enumeration). I’ll send a fix to this later today.