Milestone 5 – Defining training parameters and hardware configurations
Now that our data is ready, we can start training our model. We’ll use the Hugging Face Trainer to help with most of the work. The Hugging Face Trainer
class provides a feature-complete training and evaluation loop for PyTorch models optimized for Transformers. It supports distributed training on multiple GPUs/TPUs and mixed precision and offers a lot of customizability for users. The Trainer
class abstracts away the complexities of the training loop, allowing users to focus on providing the essential components required for training, such as a model and a dataset. Here’s what we need to do:
- Set up a data collator: This tool takes our prepared data into PyTorch tensors that the model can use.
- Choose evaluation metrics: We want to see how well the model performs using the word error rate (WER) metric. To perform this calculation, we’ll create a function called compute_metrics...