Evaluating and Saving Your Model
Check metrics and push to the Hub.
Training Is Not Enough
A trained model is only useful if it generalizes. So your next job is to evaluate it on data it never saw during training.
Run Evaluation
The Trainer can score your validation set in one call and return the metrics you configured, like accuracy and loss.
print(trainer.evaluate())All lessons in this course
- The Transformers Library Tour
- Tokenizing for Transformer Models
- Fine-Tuning With the Trainer API
- Evaluating and Saving Your Model