hey @Mariam, my understanding is that the reason you see both the training and validation losses in the tutorial is because this is a jupyter notebook, so the Trainer uses the NotebookProgressCallback (link 10) to display the results during training.
when running the script, the PrinterCallback (link 9) is used instead and this callback only logs the training loss, learning rate and epoch number.
since you’re doing question-answering, my suggestion would be to either:

write your own callback to log both losses
edit the evaluate function of the QuestionAnsweringTrainer to log the validation loss: transformers/trainer_qa.py at d9c62047a8d75e18d2849d345ab3394875a712ef · huggingface/transformers · GitHub 16