In Suraj Patil’s notebook, he employed Pytorch Trainer to train T5.
At first, I didn’t know that we can use Trainer with Seq2Seq problems (according to “The Big Table of Tasks”https://huggingface.co/transformers/examples.html which stated that Trainer does not yet support Translation / Summarization )
I will try to use TFTrainer for TF2 on Seq2Seq problems. If that doesn’t work, I think I will try to write custom loop in TF2.
You can use trainer for seq2seq as well, you’ll just need to write a different data collator which will return the expected arguments to the model.
Few things to note about the that notebook,
I wrote it before v3.0.0, few things have changed after that
DatCollator is not a class anymore, so you won’t need to inherit from DataCollator when creating T2TDataCollator. Also collate_batch should be renamed to __call__.
lm_lables is now deprecated, use labels instead.
Let me know if you run into problems using the notebook.
Hey everyone. We have recently contributed our community notebook that lets us train T5 using pure tensorflow 2. do checkout it out !!! For any issue you can log them to our offical repo.