Can the blue metric be used to train T5?

I read that for evaluation of sequences like machine translation, BLEU and ROUGE are used. Can’t this metric be used to train T5 for QA? if yes how?

for example in the training here iwant to add the bleu metric to the loss : Fine Tuning T5 Transformer Model with PyTorch - Shivanand Roy, Data Scientist